Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6] / kernel / trace / trace_event_types.h
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM    ftrace
3
4 /*
5  * We cheat and use the proto type field as the ID
6  * and args as the entry type (minus 'struct')
7  */
8 TRACE_EVENT_FORMAT(function, TRACE_FN, ftrace_entry, ignore,
9         TRACE_STRUCT(
10                 TRACE_FIELD(unsigned long, ip, ip)
11                 TRACE_FIELD(unsigned long, parent_ip, parent_ip)
12         ),
13         TP_RAW_FMT(" %lx <-- %lx")
14 );
15
16 TRACE_EVENT_FORMAT(funcgraph_entry, TRACE_GRAPH_ENT,
17                    ftrace_graph_ent_entry, ignore,
18         TRACE_STRUCT(
19                 TRACE_FIELD(unsigned long, graph_ent.func, func)
20                 TRACE_FIELD(int, graph_ent.depth, depth)
21         ),
22         TP_RAW_FMT("--> %lx (%d)")
23 );
24
25 TRACE_EVENT_FORMAT(funcgraph_exit, TRACE_GRAPH_RET,
26                    ftrace_graph_ret_entry, ignore,
27         TRACE_STRUCT(
28                 TRACE_FIELD(unsigned long, ret.func, func)
29                 TRACE_FIELD(int, ret.depth, depth)
30         ),
31         TP_RAW_FMT("<-- %lx (%d)")
32 );
33
34 TRACE_EVENT_FORMAT(wakeup, TRACE_WAKE, ctx_switch_entry, ignore,
35         TRACE_STRUCT(
36                 TRACE_FIELD(unsigned int, prev_pid, prev_pid)
37                 TRACE_FIELD(unsigned char, prev_prio, prev_prio)
38                 TRACE_FIELD(unsigned char, prev_state, prev_state)
39                 TRACE_FIELD(unsigned int, next_pid, next_pid)
40                 TRACE_FIELD(unsigned char, next_prio, next_prio)
41                 TRACE_FIELD(unsigned char, next_state, next_state)
42                 TRACE_FIELD(unsigned int, next_cpu, next_cpu)
43         ),
44         TP_RAW_FMT("%u:%u:%u  ==+ %u:%u:%u [%03u]")
45 );
46
47 TRACE_EVENT_FORMAT(context_switch, TRACE_CTX, ctx_switch_entry, ignore,
48         TRACE_STRUCT(
49                 TRACE_FIELD(unsigned int, prev_pid, prev_pid)
50                 TRACE_FIELD(unsigned char, prev_prio, prev_prio)
51                 TRACE_FIELD(unsigned char, prev_state, prev_state)
52                 TRACE_FIELD(unsigned int, next_pid, next_pid)
53                 TRACE_FIELD(unsigned char, next_prio, next_prio)
54                 TRACE_FIELD(unsigned char, next_state, next_state)
55                 TRACE_FIELD(unsigned int, next_cpu, next_cpu)
56         ),
57         TP_RAW_FMT("%u:%u:%u  ==+ %u:%u:%u [%03u]")
58 );
59
60 TRACE_EVENT_FORMAT(special, TRACE_SPECIAL, special_entry, ignore,
61         TRACE_STRUCT(
62                 TRACE_FIELD(unsigned long, arg1, arg1)
63                 TRACE_FIELD(unsigned long, arg2, arg2)
64                 TRACE_FIELD(unsigned long, arg3, arg3)
65         ),
66         TP_RAW_FMT("(%08lx) (%08lx) (%08lx)")
67 );
68
69 /*
70  * Stack-trace entry:
71  */
72
73 /* #define FTRACE_STACK_ENTRIES   8 */
74
75 TRACE_EVENT_FORMAT(kernel_stack, TRACE_STACK, stack_entry, ignore,
76         TRACE_STRUCT(
77                 TRACE_FIELD(unsigned long, caller[0], stack0)
78                 TRACE_FIELD(unsigned long, caller[1], stack1)
79                 TRACE_FIELD(unsigned long, caller[2], stack2)
80                 TRACE_FIELD(unsigned long, caller[3], stack3)
81                 TRACE_FIELD(unsigned long, caller[4], stack4)
82                 TRACE_FIELD(unsigned long, caller[5], stack5)
83                 TRACE_FIELD(unsigned long, caller[6], stack6)
84                 TRACE_FIELD(unsigned long, caller[7], stack7)
85         ),
86         TP_RAW_FMT("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n"
87                  "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n")
88 );
89
90 TRACE_EVENT_FORMAT(user_stack, TRACE_USER_STACK, userstack_entry, ignore,
91         TRACE_STRUCT(
92                 TRACE_FIELD(unsigned long, caller[0], stack0)
93                 TRACE_FIELD(unsigned long, caller[1], stack1)
94                 TRACE_FIELD(unsigned long, caller[2], stack2)
95                 TRACE_FIELD(unsigned long, caller[3], stack3)
96                 TRACE_FIELD(unsigned long, caller[4], stack4)
97                 TRACE_FIELD(unsigned long, caller[5], stack5)
98                 TRACE_FIELD(unsigned long, caller[6], stack6)
99                 TRACE_FIELD(unsigned long, caller[7], stack7)
100         ),
101         TP_RAW_FMT("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n"
102                  "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n")
103 );
104
105 TRACE_EVENT_FORMAT(bprint, TRACE_BPRINT, bprint_entry, ignore,
106         TRACE_STRUCT(
107                 TRACE_FIELD(unsigned long, ip, ip)
108                 TRACE_FIELD(char *, fmt, fmt)
109                 TRACE_FIELD_ZERO_CHAR(buf)
110         ),
111         TP_RAW_FMT("%08lx (%d) fmt:%p %s")
112 );
113
114 TRACE_EVENT_FORMAT(print, TRACE_PRINT, print_entry, ignore,
115         TRACE_STRUCT(
116                 TRACE_FIELD(unsigned long, ip, ip)
117                 TRACE_FIELD_ZERO_CHAR(buf)
118         ),
119         TP_RAW_FMT("%08lx (%d) fmt:%p %s")
120 );
121
122 TRACE_EVENT_FORMAT(branch, TRACE_BRANCH, trace_branch, ignore,
123         TRACE_STRUCT(
124                 TRACE_FIELD(unsigned int, line, line)
125                 TRACE_FIELD_SPECIAL(char func[TRACE_FUNC_SIZE+1], func, func)
126                 TRACE_FIELD_SPECIAL(char file[TRACE_FUNC_SIZE+1], file, file)
127                 TRACE_FIELD(char, correct, correct)
128         ),
129         TP_RAW_FMT("%u:%s:%s (%u)")
130 );
131
132 TRACE_EVENT_FORMAT(hw_branch, TRACE_HW_BRANCHES, hw_branch_entry, ignore,
133         TRACE_STRUCT(
134                 TRACE_FIELD(u64, from, from)
135                 TRACE_FIELD(u64, to, to)
136         ),
137         TP_RAW_FMT("from: %llx to: %llx")
138 );
139
140 TRACE_EVENT_FORMAT(power, TRACE_POWER, trace_power, ignore,
141         TRACE_STRUCT(
142                 TRACE_FIELD(ktime_t, state_data.stamp, stamp)
143                 TRACE_FIELD(ktime_t, state_data.end, end)
144                 TRACE_FIELD(int, state_data.type, type)
145                 TRACE_FIELD(int, state_data.state, state)
146         ),
147         TP_RAW_FMT("%llx->%llx type:%u state:%u")
148 );
149
150 TRACE_EVENT_FORMAT(kmem_alloc, TRACE_KMEM_ALLOC, kmemtrace_alloc_entry, ignore,
151         TRACE_STRUCT(
152                 TRACE_FIELD(enum kmemtrace_type_id, type_id, type_id)
153                 TRACE_FIELD(unsigned long, call_site, call_site)
154                 TRACE_FIELD(const void *, ptr, ptr)
155                 TRACE_FIELD(size_t, bytes_req, bytes_req)
156                 TRACE_FIELD(size_t, bytes_alloc, bytes_alloc)
157                 TRACE_FIELD(gfp_t, gfp_flags, gfp_flags)
158                 TRACE_FIELD(int, node, node)
159         ),
160         TP_RAW_FMT("type:%u call_site:%lx ptr:%p req:%lu alloc:%lu"
161                  " flags:%x node:%d")
162 );
163
164 TRACE_EVENT_FORMAT(kmem_free, TRACE_KMEM_FREE, kmemtrace_free_entry, ignore,
165         TRACE_STRUCT(
166                 TRACE_FIELD(enum kmemtrace_type_id, type_id, type_id)
167                 TRACE_FIELD(unsigned long, call_site, call_site)
168                 TRACE_FIELD(const void *, ptr, ptr)
169         ),
170         TP_RAW_FMT("type:%u call_site:%lx ptr:%p")
171 );
172
173 #undef TRACE_SYSTEM