]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
perf trace: Introduce SCA_TIMESPEC_FROM_USER() to set .from_user = true
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 9 Sep 2024 19:57:22 +0000 (16:57 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 9 Sep 2024 22:23:04 +0000 (19:23 -0300)
Paving the way for the generic BPF BTF based syscall arg augmenter.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c
tools/perf/trace/beauty/beauty.h

index 64c3f7f7a9aac7d51a3dd1f5b3b711a4985d3949..2bdbb6813512d615e4c204b971a487083835c6c0 100644 (file)
@@ -1084,7 +1084,7 @@ static const struct syscall_fmt syscall_fmts[] = {
        { .name     = "clock_gettime",
          .arg = { [0] = STRARRAY(clk_id, clockid), }, },
        { .name     = "clock_nanosleep",
-         .arg = { [2] = { .scnprintf = SCA_TIMESPEC,  /* rqtp */ }, }, },
+         .arg = { [2] = SCA_TIMESPEC_FROM_USER(req), }, },
        { .name     = "clone",      .errpid = true, .nr_args = 5,
          .arg = { [0] = { .name = "flags",         .scnprintf = SCA_CLONE_FLAGS, },
                   [1] = { .name = "child_stack",   .scnprintf = SCA_HEX, },
@@ -1212,7 +1212,7 @@ static const struct syscall_fmt syscall_fmts[] = {
        { .name     = "name_to_handle_at",
          .arg = { [0] = { .scnprintf = SCA_FDAT, /* dfd */ }, }, },
        { .name     = "nanosleep",
-         .arg = { [0] = { .scnprintf = SCA_TIMESPEC,  /* req */ }, }, },
+         .arg = { [0] = SCA_TIMESPEC_FROM_USER(req), }, },
        { .name     = "newfstatat", .alias = "fstatat",
          .arg = { [0] = { .scnprintf = SCA_FDAT,         /* dirfd */ },
                   [1] = SCA_FILENAME_FROM_USER(pathname),
index 9c6bfb7d0ef1ac2f9a1ea072337e0b84018e0b53..0a07ad158f87c73c0ee3886d0b5971bd581ab392 100644 (file)
@@ -255,6 +255,11 @@ size_t syscall_arg__scnprintf_sync_file_range_flags(char *bf, size_t size, struc
 size_t syscall_arg__scnprintf_timespec(char *bf, size_t size, struct syscall_arg *arg);
 #define SCA_TIMESPEC syscall_arg__scnprintf_timespec
 
+// 'argname' is just documentational at this point, to remove the previous comment with that info
+#define SCA_TIMESPEC_FROM_USER(argname) \
+         { .scnprintf  = SCA_TIMESPEC, \
+           .from_user  = true, }
+
 size_t open__scnprintf_flags(unsigned long flags, char *bf, size_t size, bool show_prefix);
 
 void syscall_arg__set_ret_scnprintf(struct syscall_arg *arg,