Re: [PATCH] libperf: fix build error with LIBPFM4=1

From: Jiri Olsa
Date: Tue Jul 13 2021 - 05:32:23 EST


On Tue, Jul 13, 2021 at 11:19:07AM +0200, Heiko Carstens wrote:
> Fix build error with LIBPFM4=1:
> CC util/pfm.o
> util/pfm.c: In function ‘parse_libpfm_events_option’:
> util/pfm.c:102:30: error: ‘struct evsel’ has no member named ‘leader’
> 102 | evsel->leader = grp_leader;
> | ^~
>
> Fixes: fba7c86601e2 ("libperf: Move 'leader' from tools/perf to perf_evsel::leader")
> Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>

Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>

thanks,
jirka

> ---
> 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.25.1
>