[PATCH] perf tools: Fix build with libpfm

From: Namhyung Kim
Date: Mon Jul 12 2021 - 19:49:55 EST


It missed to update the parse_libpfm_events_option() to use a new
helper function to set the event group leader.

$ make LIBPFM4=1
...
CC util/pfm.o
util/pfm.c: In function ‘parse_libpfm_events_option’:
util/pfm.c:103:9: error: ‘struct evsel’ has no member named ‘leader’
103 | evsel->leader = grp_leader;
| ^~
make[4]: *** [tools/build/Makefile.build:96: util/pfm.o] Error 1

Fixes: fba7c86601e2 ("libperf: Move 'leader' from tools/perf to perf_evsel::leader")
Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
tools/perf/util/pfm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c
index dd9ed56e0504..756295dedccc 100644
--- a/tools/perf/util/pfm.c
+++ b/tools/perf/util/pfm.c
@@ -99,7 +99,7 @@ int parse_libpfm_events_option(const struct option *opt, const char *str,
grp_leader = evsel;

if (grp_evt > -1) {
- evsel->leader = grp_leader;
+ evsel__set_leader(evsel, grp_leader);
grp_leader->core.nr_members++;
grp_evt++;
}
--
2.32.0.93.g670b81a890-goog