Skip to content

Commit d93f12f

Browse files
Masami Hiramatsufweisbec
authored andcommitted
tracing: Introduce TRACE_FIELD_ZERO() macro
Use TRACE_FIELD_ZERO(type, item) instead of TRACE_FIELD_ZERO_CHAR(item). This also includes a typo fix of TRACE_ZERO_CHAR() macro. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Ananth N Mavinakayanahalli <[email protected]> Cc: Avi Kivity <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Frank Ch. Eigler <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jason Baron <[email protected]> Cc: Jim Keniston <[email protected]> Cc: K.Prasad <[email protected]> Cc: Lai Jiangshan <[email protected]> Cc: Li Zefan <[email protected]> Cc: Przemysław Pawełczyk <[email protected]> Cc: Roland McGrath <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Srikar Dronamraju <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Tom Zanussi <[email protected]> Cc: Vegard Nossum <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
1 parent bd1a5c8 commit d93f12f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

kernel/trace/trace_event_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ TRACE_EVENT_FORMAT(bprint, TRACE_BPRINT, bprint_entry, ignore,
109109
TRACE_STRUCT(
110110
TRACE_FIELD(unsigned long, ip, ip)
111111
TRACE_FIELD(char *, fmt, fmt)
112-
TRACE_FIELD_ZERO_CHAR(buf)
112+
TRACE_FIELD_ZERO(char, buf)
113113
),
114114
TP_RAW_FMT("%08lx (%d) fmt:%p %s")
115115
);
116116

117117
TRACE_EVENT_FORMAT(print, TRACE_PRINT, print_entry, ignore,
118118
TRACE_STRUCT(
119119
TRACE_FIELD(unsigned long, ip, ip)
120-
TRACE_FIELD_ZERO_CHAR(buf)
120+
TRACE_FIELD_ZERO(char, buf)
121121
),
122122
TP_RAW_FMT("%08lx (%d) fmt:%p %s")
123123
);

kernel/trace/trace_export.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ extern void __bad_type_size(void);
4242
if (!ret) \
4343
return 0;
4444

45-
#undef TRACE_FIELD_ZERO_CHAR
46-
#define TRACE_FIELD_ZERO_CHAR(item) \
47-
ret = trace_seq_printf(s, "\tfield:char " #item ";\t" \
45+
#undef TRACE_FIELD_ZERO
46+
#define TRACE_FIELD_ZERO(type, item) \
47+
ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
4848
"offset:%u;\tsize:0;\n", \
4949
(unsigned int)offsetof(typeof(field), item)); \
5050
if (!ret) \
@@ -92,9 +92,6 @@ ftrace_format_##call(struct ftrace_event_call *unused, \
9292

9393
#include "trace_event_types.h"
9494

95-
#undef TRACE_ZERO_CHAR
96-
#define TRACE_ZERO_CHAR(arg)
97-
9895
#undef TRACE_FIELD
9996
#define TRACE_FIELD(type, item, assign)\
10097
entry->item = assign;
@@ -107,6 +104,9 @@ ftrace_format_##call(struct ftrace_event_call *unused, \
107104
#define TRACE_FIELD_SIGN(type, item, assign, is_signed) \
108105
TRACE_FIELD(type, item, assign)
109106

107+
#undef TRACE_FIELD_ZERO
108+
#define TRACE_FIELD_ZERO(type, item)
109+
110110
#undef TP_CMD
111111
#define TP_CMD(cmd...) cmd
112112

@@ -180,8 +180,8 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
180180
if (ret) \
181181
return ret;
182182

183-
#undef TRACE_FIELD_ZERO_CHAR
184-
#define TRACE_FIELD_ZERO_CHAR(item)
183+
#undef TRACE_FIELD_ZERO
184+
#define TRACE_FIELD_ZERO(type, item)
185185

186186
#undef TRACE_EVENT_FORMAT
187187
#define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \

0 commit comments

Comments
 (0)