libperf: Move 'leader' from tools/perf to perf_evsel::leader
Move evsel::leader to perf_evsel::leader, so we can move the group interface to libperf. Also add several evsel helpers to ease up the transition: struct evsel *evsel__leader(struct evsel *evsel); - get leader evsel bool evsel__has_leader(struct evsel *evsel, struct evsel *leader); - true if evsel has leader as leader bool evsel__is_leader(struct evsel *evsel); - true if evsel is itw own leader void evsel__set_leader(struct evsel *evsel, struct evsel *leader); - set leader for evsel Committer notes: Fix this when building with 'make BUILD_BPF_SKEL=1' tools/perf/util/bpf_counter.c - if (evsel->leader->core.nr_members > 1) { + if (evsel->core.leader->nr_members > 1) { Signed-off-by:Jiri Olsa <jolsa@kernel.org> Requested-by:
Shunsuke Nakamura <nakamura.shun@fujitsu.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20210706151704.73662-4-jolsa@kernel.org Signed-off-by:
Arnaldo Carvalho de Melo <acme@redhat.com>
Showing
- tools/lib/perf/evsel.c 1 addition, 0 deletionstools/lib/perf/evsel.c
- tools/lib/perf/include/internal/evsel.h 1 addition, 0 deletionstools/lib/perf/include/internal/evsel.h
- tools/perf/builtin-record.c 1 addition, 1 deletiontools/perf/builtin-record.c
- tools/perf/builtin-report.c 1 addition, 1 deletiontools/perf/builtin-report.c
- tools/perf/builtin-script.c 5 additions, 4 deletionstools/perf/builtin-script.c
- tools/perf/builtin-stat.c 6 additions, 6 deletionstools/perf/builtin-stat.c
- tools/perf/builtin-top.c 1 addition, 1 deletiontools/perf/builtin-top.c
- tools/perf/tests/parse-events.c 26 additions, 26 deletionstools/perf/tests/parse-events.c
- tools/perf/util/auxtrace.c 6 additions, 6 deletionstools/perf/util/auxtrace.c
- tools/perf/util/bpf_counter.c 1 addition, 1 deletiontools/perf/util/bpf_counter.c
- tools/perf/util/cgroup.c 1 addition, 1 deletiontools/perf/util/cgroup.c
- tools/perf/util/evlist.c 9 additions, 8 deletionstools/perf/util/evlist.c
- tools/perf/util/evsel.c 24 additions, 5 deletionstools/perf/util/evsel.c
- tools/perf/util/evsel.h 8 additions, 5 deletionstools/perf/util/evsel.h
- tools/perf/util/header.c 2 additions, 2 deletionstools/perf/util/header.c
- tools/perf/util/metricgroup.c 4 additions, 4 deletionstools/perf/util/metricgroup.c
- tools/perf/util/parse-events.c 1 addition, 1 deletiontools/perf/util/parse-events.c
- tools/perf/util/record.c 3 additions, 3 deletionstools/perf/util/record.c
- tools/perf/util/stat-shadow.c 1 addition, 1 deletiontools/perf/util/stat-shadow.c
- tools/perf/util/stat.c 1 addition, 1 deletiontools/perf/util/stat.c
Please register or sign in to comment