diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-07-14 15:16:54 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-07-18 23:14:02 -0300 |
commit | 7ee5743404e3641f3c11792761632a5a7d583587 (patch) | |
tree | 3142a2db599c0c81b61430e157d171694f55247e /tools/perf/builtin-trace.c | |
parent | c2e539d287a2e7c633ad6ecb0cb6b6f13ea05125 (diff) | |
download | op-kernel-dev-7ee5743404e3641f3c11792761632a5a7d583587.zip op-kernel-dev-7ee5743404e3641f3c11792761632a5a7d583587.tar.gz |
perf trace beauty: Give syscall return beautifier more context
We need the current thread and the trace internal state so that we can
use the fd beautifier to augment syscall returns, so use struct
syscall_arg with some fields that make sense on returns (val, thread,
trace).
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-lqag8e86ybidrh5zpqne05ov@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r-- | tools/perf/builtin-trace.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index d48981c..cfa8bf1 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -918,7 +918,7 @@ struct thread_trace { unsigned long pfmaj, pfmin; char *entry_str; double runtime_ms; - size_t (*ret_scnprintf)(unsigned long value, char *bf, size_t size); + size_t (*ret_scnprintf)(char *bf, size_t size, struct syscall_arg *arg); struct { unsigned long ptr; short int entry_str_pos; @@ -971,7 +971,7 @@ fail: void syscall_arg__set_ret_scnprintf(struct syscall_arg *arg, - size_t (*ret_scnprintf)(unsigned long val, char *bf, size_t size)) + size_t (*ret_scnprintf)(char *bf, size_t size, struct syscall_arg *arg)) { struct thread_trace *ttrace = thread__priv(arg->thread); @@ -1726,7 +1726,12 @@ signed_print: fprintf(trace->output, ") = 0 Timeout"); else if (ttrace->ret_scnprintf) { char bf[1024]; - ttrace->ret_scnprintf(ret, bf, sizeof(bf)); + struct syscall_arg arg = { + .val = ret, + .thread = thread, + .trace = trace, + }; + ttrace->ret_scnprintf(bf, sizeof(bf), &arg); ttrace->ret_scnprintf = NULL; fprintf(trace->output, ") = %s", bf); } else if (sc->fmt->hexret) |