aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2010-03-04 23:35:37 -0500
committerFrederic Weisbecker <fweisbec@gmail.com>2010-03-10 08:47:18 -0500
commit97d5a22005f38057b4bc0d95f81cd26510268794 (patch)
treeb981789b1cec8ac36527e52204e407b32efa0ea6 /include
parentc530665c31c0140b74ca7689e7f836177796e5bd (diff)
perf: Drop the obsolete profile naming for trace events
Drop the obsolete "profile" naming used by perf for trace events. Perf can now do more than simple events counting, so generalize the API naming. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Masami Hiramatsu <mhiramat@redhat.com> Cc: Jason Baron <jbaron@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ftrace_event.h16
-rw-r--r--include/linux/syscalls.h24
-rw-r--r--include/trace/ftrace.h38
-rw-r--r--include/trace/syscall.h8
4 files changed, 43 insertions, 43 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index ac424f18ce63..c0f4b364c711 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -131,12 +131,12 @@ struct ftrace_event_call {
131 void *mod; 131 void *mod;
132 void *data; 132 void *data;
133 133
134 int profile_count; 134 int perf_refcount;
135 int (*profile_enable)(struct ftrace_event_call *); 135 int (*perf_event_enable)(struct ftrace_event_call *);
136 void (*profile_disable)(struct ftrace_event_call *); 136 void (*perf_event_disable)(struct ftrace_event_call *);
137}; 137};
138 138
139#define FTRACE_MAX_PROFILE_SIZE 2048 139#define PERF_MAX_TRACE_SIZE 2048
140 140
141#define MAX_FILTER_PRED 32 141#define MAX_FILTER_PRED 32
142#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ 142#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
@@ -190,17 +190,17 @@ struct perf_event;
190 190
191DECLARE_PER_CPU(struct pt_regs, perf_trace_regs); 191DECLARE_PER_CPU(struct pt_regs, perf_trace_regs);
192 192
193extern int ftrace_profile_enable(int event_id); 193extern int perf_trace_enable(int event_id);
194extern void ftrace_profile_disable(int event_id); 194extern void perf_trace_disable(int event_id);
195extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, 195extern int ftrace_profile_set_filter(struct perf_event *event, int event_id,
196 char *filter_str); 196 char *filter_str);
197extern void ftrace_profile_free_filter(struct perf_event *event); 197extern void ftrace_profile_free_filter(struct perf_event *event);
198extern void * 198extern void *
199ftrace_perf_buf_prepare(int size, unsigned short type, int *rctxp, 199perf_trace_buf_prepare(int size, unsigned short type, int *rctxp,
200 unsigned long *irq_flags); 200 unsigned long *irq_flags);
201 201
202static inline void 202static inline void
203ftrace_perf_buf_submit(void *raw_data, int size, int rctx, u64 addr, 203perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
204 u64 count, unsigned long irq_flags, struct pt_regs *regs) 204 u64 count, unsigned long irq_flags, struct pt_regs *regs)
205{ 205{
206 struct trace_entry *entry = raw_data; 206 struct trace_entry *entry = raw_data;
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 8126f239edf0..51435bcc3460 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -101,18 +101,18 @@ struct perf_event_attr;
101 101
102#ifdef CONFIG_PERF_EVENTS 102#ifdef CONFIG_PERF_EVENTS
103 103
104#define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ 104#define TRACE_SYS_ENTER_PERF_INIT(sname) \
105 .profile_enable = prof_sysenter_enable, \ 105 .perf_event_enable = perf_sysenter_enable, \
106 .profile_disable = prof_sysenter_disable, 106 .perf_event_disable = perf_sysenter_disable,
107 107
108#define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ 108#define TRACE_SYS_EXIT_PERF_INIT(sname) \
109 .profile_enable = prof_sysexit_enable, \ 109 .perf_event_enable = perf_sysexit_enable, \
110 .profile_disable = prof_sysexit_disable, 110 .perf_event_disable = perf_sysexit_disable,
111#else 111#else
112#define TRACE_SYS_ENTER_PROFILE(sname) 112#define TRACE_SYS_ENTER_PERF(sname)
113#define TRACE_SYS_ENTER_PROFILE_INIT(sname) 113#define TRACE_SYS_ENTER_PERF_INIT(sname)
114#define TRACE_SYS_EXIT_PROFILE(sname) 114#define TRACE_SYS_EXIT_PERF(sname)
115#define TRACE_SYS_EXIT_PROFILE_INIT(sname) 115#define TRACE_SYS_EXIT_PERF_INIT(sname)
116#endif /* CONFIG_PERF_EVENTS */ 116#endif /* CONFIG_PERF_EVENTS */
117 117
118#ifdef CONFIG_FTRACE_SYSCALLS 118#ifdef CONFIG_FTRACE_SYSCALLS
@@ -149,7 +149,7 @@ struct perf_event_attr;
149 .regfunc = reg_event_syscall_enter, \ 149 .regfunc = reg_event_syscall_enter, \
150 .unregfunc = unreg_event_syscall_enter, \ 150 .unregfunc = unreg_event_syscall_enter, \
151 .data = (void *)&__syscall_meta_##sname,\ 151 .data = (void *)&__syscall_meta_##sname,\
152 TRACE_SYS_ENTER_PROFILE_INIT(sname) \ 152 TRACE_SYS_ENTER_PERF_INIT(sname) \
153 } 153 }
154 154
155#define SYSCALL_TRACE_EXIT_EVENT(sname) \ 155#define SYSCALL_TRACE_EXIT_EVENT(sname) \
@@ -171,7 +171,7 @@ struct perf_event_attr;
171 .regfunc = reg_event_syscall_exit, \ 171 .regfunc = reg_event_syscall_exit, \
172 .unregfunc = unreg_event_syscall_exit, \ 172 .unregfunc = unreg_event_syscall_exit, \
173 .data = (void *)&__syscall_meta_##sname,\ 173 .data = (void *)&__syscall_meta_##sname,\
174 TRACE_SYS_EXIT_PROFILE_INIT(sname) \ 174 TRACE_SYS_EXIT_PERF_INIT(sname) \
175 } 175 }
176 176
177#define SYSCALL_METADATA(sname, nb) \ 177#define SYSCALL_METADATA(sname, nb) \
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index f31bb8b9777c..25ab56f75d65 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -401,18 +401,18 @@ static inline notrace int ftrace_get_offsets_##call( \
401#undef DEFINE_EVENT 401#undef DEFINE_EVENT
402#define DEFINE_EVENT(template, name, proto, args) \ 402#define DEFINE_EVENT(template, name, proto, args) \
403 \ 403 \
404static void ftrace_profile_##name(proto); \ 404static void perf_trace_##name(proto); \
405 \ 405 \
406static notrace int \ 406static notrace int \
407ftrace_profile_enable_##name(struct ftrace_event_call *unused) \ 407perf_trace_enable_##name(struct ftrace_event_call *unused) \
408{ \ 408{ \
409 return register_trace_##name(ftrace_profile_##name); \ 409 return register_trace_##name(perf_trace_##name); \
410} \ 410} \
411 \ 411 \
412static notrace void \ 412static notrace void \
413ftrace_profile_disable_##name(struct ftrace_event_call *unused) \ 413perf_trace_disable_##name(struct ftrace_event_call *unused) \
414{ \ 414{ \
415 unregister_trace_##name(ftrace_profile_##name); \ 415 unregister_trace_##name(perf_trace_##name); \
416} 416}
417 417
418#undef DEFINE_EVENT_PRINT 418#undef DEFINE_EVENT_PRINT
@@ -507,12 +507,12 @@ ftrace_profile_disable_##name(struct ftrace_event_call *unused) \
507 507
508#ifdef CONFIG_PERF_EVENTS 508#ifdef CONFIG_PERF_EVENTS
509 509
510#define _TRACE_PROFILE_INIT(call) \ 510#define _TRACE_PERF_INIT(call) \
511 .profile_enable = ftrace_profile_enable_##call, \ 511 .perf_event_enable = perf_trace_enable_##call, \
512 .profile_disable = ftrace_profile_disable_##call, 512 .perf_event_disable = perf_trace_disable_##call,
513 513
514#else 514#else
515#define _TRACE_PROFILE_INIT(call) 515#define _TRACE_PERF_INIT(call)
516#endif /* CONFIG_PERF_EVENTS */ 516#endif /* CONFIG_PERF_EVENTS */
517 517
518#undef __entry 518#undef __entry
@@ -638,7 +638,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
638 .unregfunc = ftrace_raw_unreg_event_##call, \ 638 .unregfunc = ftrace_raw_unreg_event_##call, \
639 .print_fmt = print_fmt_##template, \ 639 .print_fmt = print_fmt_##template, \
640 .define_fields = ftrace_define_fields_##template, \ 640 .define_fields = ftrace_define_fields_##template, \
641 _TRACE_PROFILE_INIT(call) \ 641 _TRACE_PERF_INIT(call) \
642} 642}
643 643
644#undef DEFINE_EVENT_PRINT 644#undef DEFINE_EVENT_PRINT
@@ -657,18 +657,18 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
657 .unregfunc = ftrace_raw_unreg_event_##call, \ 657 .unregfunc = ftrace_raw_unreg_event_##call, \
658 .print_fmt = print_fmt_##call, \ 658 .print_fmt = print_fmt_##call, \
659 .define_fields = ftrace_define_fields_##template, \ 659 .define_fields = ftrace_define_fields_##template, \
660 _TRACE_PROFILE_INIT(call) \ 660 _TRACE_PERF_INIT(call) \
661} 661}
662 662
663#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 663#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
664 664
665/* 665/*
666 * Define the insertion callback to profile events 666 * Define the insertion callback to perf events
667 * 667 *
668 * The job is very similar to ftrace_raw_event_<call> except that we don't 668 * The job is very similar to ftrace_raw_event_<call> except that we don't
669 * insert in the ring buffer but in a perf counter. 669 * insert in the ring buffer but in a perf counter.
670 * 670 *
671 * static void ftrace_profile_<call>(proto) 671 * static void ftrace_perf_<call>(proto)
672 * { 672 * {
673 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; 673 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets;
674 * struct ftrace_event_call *event_call = &event_<call>; 674 * struct ftrace_event_call *event_call = &event_<call>;
@@ -757,7 +757,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
757#undef DECLARE_EVENT_CLASS 757#undef DECLARE_EVENT_CLASS
758#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 758#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
759static notrace void \ 759static notrace void \
760ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \ 760perf_trace_templ_##call(struct ftrace_event_call *event_call, \
761 proto) \ 761 proto) \
762{ \ 762{ \
763 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ 763 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
@@ -774,10 +774,10 @@ ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \
774 sizeof(u64)); \ 774 sizeof(u64)); \
775 __entry_size -= sizeof(u32); \ 775 __entry_size -= sizeof(u32); \
776 \ 776 \
777 if (WARN_ONCE(__entry_size > FTRACE_MAX_PROFILE_SIZE, \ 777 if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \
778 "profile buffer not large enough")) \ 778 "profile buffer not large enough")) \
779 return; \ 779 return; \
780 entry = (struct ftrace_raw_##call *)ftrace_perf_buf_prepare( \ 780 entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \
781 __entry_size, event_call->id, &rctx, &irq_flags); \ 781 __entry_size, event_call->id, &rctx, &irq_flags); \
782 if (!entry) \ 782 if (!entry) \
783 return; \ 783 return; \
@@ -788,17 +788,17 @@ ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \
788 __regs = &__get_cpu_var(perf_trace_regs); \ 788 __regs = &__get_cpu_var(perf_trace_regs); \
789 perf_fetch_caller_regs(__regs, 2); \ 789 perf_fetch_caller_regs(__regs, 2); \
790 \ 790 \
791 ftrace_perf_buf_submit(entry, __entry_size, rctx, __addr, \ 791 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \
792 __count, irq_flags, __regs); \ 792 __count, irq_flags, __regs); \
793} 793}
794 794
795#undef DEFINE_EVENT 795#undef DEFINE_EVENT
796#define DEFINE_EVENT(template, call, proto, args) \ 796#define DEFINE_EVENT(template, call, proto, args) \
797static notrace void ftrace_profile_##call(proto) \ 797static notrace void perf_trace_##call(proto) \
798{ \ 798{ \
799 struct ftrace_event_call *event_call = &event_##call; \ 799 struct ftrace_event_call *event_call = &event_##call; \
800 \ 800 \
801 ftrace_profile_templ_##template(event_call, args); \ 801 perf_trace_templ_##template(event_call, args); \
802} 802}
803 803
804#undef DEFINE_EVENT_PRINT 804#undef DEFINE_EVENT_PRINT
diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index 0387100752f0..e5e5f48dbfb3 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -47,10 +47,10 @@ enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags);
47#endif 47#endif
48 48
49#ifdef CONFIG_PERF_EVENTS 49#ifdef CONFIG_PERF_EVENTS
50int prof_sysenter_enable(struct ftrace_event_call *call); 50int perf_sysenter_enable(struct ftrace_event_call *call);
51void prof_sysenter_disable(struct ftrace_event_call *call); 51void perf_sysenter_disable(struct ftrace_event_call *call);
52int prof_sysexit_enable(struct ftrace_event_call *call); 52int perf_sysexit_enable(struct ftrace_event_call *call);
53void prof_sysexit_disable(struct ftrace_event_call *call); 53void perf_sysexit_disable(struct ftrace_event_call *call);
54#endif 54#endif
55 55
56#endif /* _TRACE_SYSCALL_H */ 56#endif /* _TRACE_SYSCALL_H */