diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 13:17:26 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 13:17:26 -0500 |
| commit | 28d9bfc37c861aa9c8386dff1ac7e9a10e5c5162 (patch) | |
| tree | 85bcc2db18ff20e380a40aba375e70d14c2671b4 /include/linux | |
| parent | f3b0cfa9b017a9d4686c9b14b908a1685f97a077 (diff) | |
| parent | 4b95f135f606c87e4056b6d7fd3c5781c818858b (diff) | |
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (146 commits)
tools, perf: Documentation for the power events API
perf: Add calls to suspend trace point
perf script: Make some lists static
perf script: Use the default lost event handler
perf session: Warn about errors when processing pipe events too
perf tools: Fix perf_event.h header usage
perf test: Clarify some error reports in the open syscall test
x86, NMI: Add touch_nmi_watchdog to io_check_error delay
x86: Avoid calling arch_trigger_all_cpu_backtrace() at the same time
x86: Only call smp_processor_id in non-preempt cases
perf timechart: Adjust perf timechart to the new power events
perf: Clean up power events by introducing new, more generic ones
perf: Do not export power_frequency, but power_start event
perf test: Add test for counting open syscalls
perf evsel: Auto allocate resources needed for some methods
perf evsel: Use {cpu,thread}_map to shorten list of parameters
perf tools: Refactor all_tids to hold nr and the map
perf tools: Refactor cpumap to hold nr and the map
perf evsel: Introduce per cpu and per thread open helpers
perf evsel: Steal the counter reading routines from stat
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ftrace_event.h | 14 | ||||
| -rw-r--r-- | include/linux/kprobes.h | 4 | ||||
| -rw-r--r-- | include/linux/nmi.h | 10 | ||||
| -rw-r--r-- | include/linux/perf_event.h | 26 | ||||
| -rw-r--r-- | include/linux/sched.h | 4 | ||||
| -rw-r--r-- | include/linux/stacktrace.h | 4 | ||||
| -rw-r--r-- | include/linux/syscalls.h | 10 | ||||
| -rw-r--r-- | include/linux/tracepoint.h | 33 |
8 files changed, 80 insertions, 25 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 8beabb958f6..47e3997f7b5 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -154,12 +154,14 @@ enum { | |||
| 154 | TRACE_EVENT_FL_ENABLED_BIT, | 154 | TRACE_EVENT_FL_ENABLED_BIT, |
| 155 | TRACE_EVENT_FL_FILTERED_BIT, | 155 | TRACE_EVENT_FL_FILTERED_BIT, |
| 156 | TRACE_EVENT_FL_RECORDED_CMD_BIT, | 156 | TRACE_EVENT_FL_RECORDED_CMD_BIT, |
| 157 | TRACE_EVENT_FL_CAP_ANY_BIT, | ||
| 157 | }; | 158 | }; |
| 158 | 159 | ||
| 159 | enum { | 160 | enum { |
| 160 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), | 161 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), |
| 161 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), | 162 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), |
| 162 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), | 163 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), |
| 164 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), | ||
| 163 | }; | 165 | }; |
| 164 | 166 | ||
| 165 | struct ftrace_event_call { | 167 | struct ftrace_event_call { |
| @@ -196,6 +198,14 @@ struct ftrace_event_call { | |||
| 196 | #endif | 198 | #endif |
| 197 | }; | 199 | }; |
| 198 | 200 | ||
| 201 | #define __TRACE_EVENT_FLAGS(name, value) \ | ||
| 202 | static int __init trace_init_flags_##name(void) \ | ||
| 203 | { \ | ||
| 204 | event_##name.flags = value; \ | ||
| 205 | return 0; \ | ||
| 206 | } \ | ||
| 207 | early_initcall(trace_init_flags_##name); | ||
| 208 | |||
| 199 | #define PERF_MAX_TRACE_SIZE 2048 | 209 | #define PERF_MAX_TRACE_SIZE 2048 |
| 200 | 210 | ||
| 201 | #define MAX_FILTER_PRED 32 | 211 | #define MAX_FILTER_PRED 32 |
| @@ -215,6 +225,10 @@ enum { | |||
| 215 | FILTER_PTR_STRING, | 225 | FILTER_PTR_STRING, |
| 216 | }; | 226 | }; |
| 217 | 227 | ||
| 228 | #define EVENT_STORAGE_SIZE 128 | ||
| 229 | extern struct mutex event_storage_mutex; | ||
| 230 | extern char event_storage[EVENT_STORAGE_SIZE]; | ||
| 231 | |||
| 218 | extern int trace_event_raw_init(struct ftrace_event_call *call); | 232 | extern int trace_event_raw_init(struct ftrace_event_call *call); |
| 219 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, | 233 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, |
| 220 | const char *name, int offset, int size, | 234 | const char *name, int offset, int size, |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index e7d1b2e0070..b78edb58ee6 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
| @@ -275,7 +275,9 @@ extern int arch_prepared_optinsn(struct arch_optimized_insn *optinsn); | |||
| 275 | extern int arch_check_optimized_kprobe(struct optimized_kprobe *op); | 275 | extern int arch_check_optimized_kprobe(struct optimized_kprobe *op); |
| 276 | extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op); | 276 | extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op); |
| 277 | extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op); | 277 | extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op); |
| 278 | extern int arch_optimize_kprobe(struct optimized_kprobe *op); | 278 | extern void arch_optimize_kprobes(struct list_head *oplist); |
| 279 | extern void arch_unoptimize_kprobes(struct list_head *oplist, | ||
| 280 | struct list_head *done_list); | ||
| 279 | extern void arch_unoptimize_kprobe(struct optimized_kprobe *op); | 281 | extern void arch_unoptimize_kprobe(struct optimized_kprobe *op); |
| 280 | extern kprobe_opcode_t *get_optinsn_slot(void); | 282 | extern kprobe_opcode_t *get_optinsn_slot(void); |
| 281 | extern void free_optinsn_slot(kprobe_opcode_t *slot, int dirty); | 283 | extern void free_optinsn_slot(kprobe_opcode_t *slot, int dirty); |
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 06aab5eee13..c536f8545f7 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
| @@ -14,22 +14,14 @@ | |||
| 14 | * may be used to reset the timeout - for code which intentionally | 14 | * may be used to reset the timeout - for code which intentionally |
| 15 | * disables interrupts for a long time. This call is stateless. | 15 | * disables interrupts for a long time. This call is stateless. |
| 16 | */ | 16 | */ |
| 17 | #ifdef ARCH_HAS_NMI_WATCHDOG | 17 | #if defined(ARCH_HAS_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR) |
| 18 | #include <asm/nmi.h> | 18 | #include <asm/nmi.h> |
| 19 | extern void touch_nmi_watchdog(void); | 19 | extern void touch_nmi_watchdog(void); |
| 20 | extern void acpi_nmi_disable(void); | ||
| 21 | extern void acpi_nmi_enable(void); | ||
| 22 | #else | 20 | #else |
| 23 | #ifndef CONFIG_HARDLOCKUP_DETECTOR | ||
| 24 | static inline void touch_nmi_watchdog(void) | 21 | static inline void touch_nmi_watchdog(void) |
| 25 | { | 22 | { |
| 26 | touch_softlockup_watchdog(); | 23 | touch_softlockup_watchdog(); |
| 27 | } | 24 | } |
| 28 | #else | ||
| 29 | extern void touch_nmi_watchdog(void); | ||
| 30 | #endif | ||
| 31 | static inline void acpi_nmi_disable(void) { } | ||
| 32 | static inline void acpi_nmi_enable(void) { } | ||
| 33 | #endif | 25 | #endif |
| 34 | 26 | ||
| 35 | /* | 27 | /* |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 4f1279e105e..dda5b0a3ff6 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -215,8 +215,9 @@ struct perf_event_attr { | |||
| 215 | */ | 215 | */ |
| 216 | precise_ip : 2, /* skid constraint */ | 216 | precise_ip : 2, /* skid constraint */ |
| 217 | mmap_data : 1, /* non-exec mmap data */ | 217 | mmap_data : 1, /* non-exec mmap data */ |
| 218 | sample_id_all : 1, /* sample_type all events */ | ||
| 218 | 219 | ||
| 219 | __reserved_1 : 46; | 220 | __reserved_1 : 45; |
| 220 | 221 | ||
| 221 | union { | 222 | union { |
| 222 | __u32 wakeup_events; /* wakeup every n events */ | 223 | __u32 wakeup_events; /* wakeup every n events */ |
| @@ -327,6 +328,15 @@ struct perf_event_header { | |||
| 327 | enum perf_event_type { | 328 | enum perf_event_type { |
| 328 | 329 | ||
| 329 | /* | 330 | /* |
| 331 | * If perf_event_attr.sample_id_all is set then all event types will | ||
| 332 | * have the sample_type selected fields related to where/when | ||
| 333 | * (identity) an event took place (TID, TIME, ID, CPU, STREAM_ID) | ||
| 334 | * described in PERF_RECORD_SAMPLE below, it will be stashed just after | ||
| 335 | * the perf_event_header and the fields already present for the existing | ||
| 336 | * fields, i.e. at the end of the payload. That way a newer perf.data | ||
| 337 | * file will be supported by older perf tools, with these new optional | ||
| 338 | * fields being ignored. | ||
| 339 | * | ||
| 330 | * The MMAP events record the PROT_EXEC mappings so that we can | 340 | * The MMAP events record the PROT_EXEC mappings so that we can |
| 331 | * correlate userspace IPs to code. They have the following structure: | 341 | * correlate userspace IPs to code. They have the following structure: |
| 332 | * | 342 | * |
| @@ -578,6 +588,10 @@ struct perf_event; | |||
| 578 | struct pmu { | 588 | struct pmu { |
| 579 | struct list_head entry; | 589 | struct list_head entry; |
| 580 | 590 | ||
| 591 | struct device *dev; | ||
| 592 | char *name; | ||
| 593 | int type; | ||
| 594 | |||
| 581 | int * __percpu pmu_disable_count; | 595 | int * __percpu pmu_disable_count; |
| 582 | struct perf_cpu_context * __percpu pmu_cpu_context; | 596 | struct perf_cpu_context * __percpu pmu_cpu_context; |
| 583 | int task_ctx_nr; | 597 | int task_ctx_nr; |
| @@ -758,6 +772,9 @@ struct perf_event { | |||
| 758 | u64 shadow_ctx_time; | 772 | u64 shadow_ctx_time; |
| 759 | 773 | ||
| 760 | struct perf_event_attr attr; | 774 | struct perf_event_attr attr; |
| 775 | u16 header_size; | ||
| 776 | u16 id_header_size; | ||
| 777 | u16 read_size; | ||
| 761 | struct hw_perf_event hw; | 778 | struct hw_perf_event hw; |
| 762 | 779 | ||
| 763 | struct perf_event_context *ctx; | 780 | struct perf_event_context *ctx; |
| @@ -903,7 +920,7 @@ struct perf_output_handle { | |||
| 903 | 920 | ||
| 904 | #ifdef CONFIG_PERF_EVENTS | 921 | #ifdef CONFIG_PERF_EVENTS |
| 905 | 922 | ||
| 906 | extern int perf_pmu_register(struct pmu *pmu); | 923 | extern int perf_pmu_register(struct pmu *pmu, char *name, int type); |
| 907 | extern void perf_pmu_unregister(struct pmu *pmu); | 924 | extern void perf_pmu_unregister(struct pmu *pmu); |
| 908 | 925 | ||
| 909 | extern int perf_num_counters(void); | 926 | extern int perf_num_counters(void); |
| @@ -970,6 +987,11 @@ extern int perf_event_overflow(struct perf_event *event, int nmi, | |||
| 970 | struct perf_sample_data *data, | 987 | struct perf_sample_data *data, |
| 971 | struct pt_regs *regs); | 988 | struct pt_regs *regs); |
| 972 | 989 | ||
| 990 | static inline bool is_sampling_event(struct perf_event *event) | ||
| 991 | { | ||
| 992 | return event->attr.sample_period != 0; | ||
| 993 | } | ||
| 994 | |||
| 973 | /* | 995 | /* |
| 974 | * Return 1 for a software event, 0 for a hardware event | 996 | * Return 1 for a software event, 0 for a hardware event |
| 975 | */ | 997 | */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index d8005503cc6..48c409c279d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -316,6 +316,7 @@ extern int proc_dowatchdog_thresh(struct ctl_table *table, int write, | |||
| 316 | size_t *lenp, loff_t *ppos); | 316 | size_t *lenp, loff_t *ppos); |
| 317 | extern unsigned int softlockup_panic; | 317 | extern unsigned int softlockup_panic; |
| 318 | extern int softlockup_thresh; | 318 | extern int softlockup_thresh; |
| 319 | void lockup_detector_init(void); | ||
| 319 | #else | 320 | #else |
| 320 | static inline void touch_softlockup_watchdog(void) | 321 | static inline void touch_softlockup_watchdog(void) |
| 321 | { | 322 | { |
| @@ -326,6 +327,9 @@ static inline void touch_softlockup_watchdog_sync(void) | |||
| 326 | static inline void touch_all_softlockup_watchdogs(void) | 327 | static inline void touch_all_softlockup_watchdogs(void) |
| 327 | { | 328 | { |
| 328 | } | 329 | } |
| 330 | static inline void lockup_detector_init(void) | ||
| 331 | { | ||
| 332 | } | ||
| 329 | #endif | 333 | #endif |
| 330 | 334 | ||
| 331 | #ifdef CONFIG_DETECT_HUNG_TASK | 335 | #ifdef CONFIG_DETECT_HUNG_TASK |
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 51efbef38fb..25310f1d7f3 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define __LINUX_STACKTRACE_H | 2 | #define __LINUX_STACKTRACE_H |
| 3 | 3 | ||
| 4 | struct task_struct; | 4 | struct task_struct; |
| 5 | struct pt_regs; | ||
| 5 | 6 | ||
| 6 | #ifdef CONFIG_STACKTRACE | 7 | #ifdef CONFIG_STACKTRACE |
| 7 | struct task_struct; | 8 | struct task_struct; |
| @@ -13,7 +14,8 @@ struct stack_trace { | |||
| 13 | }; | 14 | }; |
| 14 | 15 | ||
| 15 | extern void save_stack_trace(struct stack_trace *trace); | 16 | extern void save_stack_trace(struct stack_trace *trace); |
| 16 | extern void save_stack_trace_bp(struct stack_trace *trace, unsigned long bp); | 17 | extern void save_stack_trace_regs(struct stack_trace *trace, |
| 18 | struct pt_regs *regs); | ||
| 17 | extern void save_stack_trace_tsk(struct task_struct *tsk, | 19 | extern void save_stack_trace_tsk(struct task_struct *tsk, |
| 18 | struct stack_trace *trace); | 20 | struct stack_trace *trace); |
| 19 | 21 | ||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index cacc27a0e28..18cd0684fc4 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -127,8 +127,6 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
| 127 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | 127 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ |
| 128 | static struct syscall_metadata \ | 128 | static struct syscall_metadata \ |
| 129 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ | 129 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ |
| 130 | static struct ftrace_event_call \ | ||
| 131 | __attribute__((__aligned__(4))) event_enter_##sname; \ | ||
| 132 | static struct ftrace_event_call __used \ | 130 | static struct ftrace_event_call __used \ |
| 133 | __attribute__((__aligned__(4))) \ | 131 | __attribute__((__aligned__(4))) \ |
| 134 | __attribute__((section("_ftrace_events"))) \ | 132 | __attribute__((section("_ftrace_events"))) \ |
| @@ -137,13 +135,12 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
| 137 | .class = &event_class_syscall_enter, \ | 135 | .class = &event_class_syscall_enter, \ |
| 138 | .event.funcs = &enter_syscall_print_funcs, \ | 136 | .event.funcs = &enter_syscall_print_funcs, \ |
| 139 | .data = (void *)&__syscall_meta_##sname,\ | 137 | .data = (void *)&__syscall_meta_##sname,\ |
| 140 | } | 138 | }; \ |
| 139 | __TRACE_EVENT_FLAGS(enter_##sname, TRACE_EVENT_FL_CAP_ANY) | ||
| 141 | 140 | ||
| 142 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 141 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
| 143 | static struct syscall_metadata \ | 142 | static struct syscall_metadata \ |
| 144 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ | 143 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ |
| 145 | static struct ftrace_event_call \ | ||
| 146 | __attribute__((__aligned__(4))) event_exit_##sname; \ | ||
| 147 | static struct ftrace_event_call __used \ | 144 | static struct ftrace_event_call __used \ |
| 148 | __attribute__((__aligned__(4))) \ | 145 | __attribute__((__aligned__(4))) \ |
| 149 | __attribute__((section("_ftrace_events"))) \ | 146 | __attribute__((section("_ftrace_events"))) \ |
| @@ -152,7 +149,8 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
| 152 | .class = &event_class_syscall_exit, \ | 149 | .class = &event_class_syscall_exit, \ |
| 153 | .event.funcs = &exit_syscall_print_funcs, \ | 150 | .event.funcs = &exit_syscall_print_funcs, \ |
| 154 | .data = (void *)&__syscall_meta_##sname,\ | 151 | .data = (void *)&__syscall_meta_##sname,\ |
| 155 | } | 152 | }; \ |
| 153 | __TRACE_EVENT_FLAGS(exit_##sname, TRACE_EVENT_FL_CAP_ANY) | ||
| 156 | 154 | ||
| 157 | #define SYSCALL_METADATA(sname, nb) \ | 155 | #define SYSCALL_METADATA(sname, nb) \ |
| 158 | SYSCALL_TRACE_ENTER_EVENT(sname); \ | 156 | SYSCALL_TRACE_ENTER_EVENT(sname); \ |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index a4a90b6726c..d3e4f87e95c 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -106,6 +106,7 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
| 106 | 106 | ||
| 107 | #define TP_PROTO(args...) args | 107 | #define TP_PROTO(args...) args |
| 108 | #define TP_ARGS(args...) args | 108 | #define TP_ARGS(args...) args |
| 109 | #define TP_CONDITION(args...) args | ||
| 109 | 110 | ||
| 110 | #ifdef CONFIG_TRACEPOINTS | 111 | #ifdef CONFIG_TRACEPOINTS |
| 111 | 112 | ||
| @@ -119,12 +120,14 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
| 119 | * as "(void *, void)". The DECLARE_TRACE_NOARGS() will pass in just | 120 | * as "(void *, void)". The DECLARE_TRACE_NOARGS() will pass in just |
| 120 | * "void *data", where as the DECLARE_TRACE() will pass in "void *data, proto". | 121 | * "void *data", where as the DECLARE_TRACE() will pass in "void *data, proto". |
| 121 | */ | 122 | */ |
| 122 | #define __DO_TRACE(tp, proto, args) \ | 123 | #define __DO_TRACE(tp, proto, args, cond) \ |
| 123 | do { \ | 124 | do { \ |
| 124 | struct tracepoint_func *it_func_ptr; \ | 125 | struct tracepoint_func *it_func_ptr; \ |
| 125 | void *it_func; \ | 126 | void *it_func; \ |
| 126 | void *__data; \ | 127 | void *__data; \ |
| 127 | \ | 128 | \ |
| 129 | if (!(cond)) \ | ||
| 130 | return; \ | ||
| 128 | rcu_read_lock_sched_notrace(); \ | 131 | rcu_read_lock_sched_notrace(); \ |
| 129 | it_func_ptr = rcu_dereference_sched((tp)->funcs); \ | 132 | it_func_ptr = rcu_dereference_sched((tp)->funcs); \ |
| 130 | if (it_func_ptr) { \ | 133 | if (it_func_ptr) { \ |
| @@ -142,7 +145,7 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
| 142 | * not add unwanted padding between the beginning of the section and the | 145 | * not add unwanted padding between the beginning of the section and the |
| 143 | * structure. Force alignment to the same alignment as the section start. | 146 | * structure. Force alignment to the same alignment as the section start. |
| 144 | */ | 147 | */ |
| 145 | #define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \ | 148 | #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \ |
| 146 | extern struct tracepoint __tracepoint_##name; \ | 149 | extern struct tracepoint __tracepoint_##name; \ |
| 147 | static inline void trace_##name(proto) \ | 150 | static inline void trace_##name(proto) \ |
| 148 | { \ | 151 | { \ |
| @@ -151,7 +154,8 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
| 151 | do_trace: \ | 154 | do_trace: \ |
| 152 | __DO_TRACE(&__tracepoint_##name, \ | 155 | __DO_TRACE(&__tracepoint_##name, \ |
| 153 | TP_PROTO(data_proto), \ | 156 | TP_PROTO(data_proto), \ |
| 154 | TP_ARGS(data_args)); \ | 157 | TP_ARGS(data_args), \ |
| 158 | TP_CONDITION(cond)); \ | ||
| 155 | } \ | 159 | } \ |
| 156 | static inline int \ | 160 | static inline int \ |
| 157 | register_trace_##name(void (*probe)(data_proto), void *data) \ | 161 | register_trace_##name(void (*probe)(data_proto), void *data) \ |
| @@ -186,7 +190,7 @@ do_trace: \ | |||
| 186 | EXPORT_SYMBOL(__tracepoint_##name) | 190 | EXPORT_SYMBOL(__tracepoint_##name) |
| 187 | 191 | ||
| 188 | #else /* !CONFIG_TRACEPOINTS */ | 192 | #else /* !CONFIG_TRACEPOINTS */ |
| 189 | #define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \ | 193 | #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \ |
| 190 | static inline void trace_##name(proto) \ | 194 | static inline void trace_##name(proto) \ |
| 191 | { } \ | 195 | { } \ |
| 192 | static inline int \ | 196 | static inline int \ |
| @@ -227,13 +231,20 @@ do_trace: \ | |||
| 227 | * "void *__data, proto" as the callback prototype. | 231 | * "void *__data, proto" as the callback prototype. |
| 228 | */ | 232 | */ |
| 229 | #define DECLARE_TRACE_NOARGS(name) \ | 233 | #define DECLARE_TRACE_NOARGS(name) \ |
| 230 | __DECLARE_TRACE(name, void, , void *__data, __data) | 234 | __DECLARE_TRACE(name, void, , 1, void *__data, __data) |
| 231 | 235 | ||
| 232 | #define DECLARE_TRACE(name, proto, args) \ | 236 | #define DECLARE_TRACE(name, proto, args) \ |
| 233 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \ | 237 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1, \ |
| 234 | PARAMS(void *__data, proto), \ | 238 | PARAMS(void *__data, proto), \ |
| 235 | PARAMS(__data, args)) | 239 | PARAMS(__data, args)) |
| 236 | 240 | ||
| 241 | #define DECLARE_TRACE_CONDITION(name, proto, args, cond) \ | ||
| 242 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), PARAMS(cond), \ | ||
| 243 | PARAMS(void *__data, proto), \ | ||
| 244 | PARAMS(__data, args)) | ||
| 245 | |||
| 246 | #define TRACE_EVENT_FLAGS(event, flag) | ||
| 247 | |||
| 237 | #endif /* DECLARE_TRACE */ | 248 | #endif /* DECLARE_TRACE */ |
| 238 | 249 | ||
| 239 | #ifndef TRACE_EVENT | 250 | #ifndef TRACE_EVENT |
| @@ -347,11 +358,21 @@ do_trace: \ | |||
| 347 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 358 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
| 348 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 359 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
| 349 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 360 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
| 361 | #define DEFINE_EVENT_CONDITION(template, name, proto, \ | ||
| 362 | args, cond) \ | ||
| 363 | DECLARE_TRACE_CONDITION(name, PARAMS(proto), \ | ||
| 364 | PARAMS(args), PARAMS(cond)) | ||
| 350 | 365 | ||
| 351 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ | 366 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
| 352 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 367 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
| 353 | #define TRACE_EVENT_FN(name, proto, args, struct, \ | 368 | #define TRACE_EVENT_FN(name, proto, args, struct, \ |
| 354 | assign, print, reg, unreg) \ | 369 | assign, print, reg, unreg) \ |
| 355 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 370 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
| 371 | #define TRACE_EVENT_CONDITION(name, proto, args, cond, \ | ||
| 372 | struct, assign, print) \ | ||
| 373 | DECLARE_TRACE_CONDITION(name, PARAMS(proto), \ | ||
| 374 | PARAMS(args), PARAMS(cond)) | ||
| 375 | |||
| 376 | #define TRACE_EVENT_FLAGS(event, flag) | ||
| 356 | 377 | ||
| 357 | #endif /* ifdef TRACE_EVENT (see note above) */ | 378 | #endif /* ifdef TRACE_EVENT (see note above) */ |
