71b14828a95734be29c6c8575f1bd3c49075ecdb
[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 TRACE_EVENT_FORMAT(sched_switch,
66         TP_PROTO(struct rq *rq, struct task_struct *prev,
67                 struct task_struct *next),
68         TP_ARGS(rq, prev, next),
69         TP_FMT("task %s:%d ==> %s:%d",
70               prev->comm, prev->pid, next->comm, next->pid),
71         TRACE_STRUCT(
72                 TRACE_FIELD(pid_t, prev_pid, prev->pid)
73                 TRACE_FIELD(int, prev_prio, prev->prio)
74                 TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN],
75                                     next_comm,
76                                     TP_CMD(memcpy(TRACE_ENTRY->next_comm,
77                                                  next->comm,
78                                                  TASK_COMM_LEN)))
79                 TRACE_FIELD(pid_t, next_pid, next->pid)
80                 TRACE_FIELD(int, next_prio, next->prio)
81         ),
82         TP_RAW_FMT("prev %d:%d ==> next %s:%d:%d")
83         );
84
85 TRACE_EVENT_FORMAT(sched_migrate_task,
86         TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu),
87         TP_ARGS(p, orig_cpu, dest_cpu),
88         TP_FMT("task %s:%d from: %d  to: %d",
89               p->comm, p->pid, orig_cpu, dest_cpu),
90         TRACE_STRUCT(
91                 TRACE_FIELD(pid_t, pid, p->pid)
92                 TRACE_FIELD(int, orig_cpu, orig_cpu)
93                 TRACE_FIELD(int, dest_cpu, dest_cpu)
94         ),
95         TP_RAW_FMT("task %d  from: %d to: %d")
96         );
97
98 TRACE_EVENT_FORMAT(sched_process_free,
99         TP_PROTO(struct task_struct *p),
100         TP_ARGS(p),
101         TP_FMT("task %s:%d", p->comm, p->pid),
102         TRACE_STRUCT(
103                 TRACE_FIELD(pid_t, pid, p->pid)
104         ),
105         TP_RAW_FMT("task %d")
106         );
107
108 TRACE_EVENT_FORMAT(sched_process_exit,
109         TP_PROTO(struct task_struct *p),
110         TP_ARGS(p),
111         TP_FMT("task %s:%d", p->comm, p->pid),
112         TRACE_STRUCT(
113                 TRACE_FIELD(pid_t, pid, p->pid)
114         ),
115         TP_RAW_FMT("task %d")
116         );
117
118 TRACE_EVENT_FORMAT(sched_process_wait,
119         TP_PROTO(struct pid *pid),
120         TP_ARGS(pid),
121         TP_FMT("pid %d", pid_nr(pid)),
122         TRACE_STRUCT(
123                 TRACE_FIELD(pid_t, pid, pid_nr(pid))
124         ),
125         TP_RAW_FMT("task %d")
126         );
127
128 TRACE_EVENT_FORMAT(sched_process_fork,
129         TP_PROTO(struct task_struct *parent, struct task_struct *child),
130         TP_ARGS(parent, child),
131         TP_FMT("parent %s:%d  child %s:%d",
132               parent->comm, parent->pid, child->comm, child->pid),
133         TRACE_STRUCT(
134                 TRACE_FIELD(pid_t, parent, parent->pid)
135                 TRACE_FIELD(pid_t, child, child->pid)
136         ),
137         TP_RAW_FMT("parent %d  child %d")
138         );
139
140 TRACE_EVENT_FORMAT(sched_signal_send,
141         TP_PROTO(int sig, struct task_struct *p),
142         TP_ARGS(sig, p),
143         TP_FMT("sig: %d   task %s:%d", sig, p->comm, p->pid),
144         TRACE_STRUCT(
145                 TRACE_FIELD(int, sig, sig)
146                 TRACE_FIELD(pid_t, pid, p->pid)
147         ),
148         TP_RAW_FMT("sig: %d  task %d")
149         );
150
151 #undef TRACE_SYSTEM