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


Groups > linux.kernel > #1346116

[PATCH 02/11] perf trace: Check and discard not only 'nr' but also '__syscall_nr'

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 02/11] perf trace: Check and discard not only 'nr' but also '__syscall_nr'
Date 2016-02-29 20:30 +0100
Message-ID <r7BG2-7d5-23@gated-at.bofh.it> (permalink)
References <r7BG1-7d5-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Taeung Song <treeze.taeung@gmail.com>

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: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Taeung 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.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-trace.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 26a337f939d8..8dc98c598b1a 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1725,8 +1725,12 @@ 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) {
+	/*
+	 * 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->nr_args;
 	}
-- 
2.5.0

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


Thread

[GIT PULL 00/11] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-29 20:30 +0100
  [PATCH 07/11] perf data: Explicitly set byte order for integer types Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-29 20:30 +0100
  [PATCH 02/11] perf trace: Check and discard not only 'nr' but also '__syscall_nr' Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-29 20:30 +0100
  [PATCH 04/11] tools lib traceevent: Split pevent_print_event() into specific functionality functions Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-29 20:30 +0100
  [PATCH 09/11] perf record: Extract synthesize code to record__synthesize() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-29 20:30 +0100
  [PATCH 10/11] perf record: Introduce record__finish_output() to finish a perf.data Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-29 20:30 +0100
  Re: [GIT PULL 00/11] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-03-03 09:30 +0100
    Re: [GIT PULL 00/11] perf/core improvements and fixes Jiri Olsa <jolsa@redhat.com> - 2016-03-03 10:20 +0100
      [PATCH] perf tools: Fix locale handling in pmu parsing Jiri Olsa <jolsa@redhat.com> - 2016-03-03 11:00 +0100
        Re: [PATCH] perf tools: Fix locale handling in pmu parsing Andi Kleen <ak@linux.intel.com> - 2016-03-03 17:30 +0100
    Re: [GIT PULL 00/11] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-03-03 15:40 +0100

csiph-web