[ltt-dev] [UST PATCH] Fix variable declaration of the clock source v2

David Goulet david.goulet at polymtl.ca
Fri Jan 14 12:14:31 EST 2011


The ust_clock_source was static in clock.h header file.
Thus, tracectl.c was not able to modify that variable for
the trace clock read function. Bad timestamp was always
returned if CLOCK_TRACE was not available.

v2:
	Comment by Mathieu Desnoyers, set clock source variable
	to extern in clock.h

Signed-off-by: David Goulet <david.goulet at polymtl.ca>
---
 include/ust/clock.h |    2 +-
 libust/tracectl.c   |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/ust/clock.h b/include/ust/clock.h
index ac0a2d5..04785fc 100644
--- a/include/ust/clock.h
+++ b/include/ust/clock.h
@@ -49,7 +49,7 @@ union lttng_timespec {
 };
 #endif /* __i386__ || __x86_64__ */
 
-static int ust_clock_source;
+extern int ust_clock_source;
 
 /* Choosing correct trace clock */
 #if __PPC__
diff --git a/libust/tracectl.c b/libust/tracectl.c
index 4f016bb..b73fa7c 100644
--- a/libust/tracectl.c
+++ b/libust/tracectl.c
@@ -74,6 +74,8 @@ static struct cds_list_head ust_socks = CDS_LIST_HEAD_INIT(ust_socks);
 /* volatile because shared between the listener and the main thread */
 int buffers_to_export = 0;
 
+int ust_clock_source;
+
 static long long make_pidunique(void)
 {
 	s64 retval;
-- 
1.7.3.5





More information about the lttng-dev mailing list