Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1344243
| From | Taeung Song <treeze.taeung@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/2] perf trace: Check and discard not only 'nr' but also '__syscall_nr' |
| Date | 2016-02-26 14:20 +0100 |
| Message-ID | <r6qtk-3P8-17@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 2/2] perf trace: Check and discard not only 'nr' but also '__syscall_nr' Taeung Song <treeze.taeung@gmail.com> - 2016-02-26 14:20 +0100
csiph-web