All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf trace: Add mmap alias for s390
@ 2017-05-31 11:35 Jiri Olsa
  2017-06-01 13:13 ` Arnaldo Carvalho de Melo
  2017-06-07 15:56 ` [tip:perf/urgent] " tip-bot for Jiri Olsa
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Olsa @ 2017-05-31 11:35 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, Ingo Molnar, Peter Zijlstra, Namhyung Kim, David Ahern

The s390 architecture maps sys_mmap (nr 90) into sys_old_mmap.
For this reason perf trace can't find the proper syscall event
to get args format from and displays it wrong as 'continued'.

To fix that fill "alias" field with "old_mmap" for trace's mmap
record to get the correct translation.

Before:
     0.042 ( 0.011 ms): vest/43052 fstat(statbuf: 0x3ffff89fd90                ) = 0
     0.042 ( 0.028 ms): vest/43052  ... [continued]: mmap()) = 0x3fffd6e2000
     0.072 ( 0.025 ms): vest/43052 read(buf: 0x3fffd6e2000, count: 4096        ) = 6

After:
     0.045 ( 0.011 ms): fstat(statbuf: 0x3ffff8a0930                           ) = 0
     0.057 ( 0.018 ms): mmap(arg: 0x3ffff8a0858                                ) = 0x3fffd14a000
     0.076 ( 0.025 ms): read(buf: 0x3fffd14a000, count: 4096                   ) = 6

Link: http://lkml.kernel.org/n/tip-3jrfsbpclxr1ftke2t9rpvy6@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-trace.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index d014350adc52..4b2a5d298197 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -681,6 +681,10 @@ static struct syscall_fmt {
 	{ .name	    = "mlockall",   .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_HEX, /* addr */ }, },
 	{ .name	    = "mmap",	    .hexret = true,
+/* The standard mmap maps to old_mmap on s390x */
+#if defined(__s390x__)
+	.alias = "old_mmap",
+#endif
 	  .arg_scnprintf = { [0] = SCA_HEX,	  /* addr */
 			     [2] = SCA_MMAP_PROT, /* prot */
 			     [3] = SCA_MMAP_FLAGS, /* flags */ }, },
-- 
2.9.4

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

* Re: [PATCH] perf trace: Add mmap alias for s390
  2017-05-31 11:35 [PATCH] perf trace: Add mmap alias for s390 Jiri Olsa
@ 2017-06-01 13:13 ` Arnaldo Carvalho de Melo
  2017-06-07 15:56 ` [tip:perf/urgent] " tip-bot for Jiri Olsa
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-06-01 13:13 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: lkml, Ingo Molnar, Peter Zijlstra, Namhyung Kim, David Ahern

Em Wed, May 31, 2017 at 01:35:57PM +0200, Jiri Olsa escreveu:
> The s390 architecture maps sys_mmap (nr 90) into sys_old_mmap.
> For this reason perf trace can't find the proper syscall event
> to get args format from and displays it wrong as 'continued'.
> 
> To fix that fill "alias" field with "old_mmap" for trace's mmap
> record to get the correct translation.

Ok, I'll add this, but at some point we'll need to do this by looking at
the perf.data header when cross-tracing on a non-live, perf.data based
setup.

- Arnaldo
 
