linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] perf trace: Check and discard not only 'nr' but also '__syscall_nr'
@ 2016-02-26 13:14 Taeung Song
  2016-03-05  8:13 ` [tip:perf/core] " tip-bot for Taeung Song
  0 siblings, 1 reply; 2+ messages in thread
From: Taeung Song @ 2016-02-26 13:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Jiri Olsa, Namhyung Kim, Ingo Molnar, Taeung Song,
	Steven Rostedt

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.

Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Taeung Song <treeze.taeung@gmail.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 20916dd..a252f3a 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1724,8 +1724,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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:perf/core] perf trace: Check and discard not only 'nr' but also '__syscall_nr'
  2016-02-26 13:14 [PATCH 2/2] perf trace: Check and discard not only 'nr' but also '__syscall_nr' Taeung Song
@ 2016-03-05  8:13 ` tip-bot for Taeung Song
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Taeung Song @ 2016-03-05  8:13 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: rostedt, namhyung, hpa, acme, linux-kernel, tglx, jolsa, mingo,
	treeze.taeung

Commit-ID:  c42de706dad3f39c1f65e473a1d165ea33f8b6e8
Gitweb:     http://git.kernel.org/tip/c42de706dad3f39c1f65e473a1d165ea33f8b6e8
Author:     Taeung Song <treeze.taeung@gmail.com>
AuthorDate: Fri, 26 Feb 2016 22:14:25 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 29 Feb 2016 11:34:28 -0300

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: 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 26a337f..8dc98c5 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;
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-05  8:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-26 13:14 [PATCH 2/2] perf trace: Check and discard not only 'nr' but also '__syscall_nr' Taeung Song
2016-03-05  8:13 ` [tip:perf/core] " tip-bot for Taeung Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).