diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-03-09 15:47:18 -0400 |
---|---|---|
committer | Steven Rostedt <srostedt@redhat.com> | 2009-03-10 00:35:04 -0400 |
commit | 2939b0469d04ba9ac791aca9a81625d7eb50662b (patch) | |
tree | 573f10c39f34c670fdc6832415642738c5afb3f9 /kernel | |
parent | 156b5f172a64103bcb13b6d26288388b9019caa3 (diff) |
tracing: replace TP<var> with TP_<var>
Impact: clean up
The macros TPPROTO, TPARGS, TPFMT, TPRAWFMT, and TPCMD all look a bit
ugly. This patch adds an underscore to their names.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace_event_types.h | 28 | ||||
-rw-r--r-- | kernel/trace/trace_events_stage_2.h | 6 | ||||
-rw-r--r-- | kernel/trace/trace_events_stage_3.h | 8 | ||||
-rw-r--r-- | kernel/trace/trace_export.c | 8 | ||||
-rw-r--r-- | kernel/trace/trace_format.h | 55 |
5 files changed, 25 insertions, 80 deletions
diff --git a/kernel/trace/trace_event_types.h b/kernel/trace/trace_event_types.h index fb4eba166433..d94179aa1fc2 100644 --- a/kernel/trace/trace_event_types.h +++ b/kernel/trace/trace_event_types.h | |||
@@ -10,7 +10,7 @@ TRACE_EVENT_FORMAT(function, TRACE_FN, ftrace_entry, ignore, | |||
10 | TRACE_FIELD(unsigned long, ip, ip) | 10 | TRACE_FIELD(unsigned long, ip, ip) |
11 | TRACE_FIELD(unsigned long, parent_ip, parent_ip) | 11 | TRACE_FIELD(unsigned long, parent_ip, parent_ip) |
12 | ), | 12 | ), |
13 | TPRAWFMT(" %lx <-- %lx") | 13 | TP_RAW_FMT(" %lx <-- %lx") |
14 | ); | 14 | ); |
15 | 15 | ||
16 | TRACE_EVENT_FORMAT(funcgraph_entry, TRACE_GRAPH_ENT, | 16 | TRACE_EVENT_FORMAT(funcgraph_entry, TRACE_GRAPH_ENT, |
@@ -19,7 +19,7 @@ TRACE_EVENT_FORMAT(funcgraph_entry, TRACE_GRAPH_ENT, | |||
19 | TRACE_FIELD(unsigned long, graph_ent.func, func) | 19 | TRACE_FIELD(unsigned long, graph_ent.func, func) |
20 | TRACE_FIELD(int, graph_ent.depth, depth) | 20 | TRACE_FIELD(int, graph_ent.depth, depth) |
21 | ), | 21 | ), |
22 | TPRAWFMT("--> %lx (%d)") | 22 | TP_RAW_FMT("--> %lx (%d)") |
23 | ); | 23 | ); |
24 | 24 | ||
25 | TRACE_EVENT_FORMAT(funcgraph_exit, TRACE_GRAPH_RET, | 25 | TRACE_EVENT_FORMAT(funcgraph_exit, TRACE_GRAPH_RET, |
@@ -28,7 +28,7 @@ TRACE_EVENT_FORMAT(funcgraph_exit, TRACE_GRAPH_RET, | |||
28 | TRACE_FIELD(unsigned long, ret.func, func) | 28 | TRACE_FIELD(unsigned long, ret.func, func) |
29 | TRACE_FIELD(int, ret.depth, depth) | 29 | TRACE_FIELD(int, ret.depth, depth) |
30 | ), | 30 | ), |
31 | TPRAWFMT("<-- %lx (%d)") | 31 | TP_RAW_FMT("<-- %lx (%d)") |
32 | ); | 32 | ); |
33 | 33 | ||
34 | TRACE_EVENT_FORMAT(wakeup, TRACE_WAKE, ctx_switch_entry, ignore, | 34 | TRACE_EVENT_FORMAT(wakeup, TRACE_WAKE, ctx_switch_entry, ignore, |
@@ -41,7 +41,7 @@ TRACE_EVENT_FORMAT(wakeup, TRACE_WAKE, ctx_switch_entry, ignore, | |||
41 | TRACE_FIELD(unsigned char, next_state, next_state) | 41 | TRACE_FIELD(unsigned char, next_state, next_state) |
42 | TRACE_FIELD(unsigned int, next_cpu, next_cpu) | 42 | TRACE_FIELD(unsigned int, next_cpu, next_cpu) |
43 | ), | 43 | ), |
44 | TPRAWFMT("%u:%u:%u ==+ %u:%u:%u [%03u]") | 44 | TP_RAW_FMT("%u:%u:%u ==+ %u:%u:%u [%03u]") |
45 | ); | 45 | ); |
46 | 46 | ||
47 | TRACE_EVENT_FORMAT(context_switch, TRACE_CTX, ctx_switch_entry, ignore, | 47 | TRACE_EVENT_FORMAT(context_switch, TRACE_CTX, ctx_switch_entry, ignore, |
@@ -54,7 +54,7 @@ TRACE_EVENT_FORMAT(context_switch, TRACE_CTX, ctx_switch_entry, ignore, | |||
54 | TRACE_FIELD(unsigned char, next_state, next_state) | 54 | TRACE_FIELD(unsigned char, next_state, next_state) |
55 | TRACE_FIELD(unsigned int, next_cpu, next_cpu) | 55 | TRACE_FIELD(unsigned int, next_cpu, next_cpu) |
56 | ), | 56 | ), |
57 | TPRAWFMT("%u:%u:%u ==+ %u:%u:%u [%03u]") | 57 | TP_RAW_FMT("%u:%u:%u ==+ %u:%u:%u [%03u]") |
58 | ); | 58 | ); |
59 | 59 | ||
60 | TRACE_EVENT_FORMAT(special, TRACE_SPECIAL, special_entry, ignore, | 60 | TRACE_EVENT_FORMAT(special, TRACE_SPECIAL, special_entry, ignore, |
@@ -63,7 +63,7 @@ TRACE_EVENT_FORMAT(special, TRACE_SPECIAL, special_entry, ignore, | |||
63 | TRACE_FIELD(unsigned long, arg2, arg2) | 63 | TRACE_FIELD(unsigned long, arg2, arg2) |
64 | TRACE_FIELD(unsigned long, arg3, arg3) | 64 | TRACE_FIELD(unsigned long, arg3, arg3) |
65 | ), | 65 | ), |
66 | TPRAWFMT("(%08lx) (%08lx) (%08lx)") | 66 | TP_RAW_FMT("(%08lx) (%08lx) (%08lx)") |
67 | ); | 67 | ); |
68 | 68 | ||
69 | /* | 69 | /* |
@@ -83,7 +83,7 @@ TRACE_EVENT_FORMAT(kernel_stack, TRACE_STACK, stack_entry, ignore, | |||
83 | TRACE_FIELD(unsigned long, caller[6], stack6) | 83 | TRACE_FIELD(unsigned long, caller[6], stack6) |
84 | TRACE_FIELD(unsigned long, caller[7], stack7) | 84 | TRACE_FIELD(unsigned long, caller[7], stack7) |
85 | ), | 85 | ), |
86 | TPRAWFMT("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n" | 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") | 87 | "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n") |
88 | ); | 88 | ); |
89 | 89 | ||
@@ -98,7 +98,7 @@ TRACE_EVENT_FORMAT(user_stack, TRACE_USER_STACK, userstack_entry, ignore, | |||
98 | TRACE_FIELD(unsigned long, caller[6], stack6) | 98 | TRACE_FIELD(unsigned long, caller[6], stack6) |
99 | TRACE_FIELD(unsigned long, caller[7], stack7) | 99 | TRACE_FIELD(unsigned long, caller[7], stack7) |
100 | ), | 100 | ), |
101 | TPRAWFMT("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n" | 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") | 102 | "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n") |
103 | ); | 103 | ); |
104 | 104 | ||
@@ -108,7 +108,7 @@ TRACE_EVENT_FORMAT(print, TRACE_PRINT, print_entry, ignore, | |||
108 | TRACE_FIELD(unsigned int, depth, depth) | 108 | TRACE_FIELD(unsigned int, depth, depth) |
109 | TRACE_FIELD_ZERO_CHAR(buf) | 109 | TRACE_FIELD_ZERO_CHAR(buf) |
110 | ), | 110 | ), |
111 | TPRAWFMT("%08lx (%d) %s") | 111 | TP_RAW_FMT("%08lx (%d) %s") |
112 | ); | 112 | ); |
113 | 113 | ||
114 | TRACE_EVENT_FORMAT(branch, TRACE_BRANCH, trace_branch, ignore, | 114 | TRACE_EVENT_FORMAT(branch, TRACE_BRANCH, trace_branch, ignore, |
@@ -118,7 +118,7 @@ TRACE_EVENT_FORMAT(branch, TRACE_BRANCH, trace_branch, ignore, | |||
118 | TRACE_FIELD_SPECIAL(char file[TRACE_FUNC_SIZE+1], file, file) | 118 | TRACE_FIELD_SPECIAL(char file[TRACE_FUNC_SIZE+1], file, file) |
119 | TRACE_FIELD(char, correct, correct) | 119 | TRACE_FIELD(char, correct, correct) |
120 | ), | 120 | ), |
121 | TPRAWFMT("%u:%s:%s (%u)") | 121 | TP_RAW_FMT("%u:%s:%s (%u)") |
122 | ); | 122 | ); |
123 | 123 | ||
124 | TRACE_EVENT_FORMAT(hw_branch, TRACE_HW_BRANCHES, hw_branch_entry, ignore, | 124 | TRACE_EVENT_FORMAT(hw_branch, TRACE_HW_BRANCHES, hw_branch_entry, ignore, |
@@ -126,7 +126,7 @@ TRACE_EVENT_FORMAT(hw_branch, TRACE_HW_BRANCHES, hw_branch_entry, ignore, | |||
126 | TRACE_FIELD(u64, from, from) | 126 | TRACE_FIELD(u64, from, from) |
127 | TRACE_FIELD(u64, to, to) | 127 | TRACE_FIELD(u64, to, to) |
128 | ), | 128 | ), |
129 | TPRAWFMT("from: %llx to: %llx") | 129 | TP_RAW_FMT("from: %llx to: %llx") |
130 | ); | 130 | ); |
131 | 131 | ||
132 | TRACE_EVENT_FORMAT(power, TRACE_POWER, trace_power, ignore, | 132 | TRACE_EVENT_FORMAT(power, TRACE_POWER, trace_power, ignore, |
@@ -136,7 +136,7 @@ TRACE_EVENT_FORMAT(power, TRACE_POWER, trace_power, ignore, | |||
136 | TRACE_FIELD(int, state_data.type, type) | 136 | TRACE_FIELD(int, state_data.type, type) |
137 | TRACE_FIELD(int, state_data.state, state) | 137 | TRACE_FIELD(int, state_data.state, state) |
138 | ), | 138 | ), |
139 | TPRAWFMT("%llx->%llx type:%u state:%u") | 139 | TP_RAW_FMT("%llx->%llx type:%u state:%u") |
140 | ); | 140 | ); |
141 | 141 | ||
142 | TRACE_EVENT_FORMAT(kmem_alloc, TRACE_KMEM_ALLOC, kmemtrace_alloc_entry, ignore, | 142 | TRACE_EVENT_FORMAT(kmem_alloc, TRACE_KMEM_ALLOC, kmemtrace_alloc_entry, ignore, |
@@ -149,7 +149,7 @@ TRACE_EVENT_FORMAT(kmem_alloc, TRACE_KMEM_ALLOC, kmemtrace_alloc_entry, ignore, | |||
149 | TRACE_FIELD(gfp_t, gfp_flags, gfp_flags) | 149 | TRACE_FIELD(gfp_t, gfp_flags, gfp_flags) |
150 | TRACE_FIELD(int, node, node) | 150 | TRACE_FIELD(int, node, node) |
151 | ), | 151 | ), |
152 | TPRAWFMT("type:%u call_site:%lx ptr:%p req:%lu alloc:%lu" | 152 | TP_RAW_FMT("type:%u call_site:%lx ptr:%p req:%lu alloc:%lu" |
153 | " flags:%x node:%d") | 153 | " flags:%x node:%d") |
154 | ); | 154 | ); |
155 | 155 | ||
@@ -159,7 +159,7 @@ TRACE_EVENT_FORMAT(kmem_free, TRACE_KMEM_FREE, kmemtrace_free_entry, ignore, | |||
159 | TRACE_FIELD(unsigned long, call_site, call_site) | 159 | TRACE_FIELD(unsigned long, call_site, call_site) |
160 | TRACE_FIELD(const void *, ptr, ptr) | 160 | TRACE_FIELD(const void *, ptr, ptr) |
161 | ), | 161 | ), |
162 | TPRAWFMT("type:%u call_site:%lx ptr:%p") | 162 | TP_RAW_FMT("type:%u call_site:%lx ptr:%p") |
163 | ); | 163 | ); |
164 | 164 | ||
165 | #undef TRACE_SYSTEM | 165 | #undef TRACE_SYSTEM |
diff --git a/kernel/trace/trace_events_stage_2.h b/kernel/trace/trace_events_stage_2.h index d24a97e74aea..8e2e0f56c2a8 100644 --- a/kernel/trace/trace_events_stage_2.h +++ b/kernel/trace/trace_events_stage_2.h | |||
@@ -20,7 +20,7 @@ | |||
20 | * | 20 | * |
21 | * field = (typeof(field))entry; | 21 | * field = (typeof(field))entry; |
22 | * | 22 | * |
23 | * ret = trace_seq_printf(s, <TPRAWFMT> "%s", <ARGS> "\n"); | 23 | * ret = trace_seq_printf(s, <TP_RAW_FMT> "%s", <ARGS> "\n"); |
24 | * if (!ret) | 24 | * if (!ret) |
25 | * return TRACE_TYPE_PARTIAL_LINE; | 25 | * return TRACE_TYPE_PARTIAL_LINE; |
26 | * | 26 | * |
@@ -44,8 +44,8 @@ | |||
44 | field->item, | 44 | field->item, |
45 | 45 | ||
46 | 46 | ||
47 | #undef TPRAWFMT | 47 | #undef TP_RAW_FMT |
48 | #define TPRAWFMT(args...) args | 48 | #define TP_RAW_FMT(args...) args |
49 | 49 | ||
50 | #undef TRACE_EVENT_FORMAT | 50 | #undef TRACE_EVENT_FORMAT |
51 | #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \ | 51 | #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \ |
diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h index 2c8d76c7dbed..557ca52bcdcd 100644 --- a/kernel/trace/trace_events_stage_3.h +++ b/kernel/trace/trace_events_stage_3.h | |||
@@ -106,8 +106,8 @@ | |||
106 | * | 106 | * |
107 | */ | 107 | */ |
108 | 108 | ||
109 | #undef TPFMT | 109 | #undef TP_FMT |
110 | #define TPFMT(fmt, args...) fmt "\n", ##args | 110 | #define TP_FMT(fmt, args...) fmt "\n", ##args |
111 | 111 | ||
112 | #define _TRACE_FORMAT(call, proto, args, fmt) \ | 112 | #define _TRACE_FORMAT(call, proto, args, fmt) \ |
113 | static void ftrace_event_##call(proto) \ | 113 | static void ftrace_event_##call(proto) \ |
@@ -152,8 +152,8 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
152 | #define TRACE_FIELD(type, item, assign)\ | 152 | #define TRACE_FIELD(type, item, assign)\ |
153 | entry->item = assign; | 153 | entry->item = assign; |
154 | 154 | ||
155 | #undef TPCMD | 155 | #undef TP_CMD |
156 | #define TPCMD(cmd...) cmd | 156 | #define TP_CMD(cmd...) cmd |
157 | 157 | ||
158 | #undef TRACE_ENTRY | 158 | #undef TRACE_ENTRY |
159 | #define TRACE_ENTRY entry | 159 | #define TRACE_ENTRY entry |
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index 7162ab49d05d..e62bc10f8103 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c | |||
@@ -26,8 +26,8 @@ | |||
26 | return 0; | 26 | return 0; |
27 | 27 | ||
28 | 28 | ||
29 | #undef TPRAWFMT | 29 | #undef TP_RAW_FMT |
30 | #define TPRAWFMT(args...) args | 30 | #define TP_RAW_FMT(args...) args |
31 | 31 | ||
32 | #undef TRACE_EVENT_FORMAT | 32 | #undef TRACE_EVENT_FORMAT |
33 | #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \ | 33 | #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \ |
@@ -57,8 +57,8 @@ ftrace_format_##call(struct trace_seq *s) \ | |||
57 | #define TRACE_FIELD(type, item, assign)\ | 57 | #define TRACE_FIELD(type, item, assign)\ |
58 | entry->item = assign; | 58 | entry->item = assign; |
59 | 59 | ||
60 | #undef TPCMD | 60 | #undef TP_CMD |
61 | #define TPCMD(cmd...) cmd | 61 | #define TP_CMD(cmd...) cmd |
62 | 62 | ||
63 | #undef TRACE_ENTRY | 63 | #undef TRACE_ENTRY |
64 | #define TRACE_ENTRY entry | 64 | #define TRACE_ENTRY entry |
diff --git a/kernel/trace/trace_format.h b/kernel/trace/trace_format.h deleted file mode 100644 index 97e59a9c82ea..000000000000 --- a/kernel/trace/trace_format.h +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /* | ||
2 | * Setup the showing format of trace point. | ||
3 | * | ||
4 | * int | ||
5 | * ftrace_format_##call(struct trace_seq *s) | ||
6 | * { | ||
7 | * struct ftrace_raw_##call field; | ||
8 | * int ret; | ||
9 | * | ||
10 | * ret = trace_seq_printf(s, #type " " #item ";" | ||
11 | * " size:%d; offset:%d;\n", | ||
12 | * sizeof(field.type), | ||
13 | * offsetof(struct ftrace_raw_##call, | ||
14 | * item)); | ||
15 | * | ||
16 | * } | ||
17 | */ | ||
18 | |||
19 | #undef TRACE_STRUCT | ||
20 | #define TRACE_STRUCT(args...) args | ||
21 | |||
22 | #undef TRACE_FIELD | ||
23 | #define TRACE_FIELD(type, item, assign) \ | ||
24 | ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ | ||
25 | "offset:%u;\tsize:%u;\n", \ | ||
26 | (unsigned int)offsetof(typeof(field), item), \ | ||
27 | (unsigned int)sizeof(field.item)); \ | ||
28 | if (!ret) \ | ||
29 | return 0; | ||
30 | |||
31 | |||
32 | #undef TRACE_FIELD_SPECIAL | ||
33 | #define TRACE_FIELD_SPECIAL(type_item, item, cmd) \ | ||
34 | ret = trace_seq_printf(s, "\tfield special:" #type_item ";\t" \ | ||
35 | "offset:%u;\tsize:%u;\n", \ | ||
36 | (unsigned int)offsetof(typeof(field), item), \ | ||
37 | (unsigned int)sizeof(field.item)); \ | ||
38 | if (!ret) \ | ||
39 | return 0; | ||
40 | |||
41 | #undef TRACE_EVENT_FORMAT | ||
42 | #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \ | ||
43 | static int \ | ||
44 | ftrace_format_##call(struct trace_seq *s) \ | ||
45 | { \ | ||
46 | struct ftrace_raw_##call field; \ | ||
47 | int ret; \ | ||
48 | \ | ||
49 | tstruct; \ | ||
50 | \ | ||
51 | trace_seq_printf(s, "\nprint fmt: \"%s\"\n", tpfmt); \ | ||
52 | \ | ||
53 | return ret; \ | ||
54 | } | ||
55 | |||