From 08b070db024044d21779c63f721673e06032eff8 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Fri, 14 Jan 2011 18:14:31 +0100 Subject: [PATCH] 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 --- include/ust/clock.h | 2 +- libust/tracectl.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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; -- 2.34.1