]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
perf trace: Introduce SCA_PERF_ATTR_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/perf_event_open.c

index 64f0aefeba3b53c7dabbc9d96374a3a624868228..5f31466516842b7c3a30488f12087f55589d912b 100644 (file)
@@ -1226,7 +1226,7 @@ static const struct syscall_fmt syscall_fmts[] = {
          .arg = { [0] = { .scnprintf = SCA_FDAT,       /* dfd */ },
                   [2] = { .scnprintf = SCA_OPEN_FLAGS, /* flags */ }, }, },
        { .name     = "perf_event_open",
-         .arg = { [0] = { .scnprintf = SCA_PERF_ATTR,  /* attr */ },
+         .arg = { [0] = SCA_PERF_ATTR_FROM_USER(attr),
                   [2] = { .scnprintf = SCA_INT,        /* cpu */ },
                   [3] = { .scnprintf = SCA_FD,         /* group_fd */ },
                   [4] = { .scnprintf = SCA_PERF_FLAGS, /* flags */ }, }, },
index 632237128640dbb4ea40cf18985d93fae8238cc7..9f1ed989c7751ec55e83a4e22d019bb14584fd71 100644 (file)
@@ -88,3 +88,7 @@ static size_t syscall_arg__scnprintf_perf_event_attr(char *bf, size_t size, stru
 }
 
 #define SCA_PERF_ATTR syscall_arg__scnprintf_perf_event_attr
+// 'argname' is just documentational at this point, to remove the previous comment with that info
+#define SCA_PERF_ATTR_FROM_USER(argname) \
+          { .scnprintf  = SCA_PERF_ATTR, \
+            .from_user  = true, }