Skip to content

Commit

Permalink
perf events: Remove CONFIG_EVENT_PROFILE
Browse files Browse the repository at this point in the history
Quoted from Ingo:

| This reminds me - i think we should eliminate CONFIG_EVENT_PROFILE -
| it's an unnecessary Kconfig complication. If both PERF_EVENTS and
| EVENT_TRACING is enabled we should expose generic tracepoints.
|
| Nor is it limited to event 'profiling', so it has become a misnomer as
| well.

Signed-off-by: Li Zefan <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Paul Mackerras <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Dec 28, 2009
1 parent 659d8cf commit 07b139c
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 40 deletions.
2 changes: 1 addition & 1 deletion include/linux/ftrace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ do { \
__trace_printk(ip, fmt, ##args); \
} while (0)

#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_PERF_EVENTS
struct perf_event;
extern int ftrace_profile_enable(int event_id);
extern void ftrace_profile_disable(int event_id);
Expand Down
2 changes: 1 addition & 1 deletion include/linux/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ struct perf_event {

perf_overflow_handler_t overflow_handler;

#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_EVENT_TRACING
struct event_filter *filter;
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/linux/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ struct perf_event_attr;
#define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__)
#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__)

#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_PERF_EVENTS

#define TRACE_SYS_ENTER_PROFILE_INIT(sname) \
.profile_enable = prof_sysenter_enable, \
Expand All @@ -113,7 +113,7 @@ struct perf_event_attr;
#define TRACE_SYS_ENTER_PROFILE_INIT(sname)
#define TRACE_SYS_EXIT_PROFILE(sname)
#define TRACE_SYS_EXIT_PROFILE_INIT(sname)
#endif
#endif /* CONFIG_PERF_EVENTS */

#ifdef CONFIG_FTRACE_SYSCALLS
#define __SC_STR_ADECL1(t, a) #a
Expand Down
12 changes: 6 additions & 6 deletions include/trace/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ static inline int ftrace_get_offsets_##call( \

#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)

#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_PERF_EVENTS

/*
* Generate the functions needed for tracepoint perf_event support.
Expand Down Expand Up @@ -541,7 +541,7 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\

#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)

#endif
#endif /* CONFIG_PERF_EVENTS */

/*
* Stage 4 of the trace events.
Expand Down Expand Up @@ -626,15 +626,15 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\
*
*/

#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_PERF_EVENTS

#define _TRACE_PROFILE_INIT(call) \
.profile_enable = ftrace_profile_enable_##call, \
.profile_disable = ftrace_profile_disable_##call,

#else
#define _TRACE_PROFILE_INIT(call)
#endif
#endif /* CONFIG_PERF_EVENTS */

#undef __entry
#define __entry entry
Expand Down Expand Up @@ -834,7 +834,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
* }
*/

#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_PERF_EVENTS

#undef __perf_addr
#define __perf_addr(a) __addr = (a)
Expand Down Expand Up @@ -926,7 +926,7 @@ static void ftrace_profile_##call(proto) \
DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))

#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
#endif /* CONFIG_EVENT_PROFILE */
#endif /* CONFIG_PERF_EVENTS */

#undef _TRACE_PROFILE_INIT

4 changes: 2 additions & 2 deletions include/trace/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s);
enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags);
enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags);
#endif
#ifdef CONFIG_EVENT_PROFILE

#ifdef CONFIG_PERF_EVENTS
int prof_sysenter_enable(struct ftrace_event_call *call);
void prof_sysenter_disable(struct ftrace_event_call *call);
int prof_sysexit_enable(struct ftrace_event_call *call);
void prof_sysexit_disable(struct ftrace_event_call *call);

#endif

#endif /* _TRACE_SYSCALL_H */
13 changes: 0 additions & 13 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -966,19 +966,6 @@ config PERF_EVENTS

Say Y if unsure.

config EVENT_PROFILE
bool "Tracepoint profiling sources"
depends on PERF_EVENTS && EVENT_TRACING
default y
help
Allow the use of tracepoints as software performance events.

When this is enabled, you can create perf events based on
tracepoints using PERF_TYPE_TRACEPOINT and the tracepoint ID
found in debugfs://tracing/events/*/*/id. (The -e/--events
option to the perf tool can parse and interpret symbolic
tracepoints, in the subsystem:tracepoint_name format.)

config PERF_COUNTERS
bool "Kernel performance counters (old config option)"
depends on HAVE_PERF_EVENTS
Expand Down
4 changes: 2 additions & 2 deletions kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -4177,7 +4177,7 @@ static const struct pmu perf_ops_task_clock = {
.read = task_clock_perf_event_read,
};

