aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaeung Song <treeze.taeung@gmail.com>2016-02-26 13:23:01 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-02-29 09:34:53 -0500
commit026842d148b920dc28f0499ede4950dcb098d4d5 (patch)
tree965121dc56e2a6f72b1e2d4696f623e38412b95a
parentc42de706dad3f39c1f65e473a1d165ea33f8b6e8 (diff)
tracing/syscalls: Rename "/format" tracepoint field name "nr" to "__syscall_nr:
Some tracepoint have multiple fields with the same name, "nr", the first one is a unique syscall ID, the other is a syscall argument: # cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_io_getevents/format name: sys_enter_io_getevents ID: 747 format: field:unsigned short common_type; offset:0; size:2; signed:0; field:unsigned char common_flags; offset:2; size:1; signed:0; field:unsigned char common_preempt_count; offset:3; size:1; signed:0; field:int common_pid; offset:4; size:4; signed:1; field:int nr; offset:8; size:4; signed:1; field:aio_context_t ctx_id; offset:16; size:8; signed:0; field:long min_nr; offset:24; size:8; signed:0; field:long nr; offset:32; size:8; signed:0; field:struct io_event * events; offset:40; size:8; signed:0; field:struct timespec * timeout; offset:48; size:8; signed:0; print fmt: "ctx_id: 0x%08lx, min_nr: 0x%08lx, nr: 0x%08lx, events: 0x%08lx, timeout: 0x%08lx", ((unsigned long)(REC->ctx_id)), ((unsigned long)(REC->min_nr)), ((unsigned long)(REC->nr)), ((unsigned long)(REC->events)), ((unsigned long)(REC->timeout)) # Fix it by renaming the "/format" common tracepoint field "nr" to "__syscall_nr". Signed-off-by: Taeung Song <treeze.taeung@gmail.com> [ Do not rename the struct member, just the '/format' field name ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Peter Zijlstra <peterz@infradead.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Lai Jiangshan <jiangshanlai@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20160226132301.3ae065a4@gandalf.local.home Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--kernel/trace/trace_syscalls.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 0655afbea83f..d1663083d903 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -186,11 +186,11 @@ print_syscall_exit(struct trace_iterator *iter, int flags,
186 186
187extern char *__bad_type_size(void); 187extern char *__bad_type_size(void);
188 188
189#define SYSCALL_FIELD(type, name) \ 189#define SYSCALL_FIELD(type, field, name) \
190 sizeof(type) != sizeof(trace.name) ? \ 190 sizeof(type) != sizeof(trace.field) ? \
191 __bad_type_size() : \ 191 __bad_type_size() : \
192 #type, #name, offsetof(typeof(trace), name), \ 192 #type, #name, offsetof(typeof(trace), field), \
193 sizeof(trace.name), is_signed_type(type) 193 sizeof(trace.field), is_signed_type(type)
194 194
195static int __init 195static int __init
196__set_enter_print_fmt(struct syscall_metadata *entry, char *buf, int len) 196__set_enter_print_fmt(struct syscall_metadata *entry, char *buf, int len)
@@ -261,7 +261,8 @@ static int __init syscall_enter_define_fields(struct trace_event_call *call)
261 int i; 261 int i;
262 int offset = offsetof(typeof(trace), args); 262 int offset = offsetof(typeof(trace), args);
263 263
264 ret = trace_define_field(call, SYSCALL_FIELD(int, nr), FILTER_OTHER); 264 ret = trace_define_field(call, SYSCALL_FIELD(int, nr, __syscall_nr),
265 FILTER_OTHER);
265 if (ret) 266 if (ret)
266 return ret; 267 return ret;
267 268
@@ -281,11 +282,12 @@ static int __init syscall_exit_define_fields(struct trace_event_call *call)
281 struct syscall_trace_exit trace; 282 struct syscall_trace_exit trace;
282 int ret; 283 int ret;
283 284
284 ret = trace_define_field(call, SYSCALL_FIELD(int, nr), FILTER_OTHER); 285 ret = trace_define_field(call, SYSCALL_FIELD(int, nr, __syscall_nr),
286 FILTER_OTHER);
285 if (ret) 287 if (ret)
286 return ret; 288 return ret;
287 289
288 ret = trace_define_field(call, SYSCALL_FIELD(long, ret), 290 ret = trace_define_field(call, SYSCALL_FIELD(long, ret, ret),
289 FILTER_OTHER); 291 FILTER_OTHER);
290 292
291 return ret; 293 return ret;