aa77fb7540386cae54c2ccffb4b2d8d3885758ad
[linux-2.6.git] / include / trace / sched_event_types.h
1
2 /* use <trace/sched.h> instead */
3 #ifndef TRACE_EVENT_FORMAT
4 # error Do not include this file directly.
5 # error Unless you know what you are doing.
6 #endif
7
8 #undef TRACE_SYSTEM
9 #define TRACE_SYSTEM sched
10
11 TRACE_EVENT_FORMAT(sched_kthread_stop,
12         TP_PROTO(struct task_struct *t),
13         TP_ARGS(t),
14         TP_FMT("task %s:%d", t->comm, t->pid),
15         TRACE_STRUCT(
16                 TRACE_FIELD(pid_t, pid, t->pid)
17         ),
18         TP_RAW_FMT("task %d")
19         );
20
21 TRACE_EVENT_FORMAT(sched_kthread_stop_ret,
22         TP_PROTO(int ret),
23         TP_ARGS(ret),
24         TP_FMT("ret=%d", ret),
25         TRACE_STRUCT(
26                 TRACE_FIELD(int, ret, ret)
27         ),
28         TP_RAW_FMT("ret=%d")
29         );
30
31 TRACE_EVENT_FORMAT(sched_wait_task,
32         TP_PROTO(struct rq *rq, struct task_struct *p),
33         TP_ARGS(rq, p),
34         TP_FMT("task %s:%d", p->comm, p->pid),
35         TRACE_STRUCT(
36                 TRACE_FIELD(pid_t, pid, p->pid)
37         ),
38         TP_RAW_FMT("task %d")
39         );
40
41 TRACE_EVENT_FORMAT(sched_wakeup,
42         TP_PROTO(struct rq *rq, struct task_struct *p, int success),
43         TP_ARGS(rq, p, success),
44         TP_FMT("task %s:%d %s",
45               p->comm, p->pid, success ? "succeeded" : "failed"),
46         TRACE_STRUCT(
47                 TRACE_FIELD(pid_t, pid, p->pid)
48                 TRACE_FIELD(int, success, success)
49         ),
50         TP_RAW_FMT("task %d success=%d")
51         );
52
53 TRACE_EVENT_FORMAT(sched_wakeup_new,
54         TP_PROTO(struct rq *rq, struct task_struct *p, int success),
55         TP_ARGS(rq, p, success),
56         TP_FMT("task %s:%d",
57               p->comm, p->pid, success ? "succeeded" : "failed"),
58         TRACE_STRUCT(
59                 TRACE_FIELD(pid_t, pid, p->pid)
60                 TRACE_FIELD(int, success, success)
61         ),
62         TP_RAW_FMT("task %d success=%d")
63         );
64
65 /*
66  * Tracepoint for task switches, performed by the scheduler:
67  *
68  * (NOTE: the 'rq' argument is not used by generic trace events,
69  *        but used by the latency tracer plugin. )
70  */
71 TRACE_EVENT(sched_switch,
72
73         TP_PROTO(struct rq *rq, struct task_struct *prev,
74                  struct task_struct *next),
75
76         TP_ARGS(rq, prev, next),
77
78         TP_STRUCT__entry(
79                 __array(        char,   prev_comm,      TASK_COMM_LEN   )
80                 __field(        pid_t,  prev_pid                        )
81                 __field(        int,    prev_prio                       )
82                 __array(        char,   next_comm,      TASK_COMM_LEN   )
83                 __field(        pid_t,  next_pid                        )
84                 __field(        int,    next_prio                       )
85         ),
86
87         TP_printk("task %s:%d [%d] ==> %s:%d [%d]",
88                 __entry->prev_comm, __entry->prev_pid, __entry->prev_prio,
89                 __entry->next_comm, __entry->next_pid, __entry->next_prio),
90
91         TP_fast_assign(
92                 memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
93                 __entry->prev_pid       = prev->pid;
94                 __entry->prev_prio      = prev->prio;
95                 memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
96                 __entry->next_pid       = next->pid;
97                 __entry->next_prio      = next->prio;
98         )
99 );
100
101 TRACE_EVENT_FORMAT(sched_migrate_task,
102         TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu),
103         TP_ARGS(p, orig_cpu, dest_cpu),
104         TP_FMT("task %s:%d from: %d  to: %d",
105               p->comm, p->pid, orig_cpu, dest_cpu),
106         TRACE_STRUCT(
107                 TRACE_FIELD(pid_t, pid, p->pid)
108                 TRACE_FIELD(int, orig_cpu, orig_cpu)
109                 TRACE_FIELD(int, dest_cpu, dest_cpu)
110         ),
111         TP_RAW_FMT("task %d  from: %d to: %d")
112         );
113
114 TRACE_EVENT_FORMAT(sched_process_free,
115         TP_PROTO(struct task_struct *p),
116         TP_ARGS(p),
117         TP_FMT("task %s:%d", p->comm, p->pid),
118         TRACE_STRUCT(
119                 TRACE_FIELD(pid_t, pid, p->pid)
120         ),
121         TP_RAW_FMT("task %d")
122         );
123
124 TRACE_EVENT_FORMAT(sched_process_exit,
125         TP_PROTO(struct task_struct *p),
126         TP_ARGS(p),
127         TP_FMT("task %s:%d", p->comm, p->pid),
128         TRACE_STRUCT(
129                 TRACE_FIELD(pid_t, pid, p->pid)
130         ),
131         TP_RAW_FMT("task %d")
132         );
133
134 TRACE_EVENT_FORMAT(sched_process_wait,
135         TP_PROTO(struct pid *pid),
136         TP_ARGS(pid),
137         TP_FMT("pid %d", pid_nr(pid)),
138         TRACE_STRUCT(
139                 TRACE_FIELD(pid_t, pid, pid_nr(pid))
140         ),
141         TP_RAW_FMT("task %d")
142         );
143
144 TRACE_EVENT_FORMAT(sched_process_fork,
145         TP_PROTO(struct task_struct *parent, struct task_struct *child),
146         TP_ARGS(parent, child),
147         TP_FMT("parent %s:%d  child %s:%d",
148               parent->comm, parent->pid, child->comm, child->pid),
149         TRACE_STRUCT(
150                 TRACE_FIELD(pid_t, parent, parent->pid)
151                 TRACE_FIELD(pid_t, child, child->pid)
152         ),
153         TP_RAW_FMT("parent %d  child %d")
154         );
155
156 TRACE_EVENT_FORMAT(sched_signal_send,
157         TP_PROTO(int sig, struct task_struct *p),
158         TP_ARGS(sig, p),
159         TP_FMT("sig: %d   task %s:%d", sig, p->comm, p->pid),
160         TRACE_STRUCT(
161                 TRACE_FIELD(int, sig, sig)
162                 TRACE_FIELD(pid_t, pid, p->pid)
163         ),
164         TP_RAW_FMT("sig: %d  task %d")
165         );
166
167 #undef TRACE_SYSTEM