diff options
-rw-r--r-- | include/linux/ftrace_event.h | 2 | ||||
-rw-r--r-- | include/linux/perf_event.h | 2 | ||||
-rw-r--r-- | include/linux/syscalls.h | 4 | ||||
-rw-r--r-- | include/trace/ftrace.h | 12 | ||||
-rw-r--r-- | include/trace/syscall.h | 4 | ||||
-rw-r--r-- | init/Kconfig | 13 | ||||
-rw-r--r-- | kernel/perf_event.c | 4 | ||||
-rw-r--r-- | kernel/trace/Makefile | 4 | ||||
-rw-r--r-- | kernel/trace/trace_events_filter.c | 4 | ||||
-rw-r--r-- | kernel/trace/trace_kprobe.c | 14 | ||||
-rw-r--r-- | kernel/trace/trace_syscalls.c | 5 |
11 files changed, 28 insertions, 40 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 2233c98d80df..0a09e758c7d3 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -188,7 +188,7 @@ do { \ | |||
188 | __trace_printk(ip, fmt, ##args); \ | 188 | __trace_printk(ip, fmt, ##args); \ |
189 | } while (0) | 189 | } while (0) |
190 | 190 | ||
191 | #ifdef CONFIG_EVENT_PROFILE | 191 | #ifdef CONFIG_PERF_EVENTS |
192 | struct perf_event; | 192 | struct perf_event; |
193 | extern int ftrace_profile_enable(int event_id); | 193 | extern int ftrace_profile_enable(int event_id); |
194 | extern void ftrace_profile_disable(int event_id); | 194 | extern void ftrace_profile_disable(int event_id); |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index a494e7501292..9a1d276db754 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -658,7 +658,7 @@ struct perf_event { | |||
658 | 658 | ||
659 | perf_overflow_handler_t overflow_handler; | 659 | perf_overflow_handler_t overflow_handler; |
660 | 660 | ||
661 | #ifdef CONFIG_EVENT_PROFILE | 661 | #ifdef CONFIG_EVENT_TRACING |
662 | struct event_filter *filter; | 662 | struct event_filter *filter; |
663 | #endif | 663 | #endif |
664 | 664 | ||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 65793e90d6f6..b7c7fcf7790b 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -99,7 +99,7 @@ struct perf_event_attr; | |||
99 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) | 99 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) |
100 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) | 100 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) |
101 | 101 | ||
102 | #ifdef CONFIG_EVENT_PROFILE | 102 | #ifdef CONFIG_PERF_EVENTS |
103 | 103 | ||
104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ |
105 | .profile_enable = prof_sysenter_enable, \ | 105 | .profile_enable = prof_sysenter_enable, \ |
@@ -113,7 +113,7 @@ struct perf_event_attr; | |||
113 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) | 113 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) |
114 | #define TRACE_SYS_EXIT_PROFILE(sname) | 114 | #define TRACE_SYS_EXIT_PROFILE(sname) |
115 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) | 115 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) |
116 | #endif | 116 | #endif /* CONFIG_PERF_EVENTS */ |
117 | 117 | ||
118 | #ifdef CONFIG_FTRACE_SYSCALLS | 118 | #ifdef CONFIG_FTRACE_SYSCALLS |
119 | #define __SC_STR_ADECL1(t, a) #a | 119 | #define __SC_STR_ADECL1(t, a) #a |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 73523151a731..2fdd36df41f6 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -498,7 +498,7 @@ static inline int ftrace_get_offsets_##call( \ | |||
498 | 498 | ||
499 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 499 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
500 | 500 | ||
501 | #ifdef CONFIG_EVENT_PROFILE | 501 | #ifdef CONFIG_PERF_EVENTS |
502 | 502 | ||
503 | /* | 503 | /* |
504 | * Generate the functions needed for tracepoint perf_event support. | 504 | * Generate the functions needed for tracepoint perf_event support. |
@@ -541,7 +541,7 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
541 | 541 | ||
542 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 542 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
543 | 543 | ||
544 | #endif | 544 | #endif /* CONFIG_PERF_EVENTS */ |
545 | 545 | ||
546 | /* | 546 | /* |
547 | * Stage 4 of the trace events. | 547 | * Stage 4 of the trace events. |
@@ -626,7 +626,7 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
626 | * | 626 | * |
627 | */ | 627 | */ |
628 | 628 | ||
629 | #ifdef CONFIG_EVENT_PROFILE | 629 | #ifdef CONFIG_PERF_EVENTS |
630 | 630 | ||
631 | #define _TRACE_PROFILE_INIT(call) \ | 631 | #define _TRACE_PROFILE_INIT(call) \ |
632 | .profile_enable = ftrace_profile_enable_##call, \ | 632 | .profile_enable = ftrace_profile_enable_##call, \ |
@@ -634,7 +634,7 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
634 | 634 | ||
635 | #else | 635 | #else |
636 | #define _TRACE_PROFILE_INIT(call) | 636 | #define _TRACE_PROFILE_INIT(call) |
637 | #endif | 637 | #endif /* CONFIG_PERF_EVENTS */ |
638 | 638 | ||
639 | #undef __entry | 639 | #undef __entry |
640 | #define __entry entry | 640 | #define __entry entry |
@@ -834,7 +834,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
834 | * } | 834 | * } |
835 | */ | 835 | */ |
836 | 836 | ||
837 | #ifdef CONFIG_EVENT_PROFILE | 837 | #ifdef CONFIG_PERF_EVENTS |
838 | 838 | ||
839 | #undef __perf_addr | 839 | #undef __perf_addr |
840 | #define __perf_addr(a) __addr = (a) | 840 | #define __perf_addr(a) __addr = (a) |
@@ -926,7 +926,7 @@ static void ftrace_profile_##call(proto) \ | |||
926 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | 926 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) |
927 | 927 | ||
928 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 928 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
929 | #endif /* CONFIG_EVENT_PROFILE */ | 929 | #endif /* CONFIG_PERF_EVENTS */ |
930 | 930 | ||
931 | #undef _TRACE_PROFILE_INIT | 931 | #undef _TRACE_PROFILE_INIT |
932 | 932 | ||
diff --git a/include/trace/syscall.h b/include/trace/syscall.h index 961fda3556bb..3d463dcef298 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h | |||
@@ -49,12 +49,12 @@ ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s); | |||
49 | enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags); | 49 | enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags); |
50 | enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); | 50 | enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); |
51 | #endif | 51 | #endif |
52 | #ifdef CONFIG_EVENT_PROFILE | 52 | |
53 | #ifdef CONFIG_PERF_EVENTS | ||
53 | int prof_sysenter_enable(struct ftrace_event_call *call); | 54 | int prof_sysenter_enable(struct ftrace_event_call *call); |
54 | void prof_sysenter_disable(struct ftrace_event_call *call); | 55 | void prof_sysenter_disable(struct ftrace_event_call *call); |
55 | int prof_sysexit_enable(struct ftrace_event_call *call); | 56 | int prof_sysexit_enable(struct ftrace_event_call *call); |
56 | void prof_sysexit_disable(struct ftrace_event_call *call); | 57 | void prof_sysexit_disable(struct ftrace_event_call *call); |
57 | |||
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #endif /* _TRACE_SYSCALL_H */ | 60 | #endif /* _TRACE_SYSCALL_H */ |
diff --git a/init/Kconfig b/init/Kconfig index a23da9f01803..06dab27c18d9 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -966,19 +966,6 @@ config PERF_EVENTS | |||
966 | 966 | ||
967 | Say Y if unsure. | 967 | Say Y if unsure. |
968 | 968 | ||
969 | config EVENT_PROFILE | ||
970 | bool "Tracepoint profiling sources" | ||
971 | depends on PERF_EVENTS && EVENT_TRACING | ||
972 | default y | ||
973 | help | ||
974 | Allow the use of tracepoints as software performance events. | ||
975 | |||
976 | When this is enabled, you can create perf events based on | ||
977 | tracepoints using PERF_TYPE_TRACEPOINT and the tracepoint ID | ||
978 | found in debugfs://tracing/events/*/*/id. (The -e/--events | ||
979 | option to the perf tool can parse and interpret symbolic | ||
980 | tracepoints, in the subsystem:tracepoint_name format.) | ||
981 | |||
982 | config PERF_COUNTERS | 969 | config PERF_COUNTERS |
983 | bool "Kernel performance counters (old config option)" | 970 | bool "Kernel performance counters (old config option)" |
984 | depends on HAVE_PERF_EVENTS | 971 | depends on HAVE_PERF_EVENTS |
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 099bd662daa6..5b987b4a98a8 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -4177,7 +4177,7 @@ static const struct pmu perf_ops_task_clock = { | |||
4177 | .read = task_clock_perf_event_read, | 4177 | .read = task_clock_perf_event_read, |
4178 | }; | 4178 | }; |
4179 | 4179 | ||
4180 | #ifdef CONFIG_EVENT_PROFILE | 4180 | #ifdef CONFIG_EVENT_TRACING |
4181 | 4181 | ||
4182 | void perf_tp_event(int event_id, u64 addr, u64 count, void *record, | 4182 | void perf_tp_event(int event_id, u64 addr, u64 count, void *record, |
4183 | int entry_size) | 4183 | int entry_size) |
@@ -4282,7 +4282,7 @@ static void perf_event_free_filter(struct perf_event *event) | |||
4282 | { | 4282 | { |
4283 | } | 4283 | } |
4284 | 4284 | ||
4285 | #endif /* CONFIG_EVENT_PROFILE */ | 4285 | #endif /* CONFIG_EVENT_TRACING */ |
4286 | 4286 | ||
4287 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 4287 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
4288 | static void bp_perf_event_destroy(struct perf_event *event) | 4288 | static void bp_perf_event_destroy(struct perf_event *event) |
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile index cd9ecd89ec77..d00c6fe23f54 100644 --- a/kernel/trace/Makefile +++ b/kernel/trace/Makefile | |||
@@ -51,7 +51,9 @@ endif | |||
51 | obj-$(CONFIG_EVENT_TRACING) += trace_events.o | 51 | obj-$(CONFIG_EVENT_TRACING) += trace_events.o |
52 | obj-$(CONFIG_EVENT_TRACING) += trace_export.o | 52 | obj-$(CONFIG_EVENT_TRACING) += trace_export.o |
53 | obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o | 53 | obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o |
54 | obj-$(CONFIG_EVENT_PROFILE) += trace_event_profile.o | 54 | ifeq ($(CONFIG_PERF_EVENTS),y) |
55 | obj-$(CONFIG_EVENT_TRACING) += trace_event_profile.o | ||
56 | endif | ||
55 | obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o | 57 | obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o |
56 | obj-$(CONFIG_KPROBE_EVENT) += trace_kprobe.o | 58 | obj-$(CONFIG_KPROBE_EVENT) += trace_kprobe.o |
57 | obj-$(CONFIG_KSYM_TRACER) += trace_ksym.o | 59 | obj-$(CONFIG_KSYM_TRACER) += trace_ksym.o |
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 50504cb228de..74563d7e102e 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
@@ -1360,7 +1360,7 @@ out_unlock: | |||
1360 | return err; | 1360 | return err; |
1361 | } | 1361 | } |
1362 | 1362 | ||
1363 | #ifdef CONFIG_EVENT_PROFILE | 1363 | #ifdef CONFIG_PERF_EVENTS |
1364 | 1364 | ||
1365 | void ftrace_profile_free_filter(struct perf_event *event) | 1365 | void ftrace_profile_free_filter(struct perf_event *event) |
1366 | { | 1366 | { |
@@ -1428,5 +1428,5 @@ out_unlock: | |||
1428 | return err; | 1428 | return err; |
1429 | } | 1429 | } |
1430 | 1430 | ||
1431 | #endif /* CONFIG_EVENT_PROFILE */ | 1431 | #endif /* CONFIG_PERF_EVENTS */ |
1432 | 1432 | ||
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 375f81a568dc..75d75dec226a 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c | |||
@@ -1249,7 +1249,7 @@ static int kretprobe_event_show_format(struct ftrace_event_call *call, | |||
1249 | ", REC->" FIELD_STRING_RETIP); | 1249 | ", REC->" FIELD_STRING_RETIP); |
1250 | } | 1250 | } |
1251 | 1251 | ||
1252 | #ifdef CONFIG_EVENT_PROFILE | 1252 | #ifdef CONFIG_PERF_EVENTS |
1253 | 1253 | ||
1254 | /* Kprobe profile handler */ | 1254 | /* Kprobe profile handler */ |
1255 | static __kprobes int kprobe_profile_func(struct kprobe *kp, | 1255 | static __kprobes int kprobe_profile_func(struct kprobe *kp, |
@@ -1407,7 +1407,7 @@ static void probe_profile_disable(struct ftrace_event_call *call) | |||
1407 | disable_kprobe(&tp->rp.kp); | 1407 | disable_kprobe(&tp->rp.kp); |
1408 | } | 1408 | } |
1409 | } | 1409 | } |
1410 | #endif /* CONFIG_EVENT_PROFILE */ | 1410 | #endif /* CONFIG_PERF_EVENTS */ |
1411 | 1411 | ||
1412 | 1412 | ||
1413 | static __kprobes | 1413 | static __kprobes |
@@ -1417,10 +1417,10 @@ int kprobe_dispatcher(struct kprobe *kp, struct pt_regs *regs) | |||
1417 | 1417 | ||
1418 | if (tp->flags & TP_FLAG_TRACE) | 1418 | if (tp->flags & TP_FLAG_TRACE) |
1419 | kprobe_trace_func(kp, regs); | 1419 | kprobe_trace_func(kp, regs); |
1420 | #ifdef CONFIG_EVENT_PROFILE | 1420 | #ifdef CONFIG_PERF_EVENTS |
1421 | if (tp->flags & TP_FLAG_PROFILE) | 1421 | if (tp->flags & TP_FLAG_PROFILE) |
1422 | kprobe_profile_func(kp, regs); | 1422 | kprobe_profile_func(kp, regs); |
1423 | #endif /* CONFIG_EVENT_PROFILE */ | 1423 | #endif |
1424 | return 0; /* We don't tweek kernel, so just return 0 */ | 1424 | return 0; /* We don't tweek kernel, so just return 0 */ |
1425 | } | 1425 | } |
1426 | 1426 | ||
@@ -1431,10 +1431,10 @@ int kretprobe_dispatcher(struct kretprobe_instance *ri, struct pt_regs *regs) | |||
1431 | 1431 | ||
1432 | if (tp->flags & TP_FLAG_TRACE) | 1432 | if (tp->flags & TP_FLAG_TRACE) |
1433 | kretprobe_trace_func(ri, regs); | 1433 | kretprobe_trace_func(ri, regs); |
1434 | #ifdef CONFIG_EVENT_PROFILE | 1434 | #ifdef CONFIG_PERF_EVENTS |
1435 | if (tp->flags & TP_FLAG_PROFILE) | 1435 | if (tp->flags & TP_FLAG_PROFILE) |
1436 | kretprobe_profile_func(ri, regs); | 1436 | kretprobe_profile_func(ri, regs); |
1437 | #endif /* CONFIG_EVENT_PROFILE */ | 1437 | #endif |
1438 | return 0; /* We don't tweek kernel, so just return 0 */ | 1438 | return 0; /* We don't tweek kernel, so just return 0 */ |
1439 | } | 1439 | } |
1440 | 1440 | ||
@@ -1463,7 +1463,7 @@ static int register_probe_event(struct trace_probe *tp) | |||
1463 | call->regfunc = probe_event_enable; | 1463 | call->regfunc = probe_event_enable; |
1464 | call->unregfunc = probe_event_disable; | 1464 | call->unregfunc = probe_event_disable; |
1465 | 1465 | ||
1466 | #ifdef CONFIG_EVENT_PROFILE | 1466 | #ifdef CONFIG_PERF_EVENTS |
1467 | call->profile_enable = probe_profile_enable; | 1467 | call->profile_enable = probe_profile_enable; |
1468 | call->profile_disable = probe_profile_disable; | 1468 | call->profile_disable = probe_profile_disable; |
1469 | #endif | 1469 | #endif |
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index 75289f372dd2..f694f66d75b0 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -421,7 +421,7 @@ int __init init_ftrace_syscalls(void) | |||
421 | } | 421 | } |
422 | core_initcall(init_ftrace_syscalls); | 422 | core_initcall(init_ftrace_syscalls); |
423 | 423 | ||
424 | #ifdef CONFIG_EVENT_PROFILE | 424 | #ifdef CONFIG_PERF_EVENTS |
425 | 425 | ||
426 | static DECLARE_BITMAP(enabled_prof_enter_syscalls, NR_syscalls); | 426 | static DECLARE_BITMAP(enabled_prof_enter_syscalls, NR_syscalls); |
427 | static DECLARE_BITMAP(enabled_prof_exit_syscalls, NR_syscalls); | 427 | static DECLARE_BITMAP(enabled_prof_exit_syscalls, NR_syscalls); |
@@ -626,6 +626,5 @@ void prof_sysexit_disable(struct ftrace_event_call *call) | |||
626 | mutex_unlock(&syscall_trace_lock); | 626 | mutex_unlock(&syscall_trace_lock); |
627 | } | 627 | } |
628 | 628 | ||
629 | #endif | 629 | #endif /* CONFIG_PERF_EVENTS */ |
630 | |||
631 | 630 | ||