diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-10 04:57:16 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-10 04:57:16 -0400 |
commit | 9a1043d19c4edc4ff1d80081a39809a506a62e4d (patch) | |
tree | a8ba7bdb2ebe8e486f018d55969727abf14e7e33 /include | |
parent | 12e87e36e0141c08dbc8b2177c93c75fb18ad7e5 (diff) | |
parent | 157587d7ac555458da9f682e3250135e468470a6 (diff) |
Merge branch 'tip/tracing/ftrace' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/tracepoint.h | 10 | ||||
-rw-r--r-- | include/trace/block.h | 70 | ||||
-rw-r--r-- | include/trace/irq_event_types.h | 46 | ||||
-rw-r--r-- | include/trace/lockdep_event_types.h | 26 | ||||
-rw-r--r-- | include/trace/power.h | 12 | ||||
-rw-r--r-- | include/trace/sched_event_types.h | 442 | ||||
-rw-r--r-- | include/trace/workqueue.h | 16 |
7 files changed, 409 insertions, 213 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 152b2f03fb86..69b56988813d 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -31,8 +31,8 @@ struct tracepoint { | |||
31 | * Keep in sync with vmlinux.lds.h. | 31 | * Keep in sync with vmlinux.lds.h. |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #define TPPROTO(args...) args | 34 | #define TP_PROTO(args...) args |
35 | #define TPARGS(args...) args | 35 | #define TP_ARGS(args...) args |
36 | 36 | ||
37 | #ifdef CONFIG_TRACEPOINTS | 37 | #ifdef CONFIG_TRACEPOINTS |
38 | 38 | ||
@@ -65,7 +65,7 @@ struct tracepoint { | |||
65 | { \ | 65 | { \ |
66 | if (unlikely(__tracepoint_##name.state)) \ | 66 | if (unlikely(__tracepoint_##name.state)) \ |
67 | __DO_TRACE(&__tracepoint_##name, \ | 67 | __DO_TRACE(&__tracepoint_##name, \ |
68 | TPPROTO(proto), TPARGS(args)); \ | 68 | TP_PROTO(proto), TP_ARGS(args)); \ |
69 | } \ | 69 | } \ |
70 | static inline int register_trace_##name(void (*probe)(proto)) \ | 70 | static inline int register_trace_##name(void (*probe)(proto)) \ |
71 | { \ | 71 | { \ |
@@ -157,7 +157,7 @@ static inline void tracepoint_synchronize_unregister(void) | |||
157 | #define TRACE_FORMAT(name, proto, args, fmt) \ | 157 | #define TRACE_FORMAT(name, proto, args, fmt) \ |
158 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 158 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
159 | 159 | ||
160 | #define TRACE_EVENT_FORMAT(name, proto, args, fmt, struct, tpfmt) \ | 160 | #define TRACE_EVENT(name, proto, args, struct, print, assign) \ |
161 | TRACE_FORMAT(name, PARAMS(proto), PARAMS(args), PARAMS(fmt)) | 161 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
162 | 162 | ||
163 | #endif | 163 | #endif |
diff --git a/include/trace/block.h b/include/trace/block.h index 25c6a1fd5b77..25b7068b819e 100644 --- a/include/trace/block.h +++ b/include/trace/block.h | |||
@@ -5,72 +5,72 @@ | |||
5 | #include <linux/tracepoint.h> | 5 | #include <linux/tracepoint.h> |
6 | 6 | ||
7 | DECLARE_TRACE(block_rq_abort, | 7 | DECLARE_TRACE(block_rq_abort, |
8 | TPPROTO(struct request_queue *q, struct request *rq), | 8 | TP_PROTO(struct request_queue *q, struct request *rq), |
9 | TPARGS(q, rq)); | 9 | TP_ARGS(q, rq)); |
10 | 10 | ||
11 | DECLARE_TRACE(block_rq_insert, | 11 | DECLARE_TRACE(block_rq_insert, |
12 | TPPROTO(struct request_queue *q, struct request *rq), | 12 | TP_PROTO(struct request_queue *q, struct request *rq), |
13 | TPARGS(q, rq)); | 13 | TP_ARGS(q, rq)); |
14 | 14 | ||
15 | DECLARE_TRACE(block_rq_issue, | 15 | DECLARE_TRACE(block_rq_issue, |
16 | TPPROTO(struct request_queue *q, struct request *rq), | 16 | TP_PROTO(struct request_queue *q, struct request *rq), |
17 | TPARGS(q, rq)); | 17 | TP_ARGS(q, rq)); |
18 | 18 | ||
19 | DECLARE_TRACE(block_rq_requeue, | 19 | DECLARE_TRACE(block_rq_requeue, |
20 | TPPROTO(struct request_queue *q, struct request *rq), | 20 | TP_PROTO(struct request_queue *q, struct request *rq), |
21 | TPARGS(q, rq)); | 21 | TP_ARGS(q, rq)); |
22 | 22 | ||
23 | DECLARE_TRACE(block_rq_complete, | 23 | DECLARE_TRACE(block_rq_complete, |
24 | TPPROTO(struct request_queue *q, struct request *rq), | 24 | TP_PROTO(struct request_queue *q, struct request *rq), |
25 | TPARGS(q, rq)); | 25 | TP_ARGS(q, rq)); |
26 | 26 | ||
27 | DECLARE_TRACE(block_bio_bounce, | 27 | DECLARE_TRACE(block_bio_bounce, |
28 | TPPROTO(struct request_queue *q, struct bio *bio), | 28 | TP_PROTO(struct request_queue *q, struct bio *bio), |
29 | TPARGS(q, bio)); | 29 | TP_ARGS(q, bio)); |
30 | 30 | ||
31 | DECLARE_TRACE(block_bio_complete, | 31 | DECLARE_TRACE(block_bio_complete, |
32 | TPPROTO(struct request_queue *q, struct bio *bio), | 32 | TP_PROTO(struct request_queue *q, struct bio *bio), |
33 | TPARGS(q, bio)); | 33 | TP_ARGS(q, bio)); |
34 | 34 | ||
35 | DECLARE_TRACE(block_bio_backmerge, | 35 | DECLARE_TRACE(block_bio_backmerge, |
36 | TPPROTO(struct request_queue *q, struct bio *bio), | 36 | TP_PROTO(struct request_queue *q, struct bio *bio), |
37 | TPARGS(q, bio)); | 37 | TP_ARGS(q, bio)); |
38 | 38 | ||
39 | DECLARE_TRACE(block_bio_frontmerge, | 39 | DECLARE_TRACE(block_bio_frontmerge, |
40 | TPPROTO(struct request_queue *q, struct bio *bio), | 40 | TP_PROTO(struct request_queue *q, struct bio *bio), |
41 | TPARGS(q, bio)); | 41 | TP_ARGS(q, bio)); |
42 | 42 | ||
43 | DECLARE_TRACE(block_bio_queue, | 43 | DECLARE_TRACE(block_bio_queue, |
44 | TPPROTO(struct request_queue *q, struct bio *bio), | 44 | TP_PROTO(struct request_queue *q, struct bio *bio), |
45 | TPARGS(q, bio)); | 45 | TP_ARGS(q, bio)); |
46 | 46 | ||
47 | DECLARE_TRACE(block_getrq, | 47 | DECLARE_TRACE(block_getrq, |
48 | TPPROTO(struct request_queue *q, struct bio *bio, int rw), | 48 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), |
49 | TPARGS(q, bio, rw)); | 49 | TP_ARGS(q, bio, rw)); |
50 | 50 | ||
51 | DECLARE_TRACE(block_sleeprq, | 51 | DECLARE_TRACE(block_sleeprq, |
52 | TPPROTO(struct request_queue *q, struct bio *bio, int rw), | 52 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), |
53 | TPARGS(q, bio, rw)); | 53 | TP_ARGS(q, bio, rw)); |
54 | 54 | ||
55 | DECLARE_TRACE(block_plug, | 55 | DECLARE_TRACE(block_plug, |
56 | TPPROTO(struct request_queue *q), | 56 | TP_PROTO(struct request_queue *q), |
57 | TPARGS(q)); | 57 | TP_ARGS(q)); |
58 | 58 | ||
59 | DECLARE_TRACE(block_unplug_timer, | 59 | DECLARE_TRACE(block_unplug_timer, |
60 | TPPROTO(struct request_queue *q), | 60 | TP_PROTO(struct request_queue *q), |
61 | TPARGS(q)); | 61 | TP_ARGS(q)); |
62 | 62 | ||
63 | DECLARE_TRACE(block_unplug_io, | 63 | DECLARE_TRACE(block_unplug_io, |
64 | TPPROTO(struct request_queue *q), | 64 | TP_PROTO(struct request_queue *q), |
65 | TPARGS(q)); | 65 | TP_ARGS(q)); |
66 | 66 | ||
67 | DECLARE_TRACE(block_split, | 67 | DECLARE_TRACE(block_split, |
68 | TPPROTO(struct request_queue *q, struct bio *bio, unsigned int pdu), | 68 | TP_PROTO(struct request_queue *q, struct bio *bio, unsigned int pdu), |
69 | TPARGS(q, bio, pdu)); | 69 | TP_ARGS(q, bio, pdu)); |
70 | 70 | ||
71 | DECLARE_TRACE(block_remap, | 71 | DECLARE_TRACE(block_remap, |
72 | TPPROTO(struct request_queue *q, struct bio *bio, dev_t dev, | 72 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, |
73 | sector_t from, sector_t to), | 73 | sector_t from, sector_t to), |
74 | TPARGS(q, bio, dev, from, to)); | 74 | TP_ARGS(q, bio, dev, from, to)); |
75 | 75 | ||
76 | #endif | 76 | #endif |
diff --git a/include/trace/irq_event_types.h b/include/trace/irq_event_types.h index 65850bc5ea06..43bcb74dd49f 100644 --- a/include/trace/irq_event_types.h +++ b/include/trace/irq_event_types.h | |||
@@ -8,26 +8,36 @@ | |||
8 | #undef TRACE_SYSTEM | 8 | #undef TRACE_SYSTEM |
9 | #define TRACE_SYSTEM irq | 9 | #define TRACE_SYSTEM irq |
10 | 10 | ||
11 | TRACE_EVENT_FORMAT(irq_handler_entry, | 11 | /* |
12 | TPPROTO(int irq, struct irqaction *action), | 12 | * Tracepoint for entry of interrupt handler: |
13 | TPARGS(irq, action), | 13 | */ |
14 | TPFMT("irq=%d handler=%s", irq, action->name), | 14 | TRACE_FORMAT(irq_handler_entry, |
15 | TRACE_STRUCT( | 15 | TP_PROTO(int irq, struct irqaction *action), |
16 | TRACE_FIELD(int, irq, irq) | 16 | TP_ARGS(irq, action), |
17 | ), | 17 | TP_FMT("irq=%d handler=%s", irq, action->name) |
18 | TPRAWFMT("irq %d") | ||
19 | ); | 18 | ); |
20 | 19 | ||
21 | TRACE_EVENT_FORMAT(irq_handler_exit, | 20 | /* |
22 | TPPROTO(int irq, struct irqaction *action, int ret), | 21 | * Tracepoint for return of an interrupt handler: |
23 | TPARGS(irq, action, ret), | 22 | */ |
24 | TPFMT("irq=%d handler=%s return=%s", | 23 | TRACE_EVENT(irq_handler_exit, |
25 | irq, action->name, ret ? "handled" : "unhandled"), | 24 | |
26 | TRACE_STRUCT( | 25 | TP_PROTO(int irq, struct irqaction *action, int ret), |
27 | TRACE_FIELD(int, irq, irq) | 26 | |
28 | TRACE_FIELD(int, ret, ret) | 27 | TP_ARGS(irq, action, ret), |
28 | |||
29 | TP_STRUCT__entry( | ||
30 | __field( int, irq ) | ||
31 | __field( int, ret ) | ||
29 | ), | 32 | ), |
30 | TPRAWFMT("irq %d ret %d") | 33 | |
31 | ); | 34 | TP_printk("irq=%d return=%s", |
35 | __entry->irq, __entry->ret ? "handled" : "unhandled"), | ||
36 | |||
37 | TP_fast_assign( | ||
38 | __entry->irq = irq; | ||
39 | __entry->ret = ret; | ||
40 | ) | ||
41 | ); | ||
32 | 42 | ||
33 | #undef TRACE_SYSTEM | 43 | #undef TRACE_SYSTEM |
diff --git a/include/trace/lockdep_event_types.h b/include/trace/lockdep_event_types.h index f713d74a82b4..adccfcd2ec8f 100644 --- a/include/trace/lockdep_event_types.h +++ b/include/trace/lockdep_event_types.h | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | ||
2 | #ifndef TRACE_EVENT_FORMAT | 2 | #ifndef TRACE_FORMAT |
3 | # error Do not include this file directly. | 3 | # error Do not include this file directly. |
4 | # error Unless you know what you are doing. | 4 | # error Unless you know what you are doing. |
5 | #endif | 5 | #endif |
@@ -10,32 +10,32 @@ | |||
10 | #ifdef CONFIG_LOCKDEP | 10 | #ifdef CONFIG_LOCKDEP |
11 | 11 | ||
12 | TRACE_FORMAT(lock_acquire, | 12 | TRACE_FORMAT(lock_acquire, |
13 | TPPROTO(struct lockdep_map *lock, unsigned int subclass, | 13 | TP_PROTO(struct lockdep_map *lock, unsigned int subclass, |
14 | int trylock, int read, int check, | 14 | int trylock, int read, int check, |
15 | struct lockdep_map *next_lock, unsigned long ip), | 15 | struct lockdep_map *next_lock, unsigned long ip), |
16 | TPARGS(lock, subclass, trylock, read, check, next_lock, ip), | 16 | TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip), |
17 | TPFMT("%s%s%s", trylock ? "try " : "", | 17 | TP_FMT("%s%s%s", trylock ? "try " : "", |
18 | read ? "read " : "", lock->name) | 18 | read ? "read " : "", lock->name) |
19 | ); | 19 | ); |
20 | 20 | ||
21 | TRACE_FORMAT(lock_release, | 21 | TRACE_FORMAT(lock_release, |
22 | TPPROTO(struct lockdep_map *lock, int nested, unsigned long ip), | 22 | TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip), |
23 | TPARGS(lock, nested, ip), | 23 | TP_ARGS(lock, nested, ip), |
24 | TPFMT("%s", lock->name) | 24 | TP_FMT("%s", lock->name) |
25 | ); | 25 | ); |
26 | 26 | ||
27 | #ifdef CONFIG_LOCK_STAT | 27 | #ifdef CONFIG_LOCK_STAT |
28 | 28 | ||
29 | TRACE_FORMAT(lock_contended, | 29 | TRACE_FORMAT(lock_contended, |
30 | TPPROTO(struct lockdep_map *lock, unsigned long ip), | 30 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), |
31 | TPARGS(lock, ip), | 31 | TP_ARGS(lock, ip), |
32 | TPFMT("%s", lock->name) | 32 | TP_FMT("%s", lock->name) |
33 | ); | 33 | ); |
34 | 34 | ||
35 | TRACE_FORMAT(lock_acquired, | 35 | TRACE_FORMAT(lock_acquired, |
36 | TPPROTO(struct lockdep_map *lock, unsigned long ip), | 36 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), |
37 | TPARGS(lock, ip), | 37 | TP_ARGS(lock, ip), |
38 | TPFMT("%s", lock->name) | 38 | TP_FMT("%s", lock->name) |
39 | ); | 39 | ); |
40 | 40 | ||
41 | #endif | 41 | #endif |
diff --git a/include/trace/power.h b/include/trace/power.h index 38aca537e497..ef204666e983 100644 --- a/include/trace/power.h +++ b/include/trace/power.h | |||
@@ -18,15 +18,15 @@ struct power_trace { | |||
18 | }; | 18 | }; |
19 | 19 | ||
20 | DECLARE_TRACE(power_start, | 20 | DECLARE_TRACE(power_start, |
21 | TPPROTO(struct power_trace *it, unsigned int type, unsigned int state), | 21 | TP_PROTO(struct power_trace *it, unsigned int type, unsigned int state), |
22 | TPARGS(it, type, state)); | 22 | TP_ARGS(it, type, state)); |
23 | 23 | ||
24 | DECLARE_TRACE(power_mark, | 24 | DECLARE_TRACE(power_mark, |
25 | TPPROTO(struct power_trace *it, unsigned int type, unsigned int state), | 25 | TP_PROTO(struct power_trace *it, unsigned int type, unsigned int state), |
26 | TPARGS(it, type, state)); | 26 | TP_ARGS(it, type, state)); |
27 | 27 | ||
28 | DECLARE_TRACE(power_end, | 28 | DECLARE_TRACE(power_end, |
29 | TPPROTO(struct power_trace *it), | 29 | TP_PROTO(struct power_trace *it), |
30 | TPARGS(it)); | 30 | TP_ARGS(it)); |
31 | 31 | ||
32 | #endif /* _TRACE_POWER_H */ | 32 | #endif /* _TRACE_POWER_H */ |
diff --git a/include/trace/sched_event_types.h b/include/trace/sched_event_types.h index a6de5c1601a0..fb37af672c88 100644 --- a/include/trace/sched_event_types.h +++ b/include/trace/sched_event_types.h | |||
@@ -1,6 +1,6 @@ | |||
1 | 1 | ||
2 | /* use <trace/sched.h> instead */ | 2 | /* use <trace/sched.h> instead */ |
3 | #ifndef TRACE_EVENT_FORMAT | 3 | #ifndef TRACE_EVENT |
4 | # error Do not include this file directly. | 4 | # error Do not include this file directly. |
5 | # error Unless you know what you are doing. | 5 | # error Unless you know what you are doing. |
6 | #endif | 6 | #endif |
@@ -8,144 +8,330 @@ | |||
8 | #undef TRACE_SYSTEM | 8 | #undef TRACE_SYSTEM |
9 | #define TRACE_SYSTEM sched | 9 | #define TRACE_SYSTEM sched |
10 | 10 | ||
11 | TRACE_EVENT_FORMAT(sched_kthread_stop, | 11 | /* |
12 | TPPROTO(struct task_struct *t), | 12 | * Tracepoint for calling kthread_stop, performed to end a kthread: |
13 | TPARGS(t), | 13 | */ |
14 | TPFMT("task %s:%d", t->comm, t->pid), | 14 | TRACE_EVENT(sched_kthread_stop, |
15 | TRACE_STRUCT( | 15 | |
16 | TRACE_FIELD(pid_t, pid, t->pid) | 16 | TP_PROTO(struct task_struct *t), |
17 | |||
18 | TP_ARGS(t), | ||
19 | |||
20 | TP_STRUCT__entry( | ||
21 | __array( char, comm, TASK_COMM_LEN ) | ||
22 | __field( pid_t, pid ) | ||
17 | ), | 23 | ), |
18 | TPRAWFMT("task %d") | 24 | |
19 | ); | 25 | TP_printk("task %s:%d", __entry->comm, __entry->pid), |
20 | 26 | ||
21 | TRACE_EVENT_FORMAT(sched_kthread_stop_ret, | 27 | TP_fast_assign( |
22 | TPPROTO(int ret), | 28 | memcpy(__entry->comm, t->comm, TASK_COMM_LEN); |
23 | TPARGS(ret), | 29 | __entry->pid = t->pid; |
24 | TPFMT("ret=%d", ret), | 30 | ) |
25 | TRACE_STRUCT( | 31 | ); |
26 | TRACE_FIELD(int, ret, ret) | 32 | |
33 | /* | ||
34 | * Tracepoint for the return value of the kthread stopping: | ||
35 | */ | ||
36 | TRACE_EVENT(sched_kthread_stop_ret, | ||
37 | |||
38 | TP_PROTO(int ret), | ||
39 | |||
40 | TP_ARGS(ret), | ||
41 | |||
42 | TP_STRUCT__entry( | ||
43 | __field( int, ret ) | ||
27 | ), | 44 | ), |
28 | TPRAWFMT("ret=%d") | 45 | |
29 | ); | 46 | TP_printk("ret %d", __entry->ret), |
30 | 47 | ||
31 | TRACE_EVENT_FORMAT(sched_wait_task, | 48 | TP_fast_assign( |
32 | TPPROTO(struct rq *rq, struct task_struct *p), | 49 | __entry->ret = ret; |
33 | TPARGS(rq, p), | 50 | ) |
34 | TPFMT("task %s:%d", p->comm, p->pid), | 51 | ); |
35 | TRACE_STRUCT( | 52 | |
36 | TRACE_FIELD(pid_t, pid, p->pid) | 53 | /* |
54 | * Tracepoint for waiting on task to unschedule: | ||
55 | * | ||
56 | * (NOTE: the 'rq' argument is not used by generic trace events, | ||
57 | * but used by the latency tracer plugin. ) | ||
58 | */ | ||
59 | TRACE_EVENT(sched_wait_task, | ||
60 | |||
61 | TP_PROTO(struct rq *rq, struct task_struct *p), | ||
62 | |||
63 | TP_ARGS(rq, p), | ||
64 | |||
65 | TP_STRUCT__entry( | ||
66 | __array( char, comm, TASK_COMM_LEN ) | ||
67 | __field( pid_t, pid ) | ||
68 | __field( int, prio ) | ||
37 | ), | 69 | ), |
38 | TPRAWFMT("task %d") | 70 | |
39 | ); | 71 | TP_printk("task %s:%d [%d]", |
40 | 72 | __entry->comm, __entry->pid, __entry->prio), | |
41 | TRACE_EVENT_FORMAT(sched_wakeup, | 73 | |
42 | TPPROTO(struct rq *rq, struct task_struct *p, int success), | 74 | TP_fast_assign( |
43 | TPARGS(rq, p, success), | 75 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
44 | TPFMT("task %s:%d %s", | 76 | __entry->pid = p->pid; |
45 | p->comm, p->pid, success ? "succeeded" : "failed"), | 77 | __entry->prio = p->prio; |
46 | TRACE_STRUCT( | 78 | ) |
47 | TRACE_FIELD(pid_t, pid, p->pid) | 79 | ); |
48 | TRACE_FIELD(int, success, success) | 80 | |
81 | /* | ||
82 | * Tracepoint for waking up a task: | ||
83 | * | ||
84 | * (NOTE: the 'rq' argument is not used by generic trace events, | ||
85 | * but used by the latency tracer plugin. ) | ||
86 | */ | ||
87 | TRACE_EVENT(sched_wakeup, | ||
88 | |||
89 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | ||
90 | |||
91 | TP_ARGS(rq, p, success), | ||
92 | |||
93 | TP_STRUCT__entry( | ||
94 | __array( char, comm, TASK_COMM_LEN ) | ||
95 | __field( pid_t, pid ) | ||
96 | __field( int, prio ) | ||
97 | __field( int, success ) | ||
49 | ), | 98 | ), |
50 | TPRAWFMT("task %d success=%d") | 99 | |
51 | ); | 100 | TP_printk("task %s:%d [%d] success=%d", |
52 | 101 | __entry->comm, __entry->pid, __entry->prio, | |
53 | TRACE_EVENT_FORMAT(sched_wakeup_new, | 102 | __entry->success), |
54 | TPPROTO(struct rq *rq, struct task_struct *p, int success), | 103 | |
55 | TPARGS(rq, p, success), | 104 | TP_fast_assign( |
56 | TPFMT("task %s:%d", | 105 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
57 | p->comm, p->pid, success ? "succeeded" : "failed"), | 106 | __entry->pid = p->pid; |
58 | TRACE_STRUCT( | 107 | __entry->prio = p->prio; |
59 | TRACE_FIELD(pid_t, pid, p->pid) | 108 | __entry->success = success; |
60 | TRACE_FIELD(int, success, success) | 109 | ) |
110 | ); | ||
111 | |||
112 | /* | ||
113 | * Tracepoint for waking up a new task: | ||
114 | * | ||
115 | * (NOTE: the 'rq' argument is not used by generic trace events, | ||
116 | * but used by the latency tracer plugin. ) | ||
117 | */ | ||
118 | TRACE_EVENT(sched_wakeup_new, | ||
119 | |||
120 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | ||
121 | |||
122 | TP_ARGS(rq, p, success), | ||
123 | |||
124 | TP_STRUCT__entry( | ||
125 | __array( char, comm, TASK_COMM_LEN ) | ||
126 | __field( pid_t, pid ) | ||
127 | __field( int, prio ) | ||
128 | __field( int, success ) | ||
61 | ), | 129 | ), |
62 | TPRAWFMT("task %d success=%d") | 130 | |
63 | ); | 131 | TP_printk("task %s:%d [%d] success=%d", |
64 | 132 | __entry->comm, __entry->pid, __entry->prio, | |
65 | TRACE_EVENT_FORMAT(sched_switch, | 133 | __entry->success), |
66 | TPPROTO(struct rq *rq, struct task_struct *prev, | 134 | |
67 | struct task_struct *next), | 135 | TP_fast_assign( |
68 | TPARGS(rq, prev, next), | 136 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
69 | TPFMT("task %s:%d ==> %s:%d", | 137 | __entry->pid = p->pid; |
70 | prev->comm, prev->pid, next->comm, next->pid), | 138 | __entry->prio = p->prio; |
71 | TRACE_STRUCT( | 139 | __entry->success = success; |
72 | TRACE_FIELD(pid_t, prev_pid, prev->pid) | 140 | ) |
73 | TRACE_FIELD(int, prev_prio, prev->prio) | 141 | ); |
74 | TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN], | 142 | |
75 | next_comm, | 143 | /* |
76 | TPCMD(memcpy(TRACE_ENTRY->next_comm, | 144 | * Tracepoint for task switches, performed by the scheduler: |
77 | next->comm, | 145 | * |
78 | TASK_COMM_LEN))) | 146 | * (NOTE: the 'rq' argument is not used by generic trace events, |
79 | TRACE_FIELD(pid_t, next_pid, next->pid) | 147 | * but used by the latency tracer plugin. ) |
80 | TRACE_FIELD(int, next_prio, next->prio) | 148 | */ |
149 | TRACE_EVENT(sched_switch, | ||
150 | |||
151 | TP_PROTO(struct rq *rq, struct task_struct *prev, | ||
152 | struct task_struct *next), | ||
153 | |||
154 | TP_ARGS(rq, prev, next), | ||
155 | |||
156 | TP_STRUCT__entry( | ||
157 | __array( char, prev_comm, TASK_COMM_LEN ) | ||
158 | __field( pid_t, prev_pid ) | ||
159 | __field( int, prev_prio ) | ||
160 | __array( char, next_comm, TASK_COMM_LEN ) | ||
161 | __field( pid_t, next_pid ) | ||
162 | __field( int, next_prio ) | ||
81 | ), | 163 | ), |
82 | TPRAWFMT("prev %d:%d ==> next %s:%d:%d") | 164 | |
83 | ); | 165 | TP_printk("task %s:%d [%d] ==> %s:%d [%d]", |
84 | 166 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, | |
85 | TRACE_EVENT_FORMAT(sched_migrate_task, | 167 | __entry->next_comm, __entry->next_pid, __entry->next_prio), |
86 | TPPROTO(struct task_struct *p, int orig_cpu, int dest_cpu), | 168 | |
87 | TPARGS(p, orig_cpu, dest_cpu), | 169 | TP_fast_assign( |
88 | TPFMT("task %s:%d from: %d to: %d", | 170 | memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); |
89 | p->comm, p->pid, orig_cpu, dest_cpu), | 171 | __entry->prev_pid = prev->pid; |
90 | TRACE_STRUCT( | 172 | __entry->prev_prio = prev->prio; |
91 | TRACE_FIELD(pid_t, pid, p->pid) | 173 | memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); |
92 | TRACE_FIELD(int, orig_cpu, orig_cpu) | 174 | __entry->next_pid = next->pid; |
93 | TRACE_FIELD(int, dest_cpu, dest_cpu) | 175 | __entry->next_prio = next->prio; |
176 | ) | ||
177 | ); | ||
178 | |||
179 | /* | ||
180 | * Tracepoint for a task being migrated: | ||
181 | */ | ||
182 | TRACE_EVENT(sched_migrate_task, | ||
183 | |||
184 | TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu), | ||
185 | |||
186 | TP_ARGS(p, orig_cpu, dest_cpu), | ||
187 | |||
188 | TP_STRUCT__entry( | ||
189 | __array( char, comm, TASK_COMM_LEN ) | ||
190 | __field( pid_t, pid ) | ||
191 | __field( int, prio ) | ||
192 | __field( int, orig_cpu ) | ||
193 | __field( int, dest_cpu ) | ||
94 | ), | 194 | ), |
95 | TPRAWFMT("task %d from: %d to: %d") | 195 | |
96 | ); | 196 | TP_printk("task %s:%d [%d] from: %d to: %d", |
97 | 197 | __entry->comm, __entry->pid, __entry->prio, | |
98 | TRACE_EVENT_FORMAT(sched_process_free, | 198 | __entry->orig_cpu, __entry->dest_cpu), |
99 | TPPROTO(struct task_struct *p), | 199 | |
100 | TPARGS(p), | 200 | TP_fast_assign( |
101 | TPFMT("task %s:%d", p->comm, p->pid), | 201 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
102 | TRACE_STRUCT( | 202 | __entry->pid = p->pid; |
103 | TRACE_FIELD(pid_t, pid, p->pid) | 203 | __entry->prio = p->prio; |
204 | __entry->orig_cpu = orig_cpu; | ||
205 | __entry->dest_cpu = dest_cpu; | ||
206 | ) | ||
207 | ); | ||
208 | |||
209 | /* | ||
210 | * Tracepoint for freeing a task: | ||
211 | */ | ||
212 | TRACE_EVENT(sched_process_free, | ||
213 | |||
214 | TP_PROTO(struct task_struct *p), | ||
215 | |||
216 | TP_ARGS(p), | ||
217 | |||
218 | TP_STRUCT__entry( | ||
219 | __array( char, comm, TASK_COMM_LEN ) | ||
220 | __field( pid_t, pid ) | ||
221 | __field( int, prio ) | ||
104 | ), | 222 | ), |
105 | TPRAWFMT("task %d") | 223 | |
106 | ); | 224 | TP_printk("task %s:%d [%d]", |
107 | 225 | __entry->comm, __entry->pid, __entry->prio), | |
108 | TRACE_EVENT_FORMAT(sched_process_exit, | 226 | |
109 | TPPROTO(struct task_struct *p), | 227 | TP_fast_assign( |
110 | TPARGS(p), | 228 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
111 | TPFMT("task %s:%d", p->comm, p->pid), | 229 | __entry->pid = p->pid; |
112 | TRACE_STRUCT( | 230 | __entry->prio = p->prio; |
113 | TRACE_FIELD(pid_t, pid, p->pid) | 231 | ) |
232 | ); | ||
233 | |||
234 | /* | ||
235 | * Tracepoint for a task exiting: | ||
236 | */ | ||
237 | TRACE_EVENT(sched_process_exit, | ||
238 | |||
239 | TP_PROTO(struct task_struct *p), | ||
240 | |||
241 | TP_ARGS(p), | ||
242 | |||
243 | TP_STRUCT__entry( | ||
244 | __array( char, comm, TASK_COMM_LEN ) | ||
245 | __field( pid_t, pid ) | ||
246 | __field( int, prio ) | ||
114 | ), | 247 | ), |
115 | TPRAWFMT("task %d") | 248 | |
116 | ); | 249 | TP_printk("task %s:%d [%d]", |
117 | 250 | __entry->comm, __entry->pid, __entry->prio), | |
118 | TRACE_EVENT_FORMAT(sched_process_wait, | 251 | |
119 | TPPROTO(struct pid *pid), | 252 | TP_fast_assign( |
120 | TPARGS(pid), | 253 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
121 | TPFMT("pid %d", pid_nr(pid)), | 254 | __entry->pid = p->pid; |
122 | TRACE_STRUCT( | 255 | __entry->prio = p->prio; |
123 | TRACE_FIELD(pid_t, pid, pid_nr(pid)) | 256 | ) |
257 | ); | ||
258 | |||
259 | /* | ||
260 | * Tracepoint for a waiting task: | ||
261 | */ | ||
262 | TRACE_EVENT(sched_process_wait, | ||
263 | |||
264 | TP_PROTO(struct pid *pid), | ||
265 | |||
266 | TP_ARGS(pid), | ||
267 | |||
268 | TP_STRUCT__entry( | ||
269 | __array( char, comm, TASK_COMM_LEN ) | ||
270 | __field( pid_t, pid ) | ||
271 | __field( int, prio ) | ||
124 | ), | 272 | ), |
125 | TPRAWFMT("task %d") | 273 | |
126 | ); | 274 | TP_printk("task %s:%d [%d]", |
127 | 275 | __entry->comm, __entry->pid, __entry->prio), | |
128 | TRACE_EVENT_FORMAT(sched_process_fork, | 276 | |
129 | TPPROTO(struct task_struct *parent, struct task_struct *child), | 277 | TP_fast_assign( |
130 | TPARGS(parent, child), | 278 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); |
131 | TPFMT("parent %s:%d child %s:%d", | 279 | __entry->pid = pid_nr(pid); |
132 | parent->comm, parent->pid, child->comm, child->pid), | 280 | __entry->prio = current->prio; |
133 | TRACE_STRUCT( | 281 | ) |
134 | TRACE_FIELD(pid_t, parent, parent->pid) | 282 | ); |
135 | TRACE_FIELD(pid_t, child, child->pid) | 283 | |
284 | /* | ||
285 | * Tracepoint for do_fork: | ||
286 | */ | ||
287 | TRACE_EVENT(sched_process_fork, | ||
288 | |||
289 | TP_PROTO(struct task_struct *parent, struct task_struct *child), | ||
290 | |||
291 | TP_ARGS(parent, child), | ||
292 | |||
293 | TP_STRUCT__entry( | ||
294 | __array( char, parent_comm, TASK_COMM_LEN ) | ||
295 | __field( pid_t, parent_pid ) | ||
296 | __array( char, child_comm, TASK_COMM_LEN ) | ||
297 | __field( pid_t, child_pid ) | ||
136 | ), | 298 | ), |
137 | TPRAWFMT("parent %d child %d") | 299 | |
138 | ); | 300 | TP_printk("parent %s:%d child %s:%d", |
139 | 301 | __entry->parent_comm, __entry->parent_pid, | |
140 | TRACE_EVENT_FORMAT(sched_signal_send, | 302 | __entry->child_comm, __entry->child_pid), |
141 | TPPROTO(int sig, struct task_struct *p), | 303 | |
142 | TPARGS(sig, p), | 304 | TP_fast_assign( |
143 | TPFMT("sig: %d task %s:%d", sig, p->comm, p->pid), | 305 | memcpy(__entry->parent_comm, parent->comm, TASK_COMM_LEN); |
144 | TRACE_STRUCT( | 306 | __entry->parent_pid = parent->pid; |
145 | TRACE_FIELD(int, sig, sig) | 307 | memcpy(__entry->child_comm, child->comm, TASK_COMM_LEN); |
146 | TRACE_FIELD(pid_t, pid, p->pid) | 308 | __entry->child_pid = child->pid; |
309 | ) | ||
310 | ); | ||
311 | |||
312 | /* | ||
313 | * Tracepoint for sending a signal: | ||
314 | */ | ||
315 | TRACE_EVENT(sched_signal_send, | ||
316 | |||
317 | TP_PROTO(int sig, struct task_struct *p), | ||
318 | |||
319 | TP_ARGS(sig, p), | ||
320 | |||
321 | TP_STRUCT__entry( | ||
322 | __field( int, sig ) | ||
323 | __array( char, comm, TASK_COMM_LEN ) | ||
324 | __field( pid_t, pid ) | ||
147 | ), | 325 | ), |
148 | TPRAWFMT("sig: %d task %d") | 326 | |
149 | ); | 327 | TP_printk("sig: %d task %s:%d", |
328 | __entry->sig, __entry->comm, __entry->pid), | ||
329 | |||
330 | TP_fast_assign( | ||
331 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | ||
332 | __entry->pid = p->pid; | ||
333 | __entry->sig = sig; | ||
334 | ) | ||
335 | ); | ||
150 | 336 | ||
151 | #undef TRACE_SYSTEM | 337 | #undef TRACE_SYSTEM |
diff --git a/include/trace/workqueue.h b/include/trace/workqueue.h index 867829df4571..7626523deeba 100644 --- a/include/trace/workqueue.h +++ b/include/trace/workqueue.h | |||
@@ -6,20 +6,20 @@ | |||
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | 7 | ||
8 | DECLARE_TRACE(workqueue_insertion, | 8 | DECLARE_TRACE(workqueue_insertion, |
9 | TPPROTO(struct task_struct *wq_thread, struct work_struct *work), | 9 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), |
10 | TPARGS(wq_thread, work)); | 10 | TP_ARGS(wq_thread, work)); |
11 | 11 | ||
12 | DECLARE_TRACE(workqueue_execution, | 12 | DECLARE_TRACE(workqueue_execution, |
13 | TPPROTO(struct task_struct *wq_thread, struct work_struct *work), | 13 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), |
14 | TPARGS(wq_thread, work)); | 14 | TP_ARGS(wq_thread, work)); |
15 | 15 | ||
16 | /* Trace the creation of one workqueue thread on a cpu */ | 16 | /* Trace the creation of one workqueue thread on a cpu */ |
17 | DECLARE_TRACE(workqueue_creation, | 17 | DECLARE_TRACE(workqueue_creation, |
18 | TPPROTO(struct task_struct *wq_thread, int cpu), | 18 | TP_PROTO(struct task_struct *wq_thread, int cpu), |
19 | TPARGS(wq_thread, cpu)); | 19 | TP_ARGS(wq_thread, cpu)); |
20 | 20 | ||
21 | DECLARE_TRACE(workqueue_destruction, | 21 | DECLARE_TRACE(workqueue_destruction, |
22 | TPPROTO(struct task_struct *wq_thread), | 22 | TP_PROTO(struct task_struct *wq_thread), |
23 | TPARGS(wq_thread)); | 23 | TP_ARGS(wq_thread)); |
24 | 24 | ||
25 | #endif /* __TRACE_WORKQUEUE_H */ | 25 | #endif /* __TRACE_WORKQUEUE_H */ |