diff options
author | Dexuan Cui <dexuan.cui@intel.com> | 2011-02-10 14:49:36 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-10 12:01:04 +0000 |
commit | 0b50dc8ed66058251349f1d471f75623f9a2fb8b (patch) | |
tree | 92b1e20e80200beca6e858c08114c31c6f4d372c /meta/recipes-kernel/lttng/lttng-ust-0.11 | |
parent | 296866c38e1b88df42d66bdc32cfed2d5212914c (diff) | |
download | poky-0b50dc8ed66058251349f1d471f75623f9a2fb8b.tar.gz |
lttng-ust: fix ppc build by removing ppc specific time reading function
Here I introduced a patch from lttng mailing list to fix ppc build.
See the patch for more details.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-ust-0.11')
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-ust-0.11/remove_ppc_specific_time_reading_function.patch | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-ust-0.11/remove_ppc_specific_time_reading_function.patch b/meta/recipes-kernel/lttng/lttng-ust-0.11/remove_ppc_specific_time_reading_function.patch new file mode 100644 index 0000000000..c5487fd916 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-ust-0.11/remove_ppc_specific_time_reading_function.patch | |||
@@ -0,0 +1,85 @@ | |||
1 | Dexuan Cui <dexuan.cui@intel.com>: I got the following patch from lttng dev | ||
2 | mailing list: | ||
3 | http://lists.casi.polymtl.ca/pipermail/ltt-dev/2011-February/003903.html | ||
4 | The patch looks good and I think it would be in next release. At present, | ||
5 | let's add it into SRC_URI. | ||
6 | |||
7 | ----------------------------------------------------------------- | ||
8 | The PPC version of the trace_clock_read64 was using the TB register | ||
9 | which is not constant accross implementations. The currently | ||
10 | measured time base on PPC was not accurate. | ||
11 | So, for now, we rely on the CLOCK_MONOTONIC. | ||
12 | |||
13 | This patch remove a bunch of #ifdef for x86 and PPC, since we now rely on | ||
14 | the same base clock. It also fix the build on PPC that was currently broken | ||
15 | |||
16 | Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com> | ||
17 | ----------------------------------------------------------------- | ||
18 | |||
19 | --- a/include/ust/clock.h | ||
20 | +++ b/include/ust/clock.h | ||
21 | @@ -39,7 +39,6 @@ | ||
22 | precision and monotonicity. | ||
23 | */ | ||
24 | |||
25 | -#if __i386__ || __x86_64__ | ||
26 | /* Only available for x86 arch */ | ||
27 | #define CLOCK_TRACE_FREQ 14 | ||
28 | #define CLOCK_TRACE 15 | ||
29 | @@ -47,36 +46,10 @@ | ||
30 | struct timespec ts; | ||
31 | u64 lttng_ts; | ||
32 | }; | ||
33 | -#endif /* __i386__ || __x86_64__ */ | ||
34 | |||
35 | extern int ust_clock_source; | ||
36 | |||
37 | /* Choosing correct trace clock */ | ||
38 | -#if __PPC__ | ||
39 | -static __inline__ u64 trace_clock_read64(void) | ||
40 | -{ | ||
41 | - unsigned long tb_l; | ||
42 | - unsigned long tb_h; | ||
43 | - unsigned long tb_h2; | ||
44 | - u64 tb; | ||
45 | - | ||
46 | - __asm__ ( | ||
47 | - "1:\n\t" | ||
48 | - "mftbu %[rhigh]\n\t" | ||
49 | - "mftb %[rlow]\n\t" | ||
50 | - "mftbu %[rhigh2]\n\t" | ||
51 | - "cmpw %[rhigh],%[rhigh2]\n\t" | ||
52 | - "bne 1b\n\t" | ||
53 | - : [rhigh] "=r" (tb_h), [rhigh2] "=r" (tb_h2), [rlow] "=r" (tb_l)); | ||
54 | - | ||
55 | - tb = tb_h; | ||
56 | - tb <<= 32; | ||
57 | - tb |= tb_l; | ||
58 | - | ||
59 | - return tb; | ||
60 | -} | ||
61 | - | ||
62 | -#else /* !__PPC__ */ | ||
63 | |||
64 | static __inline__ u64 trace_clock_read64(void) | ||
65 | { | ||
66 | @@ -101,17 +74,17 @@ | ||
67 | return retval; | ||
68 | } | ||
69 | |||
70 | -#endif /* __PPC__ */ | ||
71 | - | ||
72 | static __inline__ u64 trace_clock_frequency(void) | ||
73 | { | ||
74 | struct timespec ts; | ||
75 | union lttng_timespec *lts = (union lttng_timespec *) &ts; | ||
76 | |||
77 | +#if __i386__ || __x86_64__ | ||
78 | if (likely(ust_clock_source == CLOCK_TRACE)) { | ||
79 | clock_gettime(CLOCK_TRACE_FREQ, &ts); | ||
80 | return lts->lttng_ts; | ||
81 | } | ||
82 | +#endif | ||
83 | return 1000000000LL; | ||
84 | } | ||
85 | |||