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

perf trace: Check and discard not only 'nr' but also '__syscall_nr'

Format fields of a syscall have the first variable '__syscall_nr' or
'nr' that mean the syscall number.  But it isn't relevant here so drop
it.

'nr' among fields of syscall was renamed '__syscall_nr'.  So add
exception handling to drop '__syscall_nr' and modify the comment for
this excpetion handling.
Reported-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarTaeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1456492465-5946-1-git-send-email-treeze.taeung@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 67d52689
...@@ -1725,8 +1725,12 @@ static int trace__read_syscall_info(struct trace *trace, int id) ...@@ -1725,8 +1725,12 @@ static int trace__read_syscall_info(struct trace *trace, int id)
sc->args = sc->tp_format->format.fields; sc->args = sc->tp_format->format.fields;
sc->nr_args = sc->tp_format->format.nr_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) { * We need to check and discard the first variable '__syscall_nr'
* or 'nr' that mean the syscall number. It is needless here.
* So drop '__syscall_nr' or 'nr' field but does not exist on older kernels.
*/
if (sc->args && (!strcmp(sc->args->name, "__syscall_nr") || !strcmp(sc->args->name, "nr"))) {
sc->args = sc->args->next; sc->args = sc->args->next;
--sc->nr_args; --sc->nr_args;
} }
......
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