diff options
-rw-r--r-- | kernel/trace/trace.h | 9 | ||||
-rw-r--r-- | kernel/trace/trace_entries.h | 64 |
2 files changed, 66 insertions, 7 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index d308195d40aa..b0d287d49a6d 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -53,9 +53,18 @@ extern struct tracer boot_tracer; | |||
53 | #undef __field | 53 | #undef __field |
54 | #define __field(type, item) type item; | 54 | #define __field(type, item) type item; |
55 | 55 | ||
56 | #undef __field_struct | ||
57 | #define __field_struct(type, item) __field(type, item) | ||
58 | |||
59 | #undef __field_desc | ||
60 | #define __field_desc(type, container, item) | ||
61 | |||
56 | #undef __array | 62 | #undef __array |
57 | #define __array(type, item, size) type item[size]; | 63 | #define __array(type, item, size) type item[size]; |
58 | 64 | ||
65 | #undef __array_desc | ||
66 | #define __array_desc(type, container, item, size) | ||
67 | |||
59 | #undef __dynamic_array | 68 | #undef __dynamic_array |
60 | #define __dynamic_array(type, item) type item[]; | 69 | #define __dynamic_array(type, item) type item[]; |
61 | 70 | ||
diff --git a/kernel/trace/trace_entries.h b/kernel/trace/trace_entries.h index 82c51fdca035..c866d34e0144 100644 --- a/kernel/trace/trace_entries.h +++ b/kernel/trace/trace_entries.h | |||
@@ -26,6 +26,29 @@ | |||
26 | * type item[size]; | 26 | * type item[size]; |
27 | * in the structure. | 27 | * in the structure. |
28 | * | 28 | * |
29 | * * for structures within structures, the format of the internal | ||
30 | * structure is layed out. This allows the internal structure | ||
31 | * to be deciphered for the format file. Although these macros | ||
32 | * may become out of sync with the internal structure, they | ||
33 | * will create a compile error if it happens. Since the | ||
34 | * internel structures are just tracing helpers, this is not | ||
35 | * an issue. | ||
36 | * | ||
37 | * When an internal structure is used, it should use: | ||
38 | * | ||
39 | * __field_struct( type, item ) | ||
40 | * | ||
41 | * instead of __field. This will prevent it from being shown in | ||
42 | * the output file. The fields in the structure should use. | ||
43 | * | ||
44 | * __field_desc( type, container, item ) | ||
45 | * __array_desc( type, container, item, len ) | ||
46 | * | ||
47 | * type, item and len are the same as __field and __array, but | ||
48 | * container is added. This is the name of the item in | ||
49 | * __field_struct that this is describing. | ||
50 | * | ||
51 | * | ||
29 | * @print: the print format shown to users in the format file. | 52 | * @print: the print format shown to users in the format file. |
30 | */ | 53 | */ |
31 | 54 | ||
@@ -50,7 +73,9 @@ FTRACE_ENTRY(funcgraph_entry, ftrace_graph_ent_entry, | |||
50 | TRACE_GRAPH_ENT, | 73 | TRACE_GRAPH_ENT, |
51 | 74 | ||
52 | F_STRUCT( | 75 | F_STRUCT( |
53 | __field( struct ftrace_graph_ent, graph_ent ) | 76 | __field_struct( struct ftrace_graph_ent, graph_ent ) |
77 | __field_desc( unsigned long, graph_ent, func ) | ||
78 | __field_desc( int, graph_ent, depth ) | ||
54 | ), | 79 | ), |
55 | 80 | ||
56 | F_printk("--> %lx (%d)", __entry->graph_ent.func, __entry->depth) | 81 | F_printk("--> %lx (%d)", __entry->graph_ent.func, __entry->depth) |
@@ -62,7 +87,12 @@ FTRACE_ENTRY(funcgraph_exit, ftrace_graph_ret_entry, | |||
62 | TRACE_GRAPH_RET, | 87 | TRACE_GRAPH_RET, |
63 | 88 | ||
64 | F_STRUCT( | 89 | F_STRUCT( |
65 | __field( struct ftrace_graph_ret, ret ) | 90 | __field_struct( struct ftrace_graph_ret, ret ) |
91 | __field_desc( unsigned long, ret, func ) | ||
92 | __field_desc( unsigned long long, ret, calltime) | ||
93 | __field_desc( unsigned long long, ret, rettime ) | ||
94 | __field_desc( unsigned long, ret, overrun ) | ||
95 | __field_desc( int, ret, depth ) | ||
66 | ), | 96 | ), |
67 | 97 | ||
68 | F_printk("<-- %lx (%d) (start: %llx end: %llx) over: %d", | 98 | F_printk("<-- %lx (%d) (start: %llx end: %llx) over: %d", |
@@ -218,7 +248,13 @@ FTRACE_ENTRY(mmiotrace_rw, trace_mmiotrace_rw, | |||
218 | TRACE_MMIO_RW, | 248 | TRACE_MMIO_RW, |
219 | 249 | ||
220 | F_STRUCT( | 250 | F_STRUCT( |
221 | __field( struct mmiotrace_rw, rw ) | 251 | __field_struct( struct mmiotrace_rw, rw ) |
252 | __field_desc( resource_size_t, rw, phys ) | ||
253 | __field_desc( unsigned long, rw, value ) | ||
254 | __field_desc( unsigned long, rw, pc ) | ||
255 | __field_desc( int, rw, map_id ) | ||
256 | __field_desc( unsigned char, rw, opcode ) | ||
257 | __field_desc( unsigned char, rw, width ) | ||
222 | ), | 258 | ), |
223 | 259 | ||
224 | F_printk("%lx %lx %lx %d %lx %lx", | 260 | F_printk("%lx %lx %lx %d %lx %lx", |
@@ -231,7 +267,12 @@ FTRACE_ENTRY(mmiotrace_map, trace_mmiotrace_map, | |||
231 | TRACE_MMIO_MAP, | 267 | TRACE_MMIO_MAP, |
232 | 268 | ||
233 | F_STRUCT( | 269 | F_STRUCT( |
234 | __field( struct mmiotrace_map, map ) | 270 | __field_struct( struct mmiotrace_map, map ) |
271 | __field_desc( resource_size_t, map, phys ) | ||
272 | __field_desc( unsigned long, map, virt ) | ||
273 | __field_desc( unsigned long, map, len ) | ||
274 | __field_desc( int, map, map_id ) | ||
275 | __field_desc( unsigned char, map, opcode ) | ||
235 | ), | 276 | ), |
236 | 277 | ||
237 | F_printk("%lx %lx %lx %d %lx", | 278 | F_printk("%lx %lx %lx %d %lx", |
@@ -244,7 +285,9 @@ FTRACE_ENTRY(boot_call, trace_boot_call, | |||
244 | TRACE_BOOT_CALL, | 285 | TRACE_BOOT_CALL, |
245 | 286 | ||
246 | F_STRUCT( | 287 | F_STRUCT( |
247 | __field( struct boot_trace_call, boot_call ) | 288 | __field_struct( struct boot_trace_call, boot_call ) |
289 | __field_desc( pid_t, boot_call, caller ) | ||
290 | __array_desc( char, boot_call, func, KSYM_SYMBOL_LEN) | ||
248 | ), | 291 | ), |
249 | 292 | ||
250 | F_printk("%d %s", __entry->caller, __entry->func) | 293 | F_printk("%d %s", __entry->caller, __entry->func) |
@@ -255,7 +298,10 @@ FTRACE_ENTRY(boot_ret, trace_boot_ret, | |||
255 | TRACE_BOOT_RET, | 298 | TRACE_BOOT_RET, |
256 | 299 | ||
257 | F_STRUCT( | 300 | F_STRUCT( |
258 | __field( struct boot_trace_ret, boot_ret ) | 301 | __field_struct( struct boot_trace_ret, boot_ret ) |
302 | __array_desc( char, boot_ret, func, KSYM_SYMBOL_LEN) | ||
303 | __field_desc( int, boot_ret, result ) | ||
304 | __field_desc( unsigned long, boot_ret, duration ) | ||
259 | ), | 305 | ), |
260 | 306 | ||
261 | F_printk("%s %d %lx", | 307 | F_printk("%s %d %lx", |
@@ -298,7 +344,11 @@ FTRACE_ENTRY(power, trace_power, | |||
298 | TRACE_POWER, | 344 | TRACE_POWER, |
299 | 345 | ||
300 | F_STRUCT( | 346 | F_STRUCT( |
301 | __field( struct power_trace, state_data ) | 347 | __field_struct( struct power_trace, state_data ) |
348 | __field_desc( s64, state_data, stamp ) | ||
349 | __field_desc( s64, state_data, end ) | ||
350 | __field_desc( int, state_data, type ) | ||
351 | __field_desc( int, state_data, state ) | ||
302 | ), | 352 | ), |
303 | 353 | ||
304 | F_printk("%llx->%llx type:%u state:%u", | 354 | F_printk("%llx->%llx type:%u state:%u", |