Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751099AbcCHTYp (ORCPT ); Tue, 8 Mar 2016 14:24:45 -0500 Received: from smtprelay0070.hostedemail.com ([216.40.44.70]:45713 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750747AbcCHTYi (ORCPT ); Tue, 8 Mar 2016 14:24:38 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1434:1437:1515:1516:1518:1535:1544:1593:1594:1605:1711:1730:1747:1777:1792:1801:2393:2553:2559:2562:3138:3139:3140:3141:3142:3622:3865:3866:3867:3868:3870:3871:3872:4321:4605:5007:6261:7514:7875:8603:8660:8957:9163:10004:10848:10967:11026:11232:11658:11914:12043:12296:12438:12517:12519:12555:12740:13138:13148:13230:13231:13255:13439:14096:14097:14659:14721:21080:21212:30029:30034:30054:30080:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:5,LUA_SUMMARY:none X-HE-Tag: pin18_b01c2ebd2915 X-Filterd-Recvd-Size: 5784 Date: Tue, 8 Mar 2016 14:24:34 -0500 From: Steven Rostedt To: Taeung Song Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Jiri Olsa , Namhyung Kim , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Lai Jiangshan Subject: Re: [RFC][PATCH v4 1/2] tracing/syscalls: Rename a field 'nr' to '__syscall_nr' in format Message-ID: <20160308142434.4cabfc74@gandalf.local.home> In-Reply-To: <1456591311-10915-1-git-send-email-treeze.taeung@gmail.com> References: <1456591311-10915-1-git-send-email-treeze.taeung@gmail.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4523 Lines: 108 On Sun, 28 Feb 2016 01:41:51 +0900 Taeung Song wrote: Have we decided what we are going to do with this patch? Pull it as is and see what the fall out is? Was there a perf patch with this too? -- Steve > Some syscalls tracepoint duplicated fields with the same name 'nr' i.e. > > # cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_io_getevents/format > name: sys_enter_io_getevents > ID: 739 > 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)) > > As above 'int nr;' and 'long nr;' fields have > duplicated name so problems are occurred in perf-script i.e. > > # perf record -e syscalls:* > # perf script -g python > # perf script -s perf-script.py > File "perf-script.py", line 8694 > def syscalls__sys_enter_io_getevents(event_name, context, common_cpu, > SyntaxError: duplicate argument 'nr' in function definition > Error running python script perf-script.py > > As above, problems about duplicated argument occurred. > Not only sys_enter_io_getevent() but also sys_enter_io_submit() > have relevevance to this problem. > > So rename a field 'nr' to '__syscall_nr' for system call number > without renaming a member 'nr' of two structures 'syscall_trace_enter' > and 'syscall_trace_exit'. > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Arnaldo Carvalho de Melo > Cc: Lai Jiangshan > Signed-off-by: Taeung Song > Signed-off-by: Steven Rostedt > --- > kernel/trace/trace_syscalls.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c > index 0655afb..d166308 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, > > extern char *__bad_type_size(void); > > -#define SYSCALL_FIELD(type, name) \ > - sizeof(type) != sizeof(trace.name) ? \ > +#define SYSCALL_FIELD(type, field, name) \ > + sizeof(type) != sizeof(trace.field) ? \ > __bad_type_size() : \ > - #type, #name, offsetof(typeof(trace), name), \ > - sizeof(trace.name), is_signed_type(type) > + #type, #name, offsetof(typeof(trace), field), \ > + sizeof(trace.field), is_signed_type(type) > > static int __init > __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) > int i; > 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) > return ret; > > @@ -281,11 +282,12 @@ static int __init syscall_exit_define_fields(struct trace_event_call *call) > struct syscall_trace_exit trace; > 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) > return ret; > > - ret = trace_define_field(call, SYSCALL_FIELD(long, ret), > + ret = trace_define_field(call, SYSCALL_FIELD(long, ret, ret), > FILTER_OTHER); > > return ret;