#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_EVENT_TRACING

void perf_tp_event(int event_id, u64 addr, u64 count, void *record,
int entry_size)
Expand Down Expand Up @@ -4282,7 +4282,7 @@ static void perf_event_free_filter(struct perf_event *event)
{
}

#endif /* CONFIG_EVENT_PROFILE */
#endif /* CONFIG_EVENT_TRACING */

#ifdef CONFIG_HAVE_HW_BREAKPOINT
static void bp_perf_event_destroy(struct perf_event *event)
Expand Down
4 changes: 3 additions & 1 deletion kernel/trace/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ endif
obj-$(CONFIG_EVENT_TRACING) += trace_events.o
obj-$(CONFIG_EVENT_TRACING) += trace_export.o
obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o
obj-$(CONFIG_EVENT_PROFILE) += trace_event_profile.o
ifeq ($(CONFIG_PERF_EVENTS),y)
obj-$(CONFIG_EVENT_TRACING) += trace_event_profile.o
endif
obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
obj-$(CONFIG_KPROBE_EVENT) += trace_kprobe.o
obj-$(CONFIG_KSYM_TRACER) += trace_ksym.o
Expand Down
4 changes: 2 additions & 2 deletions kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ int apply_subsystem_event_filter(struct event_subsystem *system,
return err;
}

#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_PERF_EVENTS

void ftrace_profile_free_filter(struct perf_event *event)
{
Expand Down Expand Up @@ -1428,5 +1428,5 @@ int ftrace_profile_set_filter(struct perf_event *event, int event_id,
return err;
}

#endif /* CONFIG_EVENT_PROFILE */
#endif /* CONFIG_PERF_EVENTS */

14 changes: 7 additions & 7 deletions kernel/trace/trace_kprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ static int kretprobe_event_show_format(struct ftrace_event_call *call,
", REC->" FIELD_STRING_RETIP);
}

#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_PERF_EVENTS

/* Kprobe profile handler */
static __kprobes int kprobe_profile_func(struct kprobe *kp,
Expand Down Expand Up @@ -1407,7 +1407,7 @@ static void probe_profile_disable(struct ftrace_event_call *call)
disable_kprobe(&tp->rp.kp);
}
}
#endif /* CONFIG_EVENT_PROFILE */
#endif /* CONFIG_PERF_EVENTS */


static __kprobes
Expand All @@ -1417,10 +1417,10 @@ int kprobe_dispatcher(struct kprobe *kp, struct pt_regs *regs)

if (tp->flags & TP_FLAG_TRACE)
kprobe_trace_func(kp, regs);
#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_PERF_EVENTS
if (tp->flags & TP_FLAG_PROFILE)
kprobe_profile_func(kp, regs);
#endif /* CONFIG_EVENT_PROFILE */
#endif
return 0; /* We don't tweek kernel, so just return 0 */
}

Expand All @@ -1431,10 +1431,10 @@ int kretprobe_dispatcher(struct kretprobe_instance *ri, struct pt_regs *regs)

if (tp->flags & TP_FLAG_TRACE)
kretprobe_trace_func(ri, regs);
#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_PERF_EVENTS
if (tp->flags & TP_FLAG_PROFILE)
kretprobe_profile_func(ri, regs);
#endif /* CONFIG_EVENT_PROFILE */
#endif
return 0; /* We don't tweek kernel, so just return 0 */
}

Expand Down Expand Up @@ -1463,7 +1463,7 @@ static int register_probe_event(struct trace_probe *tp)
call->regfunc = probe_event_enable;
call->unregfunc = probe_event_disable;

#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_PERF_EVENTS
call->profile_enable = probe_profile_enable;
call->profile_disable = probe_profile_disable;
#endif
Expand Down
5 changes: 2 additions & 3 deletions kernel/trace/trace_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ int __init init_ftrace_syscalls(void)
}
core_initcall(init_ftrace_syscalls);

#ifdef CONFIG_EVENT_PROFILE
#ifdef CONFIG_PERF_EVENTS

static DECLARE_BITMAP(enabled_prof_enter_syscalls, NR_syscalls);
static DECLARE_BITMAP(enabled_prof_exit_syscalls, NR_syscalls);
Expand Down Expand Up @@ -626,6 +626,5 @@ void prof_sysexit_disable(struct ftrace_event_call *call)
mutex_unlock(&syscall_trace_lock);
}

#endif

#endif /* CONFIG_PERF_EVENTS */

0 comments on commit 07b139c

Please sign in to comment.