diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-07 17:38:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-07 17:38:16 -0500 |
commit | c3abcabe813b4a0976b58f7e6c1e63b2070c8dda (patch) | |
tree | 72d7719e484340ddca3d5cf2710823f25a5d6542 | |
parent | 500e1af25209a048daa1f1f86083d4849d5c555b (diff) | |
parent | 9d020d33fc1b2faa0eb35859df1381ca5dc94ffe (diff) |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar:
"This includes a fix for a crash if certain special addresses are
kprobed, plus does a rename of two Kconfig variables that were a minor
misnomer"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf/core: Rename CONFIG_[UK]PROBE_EVENT to CONFIG_[UK]PROBE_EVENTS
kprobes/x86: Fix kernel panic when certain exception-handling addresses are probed
-rw-r--r-- | Documentation/trace/kprobetrace.txt | 2 | ||||
-rw-r--r-- | Documentation/trace/uprobetracer.txt | 2 | ||||
-rw-r--r-- | arch/s390/configs/default_defconfig | 2 | ||||
-rw-r--r-- | arch/s390/configs/gcov_defconfig | 2 | ||||
-rw-r--r-- | arch/s390/configs/performance_defconfig | 2 | ||||
-rw-r--r-- | arch/s390/defconfig | 2 | ||||
-rw-r--r-- | arch/x86/kernel/kprobes/common.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/kprobes/core.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/kprobes/opt.c | 2 | ||||
-rw-r--r-- | kernel/trace/Kconfig | 6 | ||||
-rw-r--r-- | kernel/trace/Makefile | 4 | ||||
-rw-r--r-- | kernel/trace/trace.c | 10 | ||||
-rw-r--r-- | kernel/trace/trace_probe.h | 4 |
13 files changed, 23 insertions, 23 deletions
diff --git a/Documentation/trace/kprobetrace.txt b/Documentation/trace/kprobetrace.txt index e4991fb1eedc..41ef9d8efe95 100644 --- a/Documentation/trace/kprobetrace.txt +++ b/Documentation/trace/kprobetrace.txt | |||
@@ -12,7 +12,7 @@ kprobes can probe (this means, all functions body except for __kprobes | |||
12 | functions). Unlike the Tracepoint based event, this can be added and removed | 12 | functions). Unlike the Tracepoint based event, this can be added and removed |
13 | dynamically, on the fly. | 13 | dynamically, on the fly. |
14 | 14 | ||
15 | To enable this feature, build your kernel with CONFIG_KPROBE_EVENT=y. | 15 | To enable this feature, build your kernel with CONFIG_KPROBE_EVENTS=y. |
16 | 16 | ||
17 | Similar to the events tracer, this doesn't need to be activated via | 17 | Similar to the events tracer, this doesn't need to be activated via |
18 | current_tracer. Instead of that, add probe points via | 18 | current_tracer. Instead of that, add probe points via |
diff --git a/Documentation/trace/uprobetracer.txt b/Documentation/trace/uprobetracer.txt index fa7b680ee8a0..bf526a7c5559 100644 --- a/Documentation/trace/uprobetracer.txt +++ b/Documentation/trace/uprobetracer.txt | |||
@@ -7,7 +7,7 @@ | |||
7 | Overview | 7 | Overview |
8 | -------- | 8 | -------- |
9 | Uprobe based trace events are similar to kprobe based trace events. | 9 | Uprobe based trace events are similar to kprobe based trace events. |
10 | To enable this feature, build your kernel with CONFIG_UPROBE_EVENT=y. | 10 | To enable this feature, build your kernel with CONFIG_UPROBE_EVENTS=y. |
11 | 11 | ||
12 | Similar to the kprobe-event tracer, this doesn't need to be activated via | 12 | Similar to the kprobe-event tracer, this doesn't need to be activated via |
13 | current_tracer. Instead of that, add probe points via | 13 | current_tracer. Instead of that, add probe points via |
diff --git a/arch/s390/configs/default_defconfig b/arch/s390/configs/default_defconfig index 143b1e00b818..4b176fe83da4 100644 --- a/arch/s390/configs/default_defconfig +++ b/arch/s390/configs/default_defconfig | |||
@@ -609,7 +609,7 @@ CONFIG_SCHED_TRACER=y | |||
609 | CONFIG_FTRACE_SYSCALLS=y | 609 | CONFIG_FTRACE_SYSCALLS=y |
610 | CONFIG_STACK_TRACER=y | 610 | CONFIG_STACK_TRACER=y |
611 | CONFIG_BLK_DEV_IO_TRACE=y | 611 | CONFIG_BLK_DEV_IO_TRACE=y |
612 | CONFIG_UPROBE_EVENT=y | 612 | CONFIG_UPROBE_EVENTS=y |
613 | CONFIG_FUNCTION_PROFILER=y | 613 | CONFIG_FUNCTION_PROFILER=y |
614 | CONFIG_HIST_TRIGGERS=y | 614 | CONFIG_HIST_TRIGGERS=y |
615 | CONFIG_TRACE_ENUM_MAP_FILE=y | 615 | CONFIG_TRACE_ENUM_MAP_FILE=y |
diff --git a/arch/s390/configs/gcov_defconfig b/arch/s390/configs/gcov_defconfig index f05d2d6e1087..0de46cc397f6 100644 --- a/arch/s390/configs/gcov_defconfig +++ b/arch/s390/configs/gcov_defconfig | |||
@@ -560,7 +560,7 @@ CONFIG_SCHED_TRACER=y | |||
560 | CONFIG_FTRACE_SYSCALLS=y | 560 | CONFIG_FTRACE_SYSCALLS=y |
561 | CONFIG_STACK_TRACER=y | 561 | CONFIG_STACK_TRACER=y |
562 | CONFIG_BLK_DEV_IO_TRACE=y | 562 | CONFIG_BLK_DEV_IO_TRACE=y |
563 | CONFIG_UPROBE_EVENT=y | 563 | CONFIG_UPROBE_EVENTS=y |
564 | CONFIG_FUNCTION_PROFILER=y | 564 | CONFIG_FUNCTION_PROFILER=y |
565 | CONFIG_HIST_TRIGGERS=y | 565 | CONFIG_HIST_TRIGGERS=y |
566 | CONFIG_TRACE_ENUM_MAP_FILE=y | 566 | CONFIG_TRACE_ENUM_MAP_FILE=y |
diff --git a/arch/s390/configs/performance_defconfig b/arch/s390/configs/performance_defconfig index 2358bf33c5ef..e167557b434c 100644 --- a/arch/s390/configs/performance_defconfig +++ b/arch/s390/configs/performance_defconfig | |||
@@ -558,7 +558,7 @@ CONFIG_SCHED_TRACER=y | |||
558 | CONFIG_FTRACE_SYSCALLS=y | 558 | CONFIG_FTRACE_SYSCALLS=y |
559 | CONFIG_STACK_TRACER=y | 559 | CONFIG_STACK_TRACER=y |
560 | CONFIG_BLK_DEV_IO_TRACE=y | 560 | CONFIG_BLK_DEV_IO_TRACE=y |
561 | CONFIG_UPROBE_EVENT=y | 561 | CONFIG_UPROBE_EVENTS=y |
562 | CONFIG_FUNCTION_PROFILER=y | 562 | CONFIG_FUNCTION_PROFILER=y |
563 | CONFIG_HIST_TRIGGERS=y | 563 | CONFIG_HIST_TRIGGERS=y |
564 | CONFIG_TRACE_ENUM_MAP_FILE=y | 564 | CONFIG_TRACE_ENUM_MAP_FILE=y |
diff --git a/arch/s390/defconfig b/arch/s390/defconfig index 68bfd09f1b02..97189dbaf34b 100644 --- a/arch/s390/defconfig +++ b/arch/s390/defconfig | |||
@@ -179,7 +179,7 @@ CONFIG_FTRACE_SYSCALLS=y | |||
179 | CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP=y | 179 | CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP=y |
180 | CONFIG_STACK_TRACER=y | 180 | CONFIG_STACK_TRACER=y |
181 | CONFIG_BLK_DEV_IO_TRACE=y | 181 | CONFIG_BLK_DEV_IO_TRACE=y |
182 | CONFIG_UPROBE_EVENT=y | 182 | CONFIG_UPROBE_EVENTS=y |
183 | CONFIG_FUNCTION_PROFILER=y | 183 | CONFIG_FUNCTION_PROFILER=y |
184 | CONFIG_TRACE_ENUM_MAP_FILE=y | 184 | CONFIG_TRACE_ENUM_MAP_FILE=y |
185 | CONFIG_KPROBES_SANITY_TEST=y | 185 | CONFIG_KPROBES_SANITY_TEST=y |
diff --git a/arch/x86/kernel/kprobes/common.h b/arch/x86/kernel/kprobes/common.h index c6ee63f927ab..d688826e5736 100644 --- a/arch/x86/kernel/kprobes/common.h +++ b/arch/x86/kernel/kprobes/common.h | |||
@@ -67,7 +67,7 @@ | |||
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | /* Ensure if the instruction can be boostable */ | 69 | /* Ensure if the instruction can be boostable */ |
70 | extern int can_boost(kprobe_opcode_t *instruction); | 70 | extern int can_boost(kprobe_opcode_t *instruction, void *addr); |
71 | /* Recover instruction if given address is probed */ | 71 | /* Recover instruction if given address is probed */ |
72 | extern unsigned long recover_probed_instruction(kprobe_opcode_t *buf, | 72 | extern unsigned long recover_probed_instruction(kprobe_opcode_t *buf, |
73 | unsigned long addr); | 73 | unsigned long addr); |
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index 6384eb754a58..993fa4fe4f68 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c | |||
@@ -167,12 +167,12 @@ NOKPROBE_SYMBOL(skip_prefixes); | |||
167 | * Returns non-zero if opcode is boostable. | 167 | * Returns non-zero if opcode is boostable. |
168 | * RIP relative instructions are adjusted at copying time in 64 bits mode | 168 | * RIP relative instructions are adjusted at copying time in 64 bits mode |
169 | */ | 169 | */ |
170 | int can_boost(kprobe_opcode_t *opcodes) | 170 | int can_boost(kprobe_opcode_t *opcodes, void *addr) |
171 | { | 171 | { |
172 | kprobe_opcode_t opcode; | 172 | kprobe_opcode_t opcode; |
173 | kprobe_opcode_t *orig_opcodes = opcodes; | 173 | kprobe_opcode_t *orig_opcodes = opcodes; |
174 | 174 | ||
175 | if (search_exception_tables((unsigned long)opcodes)) | 175 | if (search_exception_tables((unsigned long)addr)) |
176 | return 0; /* Page fault may occur on this address. */ | 176 | return 0; /* Page fault may occur on this address. */ |
177 | 177 | ||
178 | retry: | 178 | retry: |
@@ -417,7 +417,7 @@ static int arch_copy_kprobe(struct kprobe *p) | |||
417 | * __copy_instruction can modify the displacement of the instruction, | 417 | * __copy_instruction can modify the displacement of the instruction, |
418 | * but it doesn't affect boostable check. | 418 | * but it doesn't affect boostable check. |
419 | */ | 419 | */ |
420 | if (can_boost(p->ainsn.insn)) | 420 | if (can_boost(p->ainsn.insn, p->addr)) |
421 | p->ainsn.boostable = 0; | 421 | p->ainsn.boostable = 0; |
422 | else | 422 | else |
423 | p->ainsn.boostable = -1; | 423 | p->ainsn.boostable = -1; |
diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c index 3d1bee9d6a72..3e7c6e5a08ff 100644 --- a/arch/x86/kernel/kprobes/opt.c +++ b/arch/x86/kernel/kprobes/opt.c | |||
@@ -178,7 +178,7 @@ static int copy_optimized_instructions(u8 *dest, u8 *src) | |||
178 | 178 | ||
179 | while (len < RELATIVEJUMP_SIZE) { | 179 | while (len < RELATIVEJUMP_SIZE) { |
180 | ret = __copy_instruction(dest + len, src + len); | 180 | ret = __copy_instruction(dest + len, src + len); |
181 | if (!ret || !can_boost(dest + len)) | 181 | if (!ret || !can_boost(dest + len, src + len)) |
182 | return -EINVAL; | 182 | return -EINVAL; |
183 | len += ret; | 183 | len += ret; |
184 | } | 184 | } |
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index d5038005eb5d..d4a06e714645 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig | |||
@@ -429,7 +429,7 @@ config BLK_DEV_IO_TRACE | |||
429 | 429 | ||
430 | If unsure, say N. | 430 | If unsure, say N. |
431 | 431 | ||
432 | config KPROBE_EVENT | 432 | config KPROBE_EVENTS |
433 | depends on KPROBES | 433 | depends on KPROBES |
434 | depends on HAVE_REGS_AND_STACK_ACCESS_API | 434 | depends on HAVE_REGS_AND_STACK_ACCESS_API |
435 | bool "Enable kprobes-based dynamic events" | 435 | bool "Enable kprobes-based dynamic events" |
@@ -447,7 +447,7 @@ config KPROBE_EVENT | |||
447 | This option is also required by perf-probe subcommand of perf tools. | 447 | This option is also required by perf-probe subcommand of perf tools. |
448 | If you want to use perf tools, this option is strongly recommended. | 448 | If you want to use perf tools, this option is strongly recommended. |
449 | 449 | ||
450 | config UPROBE_EVENT | 450 | config UPROBE_EVENTS |
451 | bool "Enable uprobes-based dynamic events" | 451 | bool "Enable uprobes-based dynamic events" |
452 | depends on ARCH_SUPPORTS_UPROBES | 452 | depends on ARCH_SUPPORTS_UPROBES |
453 | depends on MMU | 453 | depends on MMU |
@@ -466,7 +466,7 @@ config UPROBE_EVENT | |||
466 | 466 | ||
467 | config BPF_EVENTS | 467 | config BPF_EVENTS |
468 | depends on BPF_SYSCALL | 468 | depends on BPF_SYSCALL |
469 | depends on (KPROBE_EVENT || UPROBE_EVENT) && PERF_EVENTS | 469 | depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS |
470 | bool | 470 | bool |
471 | default y | 471 | default y |
472 | help | 472 | help |
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile index e57980845549..90f2701d92a7 100644 --- a/kernel/trace/Makefile +++ b/kernel/trace/Makefile | |||
@@ -57,7 +57,7 @@ obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o | |||
57 | obj-$(CONFIG_EVENT_TRACING) += trace_events_trigger.o | 57 | obj-$(CONFIG_EVENT_TRACING) += trace_events_trigger.o |
58 | obj-$(CONFIG_HIST_TRIGGERS) += trace_events_hist.o | 58 | obj-$(CONFIG_HIST_TRIGGERS) += trace_events_hist.o |
59 | obj-$(CONFIG_BPF_EVENTS) += bpf_trace.o | 59 | obj-$(CONFIG_BPF_EVENTS) += bpf_trace.o |
60 | obj-$(CONFIG_KPROBE_EVENT) += trace_kprobe.o | 60 | obj-$(CONFIG_KPROBE_EVENTS) += trace_kprobe.o |
61 | obj-$(CONFIG_TRACEPOINTS) += power-traces.o | 61 | obj-$(CONFIG_TRACEPOINTS) += power-traces.o |
62 | ifeq ($(CONFIG_PM),y) | 62 | ifeq ($(CONFIG_PM),y) |
63 | obj-$(CONFIG_TRACEPOINTS) += rpm-traces.o | 63 | obj-$(CONFIG_TRACEPOINTS) += rpm-traces.o |
@@ -66,7 +66,7 @@ ifeq ($(CONFIG_TRACING),y) | |||
66 | obj-$(CONFIG_KGDB_KDB) += trace_kdb.o | 66 | obj-$(CONFIG_KGDB_KDB) += trace_kdb.o |
67 | endif | 67 | endif |
68 | obj-$(CONFIG_PROBE_EVENTS) += trace_probe.o | 68 | obj-$(CONFIG_PROBE_EVENTS) += trace_probe.o |
69 | obj-$(CONFIG_UPROBE_EVENT) += trace_uprobe.o | 69 | obj-$(CONFIG_UPROBE_EVENTS) += trace_uprobe.o |
70 | 70 | ||
71 | obj-$(CONFIG_TRACEPOINT_BENCHMARK) += trace_benchmark.o | 71 | obj-$(CONFIG_TRACEPOINT_BENCHMARK) += trace_benchmark.o |
72 | 72 | ||
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 707445ceb7ef..f35109514a01 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -4341,22 +4341,22 @@ static const char readme_msg[] = | |||
4341 | "\t\t\t traces\n" | 4341 | "\t\t\t traces\n" |
4342 | #endif | 4342 | #endif |
4343 | #endif /* CONFIG_STACK_TRACER */ | 4343 | #endif /* CONFIG_STACK_TRACER */ |
4344 | #ifdef CONFIG_KPROBE_EVENT | 4344 | #ifdef CONFIG_KPROBE_EVENTS |
4345 | " kprobe_events\t\t- Add/remove/show the kernel dynamic events\n" | 4345 | " kprobe_events\t\t- Add/remove/show the kernel dynamic events\n" |
4346 | "\t\t\t Write into this file to define/undefine new trace events.\n" | 4346 | "\t\t\t Write into this file to define/undefine new trace events.\n" |
4347 | #endif | 4347 | #endif |
4348 | #ifdef CONFIG_UPROBE_EVENT | 4348 | #ifdef CONFIG_UPROBE_EVENTS |
4349 | " uprobe_events\t\t- Add/remove/show the userspace dynamic events\n" | 4349 | " uprobe_events\t\t- Add/remove/show the userspace dynamic events\n" |
4350 | "\t\t\t Write into this file to define/undefine new trace events.\n" | 4350 | "\t\t\t Write into this file to define/undefine new trace events.\n" |
4351 | #endif | 4351 | #endif |
4352 | #if defined(CONFIG_KPROBE_EVENT) || defined(CONFIG_UPROBE_EVENT) | 4352 | #if defined(CONFIG_KPROBE_EVENTS) || defined(CONFIG_UPROBE_EVENTS) |
4353 | "\t accepts: event-definitions (one definition per line)\n" | 4353 | "\t accepts: event-definitions (one definition per line)\n" |
4354 | "\t Format: p|r[:[<group>/]<event>] <place> [<args>]\n" | 4354 | "\t Format: p|r[:[<group>/]<event>] <place> [<args>]\n" |
4355 | "\t -:[<group>/]<event>\n" | 4355 | "\t -:[<group>/]<event>\n" |
4356 | #ifdef CONFIG_KPROBE_EVENT | 4356 | #ifdef CONFIG_KPROBE_EVENTS |
4357 | "\t place: [<module>:]<symbol>[+<offset>]|<memaddr>\n" | 4357 | "\t place: [<module>:]<symbol>[+<offset>]|<memaddr>\n" |
4358 | #endif | 4358 | #endif |
4359 | #ifdef CONFIG_UPROBE_EVENT | 4359 | #ifdef CONFIG_UPROBE_EVENTS |
4360 | "\t place: <path>:<offset>\n" | 4360 | "\t place: <path>:<offset>\n" |
4361 | #endif | 4361 | #endif |
4362 | "\t args: <name>=fetcharg[:type]\n" | 4362 | "\t args: <name>=fetcharg[:type]\n" |
diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h index 0c0ae54d44c6..903273c93e61 100644 --- a/kernel/trace/trace_probe.h +++ b/kernel/trace/trace_probe.h | |||
@@ -248,7 +248,7 @@ ASSIGN_FETCH_FUNC(file_offset, ftype), \ | |||
248 | #define FETCH_TYPE_STRING 0 | 248 | #define FETCH_TYPE_STRING 0 |
249 | #define FETCH_TYPE_STRSIZE 1 | 249 | #define FETCH_TYPE_STRSIZE 1 |
250 | 250 | ||
251 | #ifdef CONFIG_KPROBE_EVENT | 251 | #ifdef CONFIG_KPROBE_EVENTS |
252 | struct symbol_cache; | 252 | struct symbol_cache; |
253 | unsigned long update_symbol_cache(struct symbol_cache *sc); | 253 | unsigned long update_symbol_cache(struct symbol_cache *sc); |
254 | void free_symbol_cache(struct symbol_cache *sc); | 254 | void free_symbol_cache(struct symbol_cache *sc); |
@@ -278,7 +278,7 @@ alloc_symbol_cache(const char *sym, long offset) | |||
278 | { | 278 | { |
279 | return NULL; | 279 | return NULL; |
280 | } | 280 | } |
281 | #endif /* CONFIG_KPROBE_EVENT */ | 281 | #endif /* CONFIG_KPROBE_EVENTS */ |
282 | 282 | ||
283 | struct probe_arg { | 283 | struct probe_arg { |
284 | struct fetch_param fetch; | 284 | struct fetch_param fetch; |