Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf trace: Introduce SCA_TIMESPEC_FROM_USER() to set .from_user = true

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>

+7 -2
+2 -2
tools/perf/builtin-trace.c
··· 1084 1084 { .name = "clock_gettime", 1085 1085 .arg = { [0] = STRARRAY(clk_id, clockid), }, }, 1086 1086 { .name = "clock_nanosleep", 1087 - .arg = { [2] = { .scnprintf = SCA_TIMESPEC, /* rqtp */ }, }, }, 1087 + .arg = { [2] = SCA_TIMESPEC_FROM_USER(req), }, }, 1088 1088 { .name = "clone", .errpid = true, .nr_args = 5, 1089 1089 .arg = { [0] = { .name = "flags", .scnprintf = SCA_CLONE_FLAGS, }, 1090 1090 [1] = { .name = "child_stack", .scnprintf = SCA_HEX, }, ··· 1212 1212 { .name = "name_to_handle_at", 1213 1213 .arg = { [0] = { .scnprintf = SCA_FDAT, /* dfd */ }, }, }, 1214 1214 { .name = "nanosleep", 1215 - .arg = { [0] = { .scnprintf = SCA_TIMESPEC, /* req */ }, }, }, 1215 + .arg = { [0] = SCA_TIMESPEC_FROM_USER(req), }, }, 1216 1216 { .name = "newfstatat", .alias = "fstatat", 1217 1217 .arg = { [0] = { .scnprintf = SCA_FDAT, /* dirfd */ }, 1218 1218 [1] = SCA_FILENAME_FROM_USER(pathname),
+5
tools/perf/trace/beauty/beauty.h
··· 255 255 size_t syscall_arg__scnprintf_timespec(char *bf, size_t size, struct syscall_arg *arg); 256 256 #define SCA_TIMESPEC syscall_arg__scnprintf_timespec 257 257 258 + // 'argname' is just documentational at this point, to remove the previous comment with that info 259 + #define SCA_TIMESPEC_FROM_USER(argname) \ 260 + { .scnprintf = SCA_TIMESPEC, \ 261 + .from_user = true, } 262 + 258 263 size_t open__scnprintf_flags(unsigned long flags, char *bf, size_t size, bool show_prefix); 259 264 260 265 void syscall_arg__set_ret_scnprintf(struct syscall_arg *arg,