From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933484AbcBYTAw (ORCPT ); Thu, 25 Feb 2016 14:00:52 -0500 Received: from smtprelay0126.hostedemail.com ([216.40.44.126]:54110 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933351AbcBYTAv (ORCPT ); Thu, 25 Feb 2016 14:00:51 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::,RULES_HIT:41:69:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1434:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3872:3874:4321:5007:6261:7514:7875:7903:10004:10400:10450:10455:10848:10967:11026:11232:11658:11914:12043:12438:12517:12519:12555:12740:13069:13138:13231:13311:13357:14659:19904:19999:21080:21212:30029:30054:30070: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:2,LUA_SUMMARY:none X-HE-Tag: light98_7b867bf314c55 X-Filterd-Recvd-Size: 2929 Date: Thu, 25 Feb 2016 14:00:47 -0500 From: Steven Rostedt To: Taeung Song Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Jiri Olsa , Namhyung Kim , linux-kernel@vger.kernel.org, Thomas Gleixner , Lai Jiangshan Subject: Re: [PATCH v2 1/3] tracing/syscalls: Rename variable 'nr' to 'syscall_nr' Message-ID: <20160225140047.68a145e4@gandalf.local.home> In-Reply-To: <56CF4877.8000107@gmail.com> References: <1456421937-16840-1-git-send-email-treeze.taeung@gmail.com> <20160225175710.GP8720@kernel.org> <56CF4877.8000107@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 On Fri, 26 Feb 2016 03:31:19 +0900 Taeung Song wrote: > > OK, I will test it. > But IMHO, I think the bottom change has a problem. > Because sys_enter_io_getevent() has a argument 'long nr'. > So this if statement must not have strcmp(sc->args->name, "nr") == 0. > > + if (sc->args && strcmp(sc->args->name, "syscall_nr") == 0) { > > I think the above instance seem better than the bottom. > > + if (sc->args && (strcmp(sc->args->name, "syscall_nr") || > strcmp(sc->args->name, "nr")) == 0) { > > But I'll test again with perf-trace. > And then will say the result. But doesn't this break new perf running on older kernels? We can't have that either. > > > > > diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c > > index 20916dd77aac..b31eed102a83 100644 > > --- a/tools/perf/builtin-trace.c > > +++ b/tools/perf/builtin-trace.c > > @@ -1724,8 +1724,8 @@ static int trace__read_syscall_info(struct trace *trace, int id) > > > > sc->args = sc->tp_format->format.fields; > > sc->nr_args = sc->tp_format->format.nr_fields; > > - /* drop nr field - not relevant here; does not exist on older kernels */ > > - if (sc->args && strcmp(sc->args->name, "nr") == 0) { > > + /* drop (syscall_)?nr field - not relevant here; does not exist on older kernels */ > > + if (sc->args && (strcmp(sc->args->name, "syscall_nr") || strcmp(sc->args->name, "nr")) == 0) { > > sc->args = sc->args->next; > > --sc->nr_args; > > } > > > > > > ---------------------- > > > > But then I wonder if it wouldn't be better to prefix this with double > > underscores, making it "__syscall_nr" :-\ > > > > I so agree. Low probability but the name 'syscall_nr' may also > have similar problems. I honestly doubt it. -- Steve