diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-26 19:22:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-26 19:22:47 -0400 |
commit | 47b5ece937c27a2f541cb26509f7ba5491c8c99c (patch) | |
tree | 99f4624172514c5ba8e908a280501f89a963d471 | |
parent | fe03a7594d86e0754f05e604cd803a6a9aae3c1c (diff) | |
parent | 9a0fd675304d410f3a9586e1b333e16f4658d56c (diff) |
Merge tag 'trace-v4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fixes from Steven Rostedt:
- Add workqueue forward declaration (for new work, but a nice clean up)
- seftest fixes for the new histogram code
- Print output fix for hwlat tracer
- Fix missing system call events - due to change in x86 syscall naming
- Fix kprobe address being used by perf being hashed
* tag 'trace-v4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
tracing: Fix missing tab for hwlat_detector print format
selftests: ftrace: Add a testcase for multiple actions on trigger
selftests: ftrace: Fix trigger extended error testcase
kprobes: Fix random address output of blacklist file
tracing: Fix kernel crash while using empty filter with perf
tracing/x86: Update syscall trace events to handle new prefixed syscall func names
tracing: Add missing forward declaration
-rw-r--r-- | arch/x86/include/asm/ftrace.h | 19 | ||||
-rw-r--r-- | include/trace/events/workqueue.h | 2 | ||||
-rw-r--r-- | kernel/kprobes.c | 2 | ||||
-rw-r--r-- | kernel/trace/trace_entries.h | 2 | ||||
-rw-r--r-- | kernel/trace/trace_events_filter.c | 14 | ||||
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc | 2 | ||||
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc | 44 |
7 files changed, 73 insertions, 12 deletions
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h index 09ad88572746..cc8f8fcf9b4a 100644 --- a/arch/x86/include/asm/ftrace.h +++ b/arch/x86/include/asm/ftrace.h | |||
@@ -46,7 +46,21 @@ int ftrace_int3_handler(struct pt_regs *regs); | |||
46 | #endif /* CONFIG_FUNCTION_TRACER */ | 46 | #endif /* CONFIG_FUNCTION_TRACER */ |
47 | 47 | ||
48 | 48 | ||
49 | #if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS) | 49 | #ifndef __ASSEMBLY__ |
50 | |||
51 | #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME | ||
52 | static inline bool arch_syscall_match_sym_name(const char *sym, const char *name) | ||
53 | { | ||
54 | /* | ||
55 | * Compare the symbol name with the system call name. Skip the | ||
56 | * "__x64_sys", "__ia32_sys" or simple "sys" prefix. | ||
57 | */ | ||
58 | return !strcmp(sym + 3, name + 3) || | ||
59 | (!strncmp(sym, "__x64_", 6) && !strcmp(sym + 9, name + 3)) || | ||
60 | (!strncmp(sym, "__ia32_", 7) && !strcmp(sym + 10, name + 3)); | ||
61 | } | ||
62 | |||
63 | #ifndef COMPILE_OFFSETS | ||
50 | 64 | ||
51 | #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION) | 65 | #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION) |
52 | #include <asm/compat.h> | 66 | #include <asm/compat.h> |
@@ -67,6 +81,7 @@ static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs) | |||
67 | return false; | 81 | return false; |
68 | } | 82 | } |
69 | #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA32_EMULATION */ | 83 | #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA32_EMULATION */ |
70 | #endif /* !__ASSEMBLY__ && !COMPILE_OFFSETS */ | 84 | #endif /* !COMPILE_OFFSETS */ |
85 | #endif /* !__ASSEMBLY__ */ | ||
71 | 86 | ||
72 | #endif /* _ASM_X86_FTRACE_H */ | 87 | #endif /* _ASM_X86_FTRACE_H */ |
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h index 2f057a494d93..9a761bc6a251 100644 --- a/include/trace/events/workqueue.h +++ b/include/trace/events/workqueue.h | |||
@@ -25,6 +25,8 @@ DECLARE_EVENT_CLASS(workqueue_work, | |||
25 | TP_printk("work struct %p", __entry->work) | 25 | TP_printk("work struct %p", __entry->work) |
26 | ); | 26 | ); |
27 | 27 | ||
28 | struct pool_workqueue; | ||
29 | |||
28 | /** | 30 | /** |
29 | * workqueue_queue_work - called when a work gets queued | 31 | * workqueue_queue_work - called when a work gets queued |
30 | * @req_cpu: the requested cpu | 32 | * @req_cpu: the requested cpu |
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 102160ff5c66..ea619021d901 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -2428,7 +2428,7 @@ static int kprobe_blacklist_seq_show(struct seq_file *m, void *v) | |||
2428 | struct kprobe_blacklist_entry *ent = | 2428 | struct kprobe_blacklist_entry *ent = |
2429 | list_entry(v, struct kprobe_blacklist_entry, list); | 2429 | list_entry(v, struct kprobe_blacklist_entry, list); |
2430 | 2430 | ||
2431 | seq_printf(m, "0x%p-0x%p\t%ps\n", (void *)ent->start_addr, | 2431 | seq_printf(m, "0x%px-0x%px\t%ps\n", (void *)ent->start_addr, |
2432 | (void *)ent->end_addr, (void *)ent->start_addr); | 2432 | (void *)ent->end_addr, (void *)ent->start_addr); |
2433 | return 0; | 2433 | return 0; |
2434 | } | 2434 | } |
diff --git a/kernel/trace/trace_entries.h b/kernel/trace/trace_entries.h index e954ae3d82c0..e3a658bac10f 100644 --- a/kernel/trace/trace_entries.h +++ b/kernel/trace/trace_entries.h | |||
@@ -356,7 +356,7 @@ FTRACE_ENTRY(hwlat, hwlat_entry, | |||
356 | __field( unsigned int, seqnum ) | 356 | __field( unsigned int, seqnum ) |
357 | ), | 357 | ), |
358 | 358 | ||
359 | F_printk("cnt:%u\tts:%010llu.%010lu\tinner:%llu\touter:%llunmi-ts:%llu\tnmi-count:%u\n", | 359 | F_printk("cnt:%u\tts:%010llu.%010lu\tinner:%llu\touter:%llu\tnmi-ts:%llu\tnmi-count:%u\n", |
360 | __entry->seqnum, | 360 | __entry->seqnum, |
361 | __entry->tv_sec, | 361 | __entry->tv_sec, |
362 | __entry->tv_nsec, | 362 | __entry->tv_nsec, |
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 9b4716bb8bb0..1f951b3df60c 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
@@ -1499,14 +1499,14 @@ static int process_preds(struct trace_event_call *call, | |||
1499 | return ret; | 1499 | return ret; |
1500 | } | 1500 | } |
1501 | 1501 | ||
1502 | if (!nr_preds) { | 1502 | if (!nr_preds) |
1503 | prog = NULL; | 1503 | return -EINVAL; |
1504 | } else { | 1504 | |
1505 | prog = predicate_parse(filter_string, nr_parens, nr_preds, | 1505 | prog = predicate_parse(filter_string, nr_parens, nr_preds, |
1506 | parse_pred, call, pe); | 1506 | parse_pred, call, pe); |
1507 | if (IS_ERR(prog)) | 1507 | if (IS_ERR(prog)) |
1508 | return PTR_ERR(prog); | 1508 | return PTR_ERR(prog); |
1509 | } | 1509 | |
1510 | rcu_assign_pointer(filter->prog, prog); | 1510 | rcu_assign_pointer(filter->prog, prog); |
1511 | return 0; | 1511 | return 0; |
1512 | } | 1512 | } |
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc index 786dce7e48be..2aabab363cfb 100644 --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc | |||
@@ -29,7 +29,7 @@ do_reset | |||
29 | 29 | ||
30 | echo "Test extended error support" | 30 | echo "Test extended error support" |
31 | echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger | 31 | echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger |
32 | echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger &>/dev/null | 32 | ! echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger 2> /dev/null |
33 | if ! grep -q "ERROR:" events/sched/sched_wakeup/hist; then | 33 | if ! grep -q "ERROR:" events/sched/sched_wakeup/hist; then |
34 | fail "Failed to generate extended error in histogram" | 34 | fail "Failed to generate extended error in histogram" |
35 | fi | 35 | fi |
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc new file mode 100644 index 000000000000..c193dce611a2 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc | |||
@@ -0,0 +1,44 @@ | |||
1 | #!/bin/sh | ||
2 | # description: event trigger - test multiple actions on hist trigger | ||
3 | |||
4 | |||
5 | do_reset() { | ||
6 | reset_trigger | ||
7 | echo > set_event | ||
8 | clear_trace | ||
9 | } | ||
10 | |||
11 | fail() { #msg | ||
12 | do_reset | ||
13 | echo $1 | ||
14 | exit_fail | ||
15 | } | ||
16 | |||
17 | if [ ! -f set_event ]; then | ||
18 | echo "event tracing is not supported" | ||
19 | exit_unsupported | ||
20 | fi | ||
21 | |||
22 | if [ ! -f synthetic_events ]; then | ||
23 | echo "synthetic event is not supported" | ||
24 | exit_unsupported | ||
25 | fi | ||
26 | |||
27 | clear_synthetic_events | ||
28 | reset_tracer | ||
29 | do_reset | ||
30 | |||
31 | echo "Test multiple actions on hist trigger" | ||
32 | echo 'wakeup_latency u64 lat; pid_t pid' >> synthetic_events | ||
33 | TRIGGER1=events/sched/sched_wakeup/trigger | ||
34 | TRIGGER2=events/sched/sched_switch/trigger | ||
35 | |||
36 | echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest"' > $TRIGGER1 | ||
37 | echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0 if next_comm=="cyclictest"' >> $TRIGGER2 | ||
38 | echo 'hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,next_pid) if next_comm=="cyclictest"' >> $TRIGGER2 | ||
39 | echo 'hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,prev_pid) if next_comm=="cyclictest"' >> $TRIGGER2 | ||
40 | echo 'hist:keys=next_pid if next_comm=="cyclictest"' >> $TRIGGER2 | ||
41 | |||
42 | do_reset | ||
43 | |||
44 | exit 0 | ||