> Before:
>      0.042 ( 0.011 ms): vest/43052 fstat(statbuf: 0x3ffff89fd90                ) = 0
>      0.042 ( 0.028 ms): vest/43052  ... [continued]: mmap()) = 0x3fffd6e2000
>      0.072 ( 0.025 ms): vest/43052 read(buf: 0x3fffd6e2000, count: 4096        ) = 6
> 
> After:
>      0.045 ( 0.011 ms): fstat(statbuf: 0x3ffff8a0930                           ) = 0
>      0.057 ( 0.018 ms): mmap(arg: 0x3ffff8a0858                                ) = 0x3fffd14a000
>      0.076 ( 0.025 ms): read(buf: 0x3fffd14a000, count: 4096                   ) = 6
> 
> Link: http://lkml.kernel.org/n/tip-3jrfsbpclxr1ftke2t9rpvy6@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/perf/builtin-trace.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> index d014350adc52..4b2a5d298197 100644
> --- a/tools/perf/builtin-trace.c
> +++ b/tools/perf/builtin-trace.c
> @@ -681,6 +681,10 @@ static struct syscall_fmt {
>  	{ .name	    = "mlockall",   .errmsg = true,
>  	  .arg_scnprintf = { [0] = SCA_HEX, /* addr */ }, },
>  	{ .name	    = "mmap",	    .hexret = true,
> +/* The standard mmap maps to old_mmap on s390x */
> +#if defined(__s390x__)
> +	.alias = "old_mmap",
> +#endif
>  	  .arg_scnprintf = { [0] = SCA_HEX,	  /* addr */
>  			     [2] = SCA_MMAP_PROT, /* prot */
>  			     [3] = SCA_MMAP_FLAGS, /* flags */ }, },
> -- 
> 2.9.4

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

* [tip:perf/urgent] perf trace: Add mmap alias for s390
  2017-05-31 11:35 [PATCH] perf trace: Add mmap alias for s390 Jiri Olsa
  2017-06-01 13:13 ` Arnaldo Carvalho de Melo
@ 2017-06-07 15:56 ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Jiri Olsa @ 2017-06-07 15:56 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, dsahern, acme, jolsa, mingo, a.p.zijlstra,
	namhyung, tglx

Commit-ID:  54265664c15a68905d8d67d19205e9a767636434
Gitweb:     http://git.kernel.org/tip/54265664c15a68905d8d67d19205e9a767636434
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 31 May 2017 13:35:57 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 1 Jun 2017 10:13:21 -0300

perf trace: Add mmap alias for s390

The s390 architecture maps sys_mmap (nr 90) into sys_old_mmap.  For this
reason perf trace can't find the proper syscall event to get args format
from and displays it wrongly as 'continued'.

To fix that fill the "alias" field with "old_mmap" for trace's mmap record
to get the correct translation.

Before:
     0.042 ( 0.011 ms): vest/43052 fstat(statbuf: 0x3ffff89fd90                ) = 0
     0.042 ( 0.028 ms): vest/43052  ... [continued]: mmap()) = 0x3fffd6e2000
     0.072 ( 0.025 ms): vest/43052 read(buf: 0x3fffd6e2000, count: 4096        ) = 6

After:
     0.045 ( 0.011 ms): fstat(statbuf: 0x3ffff8a0930                           ) = 0
     0.057 ( 0.018 ms): mmap(arg: 0x3ffff8a0858                                ) = 0x3fffd14a000
     0.076 ( 0.025 ms): read(buf: 0x3fffd14a000, count: 4096                   ) = 6

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20170531113557.19175-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-trace.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index d014350..4b2a5d2 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -681,6 +681,10 @@ static struct syscall_fmt {
 	{ .name	    = "mlockall",   .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_HEX, /* addr */ }, },
 	{ .name	    = "mmap",	    .hexret = true,
+/* The standard mmap maps to old_mmap on s390x */
+#if defined(__s390x__)
+	.alias = "old_mmap",
+#endif
 	  .arg_scnprintf = { [0] = SCA_HEX,	  /* addr */
 			     [2] = SCA_MMAP_PROT, /* prot */
 			     [3] = SCA_MMAP_FLAGS, /* flags */ }, },

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

end of thread, other threads:[~2017-06-07 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-31 11:35 [PATCH] perf trace: Add mmap alias for s390 Jiri Olsa
2017-06-01 13:13 ` Arnaldo Carvalho de Melo
2017-06-07 15:56 ` [tip:perf/urgent] " tip-bot for Jiri Olsa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.