Commit 026842d1 authored by Taeung Song's avatar Taeung Song Committed by Arnaldo Carvalho de Melo

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: default avatarTaeung Song <treeze.taeung@gmail.com>
[ Do not rename the struct member, just the '/format' field name ]
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Acked-by: default avatarPeter 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.homeSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c42de706
...@@ -186,11 +186,11 @@ print_syscall_exit(struct trace_iterator *iter, int flags, ...@@ -186,11 +186,11 @@ print_syscall_exit(struct trace_iterator *iter, int flags,
extern char *__bad_type_size(void); extern char *__bad_type_size(void);
#define SYSCALL_FIELD(type, name) \ #define SYSCALL_FIELD(type, field, name) \
sizeof(type) != sizeof(trace.name) ? \ sizeof(type) != sizeof(trace.field) ? \
__bad_type_size() : \ __bad_type_size() : \
#type, #name, offsetof(typeof(trace), name), \ #type, #name, offsetof(typeof(trace), field), \
sizeof(trace.name), is_signed_type(type) sizeof(trace.field), is_signed_type(type)
static int __init static int __init
__set_enter_print_fmt(struct syscall_metadata *entry, char *buf, int len) __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,7 +261,8 @@ static int __init syscall_enter_define_fields(struct trace_event_call *call)
int i; int i;
int offset = offsetof(typeof(trace), args); int offset = offsetof(typeof(trace), args);
ret = trace_define_field(call, SYSCALL_FIELD(int, nr), FILTER_OTHER); ret = trace_define_field(call, SYSCALL_FIELD(int, nr, __syscall_nr),
FILTER_OTHER);
if (ret) if (ret)
return ret; return ret;
...@@ -281,11 +282,12 @@ static int __init syscall_exit_define_fields(struct trace_event_call *call) ...@@ -281,11 +282,12 @@ static int __init syscall_exit_define_fields(struct trace_event_call *call)
struct syscall_trace_exit trace; struct syscall_trace_exit trace;
int ret; int ret;
ret = trace_define_field(call, SYSCALL_FIELD(int, nr), FILTER_OTHER); ret = trace_define_field(call, SYSCALL_FIELD(int, nr, __syscall_nr),
FILTER_OTHER);
if (ret) if (ret)
return ret; return ret;
ret = trace_define_field(call, SYSCALL_FIELD(long, ret), ret = trace_define_field(call, SYSCALL_FIELD(long, ret, ret),
FILTER_OTHER); FILTER_OTHER);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment