diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-05-20 08:38:55 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-05-20 08:38:55 -0400 |
commit | dfacc4d6c98b89609250269f518c1f54c30454ef (patch) | |
tree | e7effbee7bdc85d18f7b26ab9cb5c9f700d1481a /include/trace | |
parent | f869097e884d8cb65b2bb7831ca57b7dffb66fdd (diff) | |
parent | 85cb68b27c428d477169f3aa46c72dba103a17bd (diff) |
Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into perf/core
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/define_trace.h | 5 | ||||
-rw-r--r-- | include/trace/events/module.h | 18 | ||||
-rw-r--r-- | include/trace/events/napi.h | 10 | ||||
-rw-r--r-- | include/trace/events/sched.h | 32 | ||||
-rw-r--r-- | include/trace/events/signal.h | 52 | ||||
-rw-r--r-- | include/trace/ftrace.h | 33 |
6 files changed, 75 insertions, 75 deletions
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index 5acfb1eb4df9..1dfab5401511 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h | |||
@@ -65,6 +65,10 @@ | |||
65 | 65 | ||
66 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 66 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
67 | 67 | ||
68 | /* Make all open coded DECLARE_TRACE nops */ | ||
69 | #undef DECLARE_TRACE | ||
70 | #define DECLARE_TRACE(name, proto, args) | ||
71 | |||
68 | #ifdef CONFIG_EVENT_TRACING | 72 | #ifdef CONFIG_EVENT_TRACING |
69 | #include <trace/ftrace.h> | 73 | #include <trace/ftrace.h> |
70 | #endif | 74 | #endif |
@@ -75,6 +79,7 @@ | |||
75 | #undef DEFINE_EVENT | 79 | #undef DEFINE_EVENT |
76 | #undef DEFINE_EVENT_PRINT | 80 | #undef DEFINE_EVENT_PRINT |
77 | #undef TRACE_HEADER_MULTI_READ | 81 | #undef TRACE_HEADER_MULTI_READ |
82 | #undef DECLARE_TRACE | ||
78 | 83 | ||
79 | /* Only undef what we defined in this file */ | 84 | /* Only undef what we defined in this file */ |
80 | #ifdef UNDEF_TRACE_INCLUDE_FILE | 85 | #ifdef UNDEF_TRACE_INCLUDE_FILE |
diff --git a/include/trace/events/module.h b/include/trace/events/module.h index 4b0f48ba16a6..c7bb2f0482fe 100644 --- a/include/trace/events/module.h +++ b/include/trace/events/module.h | |||
@@ -51,11 +51,14 @@ TRACE_EVENT(module_free, | |||
51 | TP_printk("%s", __get_str(name)) | 51 | TP_printk("%s", __get_str(name)) |
52 | ); | 52 | ); |
53 | 53 | ||
54 | #ifdef CONFIG_MODULE_UNLOAD | ||
55 | /* trace_module_get/put are only used if CONFIG_MODULE_UNLOAD is defined */ | ||
56 | |||
54 | DECLARE_EVENT_CLASS(module_refcnt, | 57 | DECLARE_EVENT_CLASS(module_refcnt, |
55 | 58 | ||
56 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 59 | TP_PROTO(struct module *mod, unsigned long ip), |
57 | 60 | ||
58 | TP_ARGS(mod, ip, refcnt), | 61 | TP_ARGS(mod, ip), |
59 | 62 | ||
60 | TP_STRUCT__entry( | 63 | TP_STRUCT__entry( |
61 | __field( unsigned long, ip ) | 64 | __field( unsigned long, ip ) |
@@ -65,7 +68,7 @@ DECLARE_EVENT_CLASS(module_refcnt, | |||
65 | 68 | ||
66 | TP_fast_assign( | 69 | TP_fast_assign( |
67 | __entry->ip = ip; | 70 | __entry->ip = ip; |
68 | __entry->refcnt = refcnt; | 71 | __entry->refcnt = __this_cpu_read(mod->refptr->incs) + __this_cpu_read(mod->refptr->decs); |
69 | __assign_str(name, mod->name); | 72 | __assign_str(name, mod->name); |
70 | ), | 73 | ), |
71 | 74 | ||
@@ -75,17 +78,18 @@ DECLARE_EVENT_CLASS(module_refcnt, | |||
75 | 78 | ||
76 | DEFINE_EVENT(module_refcnt, module_get, | 79 | DEFINE_EVENT(module_refcnt, module_get, |
77 | 80 | ||
78 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 81 | TP_PROTO(struct module *mod, unsigned long ip), |
79 | 82 | ||
80 | TP_ARGS(mod, ip, refcnt) | 83 | TP_ARGS(mod, ip) |
81 | ); | 84 | ); |
82 | 85 | ||
83 | DEFINE_EVENT(module_refcnt, module_put, | 86 | DEFINE_EVENT(module_refcnt, module_put, |
84 | 87 | ||
85 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 88 | TP_PROTO(struct module *mod, unsigned long ip), |
86 | 89 | ||
87 | TP_ARGS(mod, ip, refcnt) | 90 | TP_ARGS(mod, ip) |
88 | ); | 91 | ); |
92 | #endif /* CONFIG_MODULE_UNLOAD */ | ||
89 | 93 | ||
90 | TRACE_EVENT(module_request, | 94 | TRACE_EVENT(module_request, |
91 | 95 | ||
diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h index a8989c4547e7..188deca2f3c7 100644 --- a/include/trace/events/napi.h +++ b/include/trace/events/napi.h | |||
@@ -1,4 +1,7 @@ | |||
1 | #ifndef _TRACE_NAPI_H_ | 1 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM napi | ||
3 | |||
4 | #if !defined(_TRACE_NAPI_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_NAPI_H_ | 5 | #define _TRACE_NAPI_H_ |
3 | 6 | ||
4 | #include <linux/netdevice.h> | 7 | #include <linux/netdevice.h> |
@@ -8,4 +11,7 @@ DECLARE_TRACE(napi_poll, | |||
8 | TP_PROTO(struct napi_struct *napi), | 11 | TP_PROTO(struct napi_struct *napi), |
9 | TP_ARGS(napi)); | 12 | TP_ARGS(napi)); |
10 | 13 | ||
11 | #endif | 14 | #endif /* _TRACE_NAPI_H_ */ |
15 | |||
16 | /* This part must be outside protection */ | ||
17 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index cfceb0b73e20..4f733ecea46e 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
@@ -51,15 +51,12 @@ TRACE_EVENT(sched_kthread_stop_ret, | |||
51 | 51 | ||
52 | /* | 52 | /* |
53 | * Tracepoint for waiting on task to unschedule: | 53 | * Tracepoint for waiting on task to unschedule: |
54 | * | ||
55 | * (NOTE: the 'rq' argument is not used by generic trace events, | ||
56 | * but used by the latency tracer plugin. ) | ||
57 | */ | 54 | */ |
58 | TRACE_EVENT(sched_wait_task, | 55 | TRACE_EVENT(sched_wait_task, |
59 | 56 | ||
60 | TP_PROTO(struct rq *rq, struct task_struct *p), | 57 | TP_PROTO(struct task_struct *p), |
61 | 58 | ||
62 | TP_ARGS(rq, p), | 59 | TP_ARGS(p), |
63 | 60 | ||
64 | TP_STRUCT__entry( | 61 | TP_STRUCT__entry( |
65 | __array( char, comm, TASK_COMM_LEN ) | 62 | __array( char, comm, TASK_COMM_LEN ) |
@@ -79,15 +76,12 @@ TRACE_EVENT(sched_wait_task, | |||
79 | 76 | ||
80 | /* | 77 | /* |
81 | * Tracepoint for waking up a task: | 78 | * Tracepoint for waking up a task: |
82 | * | ||
83 | * (NOTE: the 'rq' argument is not used by generic trace events, | ||
84 | * but used by the latency tracer plugin. ) | ||
85 | */ | 79 | */ |
86 | DECLARE_EVENT_CLASS(sched_wakeup_template, | 80 | DECLARE_EVENT_CLASS(sched_wakeup_template, |
87 | 81 | ||
88 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | 82 | TP_PROTO(struct task_struct *p, int success), |
89 | 83 | ||
90 | TP_ARGS(rq, p, success), | 84 | TP_ARGS(p, success), |
91 | 85 | ||
92 | TP_STRUCT__entry( | 86 | TP_STRUCT__entry( |
93 | __array( char, comm, TASK_COMM_LEN ) | 87 | __array( char, comm, TASK_COMM_LEN ) |
@@ -111,31 +105,25 @@ DECLARE_EVENT_CLASS(sched_wakeup_template, | |||
111 | ); | 105 | ); |
112 | 106 | ||
113 | DEFINE_EVENT(sched_wakeup_template, sched_wakeup, | 107 | DEFINE_EVENT(sched_wakeup_template, sched_wakeup, |
114 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | 108 | TP_PROTO(struct task_struct *p, int success), |
115 | TP_ARGS(rq, p, success)); | 109 | TP_ARGS(p, success)); |
116 | 110 | ||
117 | /* | 111 | /* |
118 | * Tracepoint for waking up a new task: | 112 | * Tracepoint for waking up a new task: |
119 | * | ||
120 | * (NOTE: the 'rq' argument is not used by generic trace events, | ||
121 | * but used by the latency tracer plugin. ) | ||
122 | */ | 113 | */ |
123 | DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new, | 114 | DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new, |
124 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | 115 | TP_PROTO(struct task_struct *p, int success), |
125 | TP_ARGS(rq, p, success)); | 116 | TP_ARGS(p, success)); |
126 | 117 | ||
127 | /* | 118 | /* |
128 | * Tracepoint for task switches, performed by the scheduler: | 119 | * Tracepoint for task switches, performed by the scheduler: |
129 | * | ||
130 | * (NOTE: the 'rq' argument is not used by generic trace events, | ||
131 | * but used by the latency tracer plugin. ) | ||
132 | */ | 120 | */ |
133 | TRACE_EVENT(sched_switch, | 121 | TRACE_EVENT(sched_switch, |
134 | 122 | ||
135 | TP_PROTO(struct rq *rq, struct task_struct *prev, | 123 | TP_PROTO(struct task_struct *prev, |
136 | struct task_struct *next), | 124 | struct task_struct *next), |
137 | 125 | ||
138 | TP_ARGS(rq, prev, next), | 126 | TP_ARGS(prev, next), |
139 | 127 | ||
140 | TP_STRUCT__entry( | 128 | TP_STRUCT__entry( |
141 | __array( char, prev_comm, TASK_COMM_LEN ) | 129 | __array( char, prev_comm, TASK_COMM_LEN ) |
diff --git a/include/trace/events/signal.h b/include/trace/events/signal.h index a510b75ac304..814566c99d29 100644 --- a/include/trace/events/signal.h +++ b/include/trace/events/signal.h | |||
@@ -100,18 +100,7 @@ TRACE_EVENT(signal_deliver, | |||
100 | __entry->sa_handler, __entry->sa_flags) | 100 | __entry->sa_handler, __entry->sa_flags) |
101 | ); | 101 | ); |
102 | 102 | ||
103 | /** | 103 | DECLARE_EVENT_CLASS(signal_queue_overflow, |
104 | * signal_overflow_fail - called when signal queue is overflow | ||
105 | * @sig: signal number | ||
106 | * @group: signal to process group or not (bool) | ||
107 | * @info: pointer to struct siginfo | ||
108 | * | ||
109 | * Kernel fails to generate 'sig' signal with 'info' siginfo, because | ||
110 | * siginfo queue is overflow, and the signal is dropped. | ||
111 | * 'group' is not 0 if the signal will be sent to a process group. | ||
112 | * 'sig' is always one of RT signals. | ||
113 | */ | ||
114 | TRACE_EVENT(signal_overflow_fail, | ||
115 | 104 | ||
116 | TP_PROTO(int sig, int group, struct siginfo *info), | 105 | TP_PROTO(int sig, int group, struct siginfo *info), |
117 | 106 | ||
@@ -135,6 +124,24 @@ TRACE_EVENT(signal_overflow_fail, | |||
135 | ); | 124 | ); |
136 | 125 | ||
137 | /** | 126 | /** |
127 | * signal_overflow_fail - called when signal queue is overflow | ||
128 | * @sig: signal number | ||
129 | * @group: signal to process group or not (bool) | ||
130 | * @info: pointer to struct siginfo | ||
131 | * | ||
132 | * Kernel fails to generate 'sig' signal with 'info' siginfo, because | ||
133 | * siginfo queue is overflow, and the signal is dropped. | ||
134 | * 'group' is not 0 if the signal will be sent to a process group. | ||
135 | * 'sig' is always one of RT signals. | ||
136 | */ | ||
137 | DEFINE_EVENT(signal_queue_overflow, signal_overflow_fail, | ||
138 | |||
139 | TP_PROTO(int sig, int group, struct siginfo *info), | ||
140 | |||
141 | TP_ARGS(sig, group, info) | ||
142 | ); | ||
143 | |||
144 | /** | ||
138 | * signal_lose_info - called when siginfo is lost | 145 | * signal_lose_info - called when siginfo is lost |
139 | * @sig: signal number | 146 | * @sig: signal number |
140 | * @group: signal to process group or not (bool) | 147 | * @group: signal to process group or not (bool) |
@@ -145,28 +152,13 @@ TRACE_EVENT(signal_overflow_fail, | |||
145 | * 'group' is not 0 if the signal will be sent to a process group. | 152 | * 'group' is not 0 if the signal will be sent to a process group. |
146 | * 'sig' is always one of non-RT signals. | 153 | * 'sig' is always one of non-RT signals. |
147 | */ | 154 | */ |
148 | TRACE_EVENT(signal_lose_info, | 155 | DEFINE_EVENT(signal_queue_overflow, signal_lose_info, |
149 | 156 | ||
150 | TP_PROTO(int sig, int group, struct siginfo *info), | 157 | TP_PROTO(int sig, int group, struct siginfo *info), |
151 | 158 | ||
152 | TP_ARGS(sig, group, info), | 159 | TP_ARGS(sig, group, info) |
153 | |||
154 | TP_STRUCT__entry( | ||
155 | __field( int, sig ) | ||
156 | __field( int, group ) | ||
157 | __field( int, errno ) | ||
158 | __field( int, code ) | ||
159 | ), | ||
160 | |||
161 | TP_fast_assign( | ||
162 | __entry->sig = sig; | ||
163 | __entry->group = group; | ||
164 | TP_STORE_SIGINFO(__entry, info); | ||
165 | ), | ||
166 | |||
167 | TP_printk("sig=%d group=%d errno=%d code=%d", | ||
168 | __entry->sig, __entry->group, __entry->errno, __entry->code) | ||
169 | ); | 160 | ); |
161 | |||
170 | #endif /* _TRACE_SIGNAL_H */ | 162 | #endif /* _TRACE_SIGNAL_H */ |
171 | 163 | ||
172 | /* This part must be outside protection */ | 164 | /* This part must be outside protection */ |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 0a29df092922..1016b2162935 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -154,9 +154,11 @@ | |||
154 | * | 154 | * |
155 | * field = (typeof(field))entry; | 155 | * field = (typeof(field))entry; |
156 | * | 156 | * |
157 | * p = get_cpu_var(ftrace_event_seq); | 157 | * p = &get_cpu_var(ftrace_event_seq); |
158 | * trace_seq_init(p); | 158 | * trace_seq_init(p); |
159 | * ret = trace_seq_printf(s, <TP_printk> "\n"); | 159 | * ret = trace_seq_printf(s, "%s: ", <call>); |
160 | * if (ret) | ||
161 | * ret = trace_seq_printf(s, <TP_printk> "\n"); | ||
160 | * put_cpu(); | 162 | * put_cpu(); |
161 | * if (!ret) | 163 | * if (!ret) |
162 | * return TRACE_TYPE_PARTIAL_LINE; | 164 | * return TRACE_TYPE_PARTIAL_LINE; |
@@ -450,38 +452,38 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \ | |||
450 | * | 452 | * |
451 | * static void ftrace_raw_event_<call>(proto) | 453 | * static void ftrace_raw_event_<call>(proto) |
452 | * { | 454 | * { |
455 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; | ||
453 | * struct ring_buffer_event *event; | 456 | * struct ring_buffer_event *event; |
454 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 | 457 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 |
455 | * struct ring_buffer *buffer; | 458 | * struct ring_buffer *buffer; |
456 | * unsigned long irq_flags; | 459 | * unsigned long irq_flags; |
460 | * int __data_size; | ||
457 | * int pc; | 461 | * int pc; |
458 | * | 462 | * |
459 | * local_save_flags(irq_flags); | 463 | * local_save_flags(irq_flags); |
460 | * pc = preempt_count(); | 464 | * pc = preempt_count(); |
461 | * | 465 | * |
466 | * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args); | ||
467 | * | ||
462 | * event = trace_current_buffer_lock_reserve(&buffer, | 468 | * event = trace_current_buffer_lock_reserve(&buffer, |
463 | * event_<call>.id, | 469 | * event_<call>.id, |
464 | * sizeof(struct ftrace_raw_<call>), | 470 | * sizeof(*entry) + __data_size, |
465 | * irq_flags, pc); | 471 | * irq_flags, pc); |
466 | * if (!event) | 472 | * if (!event) |
467 | * return; | 473 | * return; |
468 | * entry = ring_buffer_event_data(event); | 474 | * entry = ring_buffer_event_data(event); |
469 | * | 475 | * |
470 | * <assign>; <-- Here we assign the entries by the __field and | 476 | * { <assign>; } <-- Here we assign the entries by the __field and |
471 | * __array macros. | 477 | * __array macros. |
472 | * | 478 | * |
473 | * trace_current_buffer_unlock_commit(buffer, event, irq_flags, pc); | 479 | * if (!filter_current_check_discard(buffer, event_call, entry, event)) |
480 | * trace_current_buffer_unlock_commit(buffer, | ||
481 | * event, irq_flags, pc); | ||
474 | * } | 482 | * } |
475 | * | 483 | * |
476 | * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused) | 484 | * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused) |
477 | * { | 485 | * { |
478 | * int ret; | 486 | * return register_trace_<call>(ftrace_raw_event_<call>); |
479 | * | ||
480 | * ret = register_trace_<call>(ftrace_raw_event_<call>); | ||
481 | * if (!ret) | ||
482 | * pr_info("event trace: Could not activate trace point " | ||
483 | * "probe to <call>"); | ||
484 | * return ret; | ||
485 | * } | 487 | * } |
486 | * | 488 | * |
487 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) | 489 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) |
@@ -493,6 +495,8 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \ | |||
493 | * .trace = ftrace_raw_output_<call>, <-- stage 2 | 495 | * .trace = ftrace_raw_output_<call>, <-- stage 2 |
494 | * }; | 496 | * }; |
495 | * | 497 | * |
498 | * static const char print_fmt_<call>[] = <TP_printk>; | ||
499 | * | ||
496 | * static struct ftrace_event_call __used | 500 | * static struct ftrace_event_call __used |
497 | * __attribute__((__aligned__(4))) | 501 | * __attribute__((__aligned__(4))) |
498 | * __attribute__((section("_ftrace_events"))) event_<call> = { | 502 | * __attribute__((section("_ftrace_events"))) event_<call> = { |
@@ -501,6 +505,8 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \ | |||
501 | * .raw_init = trace_event_raw_init, | 505 | * .raw_init = trace_event_raw_init, |
502 | * .regfunc = ftrace_reg_event_<call>, | 506 | * .regfunc = ftrace_reg_event_<call>, |
503 | * .unregfunc = ftrace_unreg_event_<call>, | 507 | * .unregfunc = ftrace_unreg_event_<call>, |
508 | * .print_fmt = print_fmt_<call>, | ||
509 | * .define_fields = ftrace_define_fields_<call>, | ||
504 | * } | 510 | * } |
505 | * | 511 | * |
506 | */ | 512 | */ |
@@ -569,7 +575,6 @@ ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ | |||
569 | return; \ | 575 | return; \ |
570 | entry = ring_buffer_event_data(event); \ | 576 | entry = ring_buffer_event_data(event); \ |
571 | \ | 577 | \ |
572 | \ | ||
573 | tstruct \ | 578 | tstruct \ |
574 | \ | 579 | \ |
575 | { assign; } \ | 580 | { assign; } \ |