summaryrefslogtreecommitdiff
path: root/tools/perf/trace/beauty/fcntl.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-07-14 15:16:54 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-07-18 23:14:02 -0300
commit7ee5743404e3641f3c11792761632a5a7d583587 (patch)
tree3142a2db599c0c81b61430e157d171694f55247e /tools/perf/trace/beauty/fcntl.c
parentc2e539d287a2e7c633ad6ecb0cb6b6f13ea05125 (diff)
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/trace/beauty/fcntl.c')
-rw-r--r--tools/perf/trace/beauty/fcntl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/trace/beauty/fcntl.c b/tools/perf/trace/beauty/fcntl.c
index 384f177a4304..9de80a7eddfa 100644
--- a/tools/perf/trace/beauty/fcntl.c
+++ b/tools/perf/trace/beauty/fcntl.c
@@ -15,14 +15,19 @@ static size_t fcntl__scnprintf_getfd(unsigned long val, char *bf, size_t size)
return scnprintf(bf, size, "%s", val ? "CLOEXEC" : "0");
}
+static size_t syscall_arg__scnprintf_fcntl_getfd(char *bf, size_t size, struct syscall_arg *arg)
+{
+ return fcntl__scnprintf_getfd(arg->val, bf, size);
+}
+
size_t syscall_arg__scnprintf_fcntl_cmd(char *bf, size_t size, struct syscall_arg *arg)
{
if (arg->val == F_GETFL) {
- syscall_arg__set_ret_scnprintf(arg, open__scnprintf_flags);
+ syscall_arg__set_ret_scnprintf(arg, syscall_arg__scnprintf_open_flags);
goto mask_arg;
}
if (arg->val == F_GETFD) {
- syscall_arg__set_ret_scnprintf(arg, fcntl__scnprintf_getfd);
+ syscall_arg__set_ret_scnprintf(arg, syscall_arg__scnprintf_fcntl_getfd);
goto mask_arg;
}
/*