summaryrefslogtreecommitdiff
path: root/tools/perf/util/synthetic-events.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2023-08-25 18:25:51 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-08-29 20:16:14 +0300
commitf174341d0da1cb2fb8888e1fa228c31523eaec90 (patch)
treed10762eecd2ca10e64412f2624c3b74085a45f62 /tools/perf/util/synthetic-events.c
parentbaec60800dd4a379546f3ba311574d907a01a77d (diff)
downloadlinux-f174341d0da1cb2fb8888e1fa228c31523eaec90.tar.xz
perf tools: Convert to perf_record_header_attr_id()
Instead of accessing the attr.id directly, use the perf_record_header_attr_id() helper to handle old versions. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20230825152552.112913-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/synthetic-events.c')
-rw-r--r--tools/perf/util/synthetic-events.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c
index 45714a2785fd..a0579c7d7b9e 100644
--- a/tools/perf/util/synthetic-events.c
+++ b/tools/perf/util/synthetic-events.c
@@ -2145,7 +2145,7 @@ int perf_event__synthesize_attr(struct perf_tool *tool, struct perf_event_attr *
return -ENOMEM;
ev->attr.attr = *attr;
- memcpy(ev->attr.id, id, ids * sizeof(u64));
+ memcpy(perf_record_header_attr_id(ev), id, ids * sizeof(u64));
ev->attr.header.type = PERF_RECORD_HEADER_ATTR;
ev->attr.header.size = (u16)size;