From: David Goulet Date: Fri, 14 Jan 2011 17:14:31 +0000 (+0100) Subject: Fix variable declaration of the clock source v2 X-Git-Tag: v0.11~2 X-Git-Url: http://git.lttng.org/?p=ust.git;a=commitdiff_plain;h=08b070db024044d21779c63f721673e06032eff8 Fix variable declaration of the clock source v2 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 Acked-by: Mathieu Desnoyers Acked-by: Nils Carlson --- 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;