diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-18 01:29:05 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-18 01:29:05 -0400 |
commit | 9bd871df56a752029b07dde326d799648994b992 (patch) | |
tree | ce407ad9aec3e77792dc8692d5e5e93dba07f54c /kernel | |
parent | c343db455eb3105f11bb5ac290d77ab2006b0209 (diff) | |
parent | 12ad0cb2123aed30241a14792ef5bef9efcccbcd (diff) |
Merge tag 'trace-v4.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Steven writes:
"tracing: Two fixes for 4.19
This fixes two bugs:
- Fix size mismatch of tracepoint array
- Have preemptirq test module use same clock source of the selftest"
* tag 'trace-v4.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
tracing: Use trace_clock_local() for looping in preemptirq_delay_test.c
tracepoint: Fix tracepoint array element size mismatch
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/preemptirq_delay_test.c | 10 | ||||
-rw-r--r-- | kernel/tracepoint.c | 24 |
2 files changed, 13 insertions, 21 deletions
diff --git a/kernel/trace/preemptirq_delay_test.c b/kernel/trace/preemptirq_delay_test.c index f704390db9fc..d8765c952fab 100644 --- a/kernel/trace/preemptirq_delay_test.c +++ b/kernel/trace/preemptirq_delay_test.c | |||
@@ -5,12 +5,12 @@ | |||
5 | * Copyright (C) 2018 Joel Fernandes (Google) <joel@joelfernandes.org> | 5 | * Copyright (C) 2018 Joel Fernandes (Google) <joel@joelfernandes.org> |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/trace_clock.h> | ||
8 | #include <linux/delay.h> | 9 | #include <linux/delay.h> |
9 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
10 | #include <linux/irq.h> | 11 | #include <linux/irq.h> |
11 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
12 | #include <linux/kthread.h> | 13 | #include <linux/kthread.h> |
13 | #include <linux/ktime.h> | ||
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/printk.h> | 15 | #include <linux/printk.h> |
16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
@@ -25,13 +25,13 @@ MODULE_PARM_DESC(test_mode, "Mode of the test such as preempt or irq (default ir | |||
25 | 25 | ||
26 | static void busy_wait(ulong time) | 26 | static void busy_wait(ulong time) |
27 | { | 27 | { |
28 | ktime_t start, end; | 28 | u64 start, end; |
29 | start = ktime_get(); | 29 | start = trace_clock_local(); |
30 | do { | 30 | do { |
31 | end = ktime_get(); | 31 | end = trace_clock_local(); |
32 | if (kthread_should_stop()) | 32 | if (kthread_should_stop()) |
33 | break; | 33 | break; |
34 | } while (ktime_to_ns(ktime_sub(end, start)) < (time * 1000)); | 34 | } while ((end - start) < (time * 1000)); |
35 | } | 35 | } |
36 | 36 | ||
37 | static int preemptirq_delay_run(void *data) | 37 | static int preemptirq_delay_run(void *data) |
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index bf2c06ef9afc..a3be42304485 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c | |||
@@ -28,8 +28,8 @@ | |||
28 | #include <linux/sched/task.h> | 28 | #include <linux/sched/task.h> |
29 | #include <linux/static_key.h> | 29 | #include <linux/static_key.h> |
30 | 30 | ||
31 | extern struct tracepoint * const __start___tracepoints_ptrs[]; | 31 | extern tracepoint_ptr_t __start___tracepoints_ptrs[]; |
32 | extern struct tracepoint * const __stop___tracepoints_ptrs[]; | 32 | extern tracepoint_ptr_t __stop___tracepoints_ptrs[]; |
33 | 33 | ||
34 | DEFINE_SRCU(tracepoint_srcu); | 34 | DEFINE_SRCU(tracepoint_srcu); |
35 | EXPORT_SYMBOL_GPL(tracepoint_srcu); | 35 | EXPORT_SYMBOL_GPL(tracepoint_srcu); |
@@ -371,25 +371,17 @@ int tracepoint_probe_unregister(struct tracepoint *tp, void *probe, void *data) | |||
371 | } | 371 | } |
372 | EXPORT_SYMBOL_GPL(tracepoint_probe_unregister); | 372 | EXPORT_SYMBOL_GPL(tracepoint_probe_unregister); |
373 | 373 | ||
374 | static void for_each_tracepoint_range(struct tracepoint * const *begin, | 374 | static void for_each_tracepoint_range( |
375 | struct tracepoint * const *end, | 375 | tracepoint_ptr_t *begin, tracepoint_ptr_t *end, |
376 | void (*fct)(struct tracepoint *tp, void *priv), | 376 | void (*fct)(struct tracepoint *tp, void *priv), |
377 | void *priv) | 377 | void *priv) |
378 | { | 378 | { |
379 | tracepoint_ptr_t *iter; | ||
380 | |||
379 | if (!begin) | 381 | if (!begin) |
380 | return; | 382 | return; |
381 | 383 | for (iter = begin; iter < end; iter++) | |
382 | if (IS_ENABLED(CONFIG_HAVE_ARCH_PREL32_RELOCATIONS)) { | 384 | fct(tracepoint_ptr_deref(iter), priv); |
383 | const int *iter; | ||
384 | |||
385 | for (iter = (const int *)begin; iter < (const int *)end; iter++) | ||
386 | fct(offset_to_ptr(iter), priv); | ||
387 | } else { | ||
388 | struct tracepoint * const *iter; | ||
389 | |||
390 | for (iter = begin; iter < end; iter++) | ||
391 | fct(*iter, priv); | ||
392 | } | ||
393 | } | 385 | } |
394 | 386 | ||
395 | #ifdef CONFIG_MODULES | 387 | #ifdef CONFIG_MODULES |