Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1343409

Re: [PATCH v2 1/3] tracing/syscalls: Rename variable 'nr' to 'syscall_nr'

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/3] tracing/syscalls: Rename variable 'nr' to 'syscall_nr'
Date 2016-02-25 20:10 +0100
Message-ID <r69su-8oR-15@gated-at.bofh.it> (permalink)
References <r683p-78A-37@gated-at.bofh.it> <r68mL-7ld-23@gated-at.bofh.it> <r68Zr-7W1-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 26 Feb 2016 03:31:19 +0900
Taeung Song <treeze.taeung@gmail.com> 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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/3] tracing/syscalls: Rename variable 'nr' to 'syscall_nr' Taeung Song <treeze.taeung@gmail.com> - 2016-02-25 18:40 +0100
  Re: [PATCH v2 1/3] tracing/syscalls: Rename variable 'nr' to  'syscall_nr' Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-25 19:00 +0100
    Re: [PATCH v2 1/3] tracing/syscalls: Rename variable 'nr' to  'syscall_nr' Taeung Song <treeze.taeung@gmail.com> - 2016-02-25 19:40 +0100
      Re: [PATCH v2 1/3] tracing/syscalls: Rename variable 'nr' to  'syscall_nr' Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-25 19:50 +0100
        Re: [PATCH v2 1/3] tracing/syscalls: Rename variable 'nr' to  'syscall_nr' Taeung Song <treeze.taeung@gmail.com> - 2016-02-26 13:30 +0100
          Re: [PATCH v2 1/3] tracing/syscalls: Rename variable 'nr' to  'syscall_nr' Taeung Song <treeze.taeung@gmail.com> - 2016-02-26 14:10 +0100
          Re: [PATCH v2 1/3] tracing/syscalls: Rename variable 'nr' to  'syscall_nr' Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-26 14:50 +0100
            Re: [PATCH v2 1/3] tracing/syscalls: Rename variable 'nr' to  'syscall_nr' Taeung Song <treeze.taeung@gmail.com> - 2016-02-26 15:20 +0100
      Re: [PATCH v2 1/3] tracing/syscalls: Rename variable 'nr' to  'syscall_nr' Steven Rostedt <rostedt@goodmis.org> - 2016-02-25 20:10 +0100

csiph-web