aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/bpf_counter_cgroup.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2021-07-06 17:16:59 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2021-07-09 14:04:28 -0300
commit38fe0e0156c037c060f81fe4e36549fae760322d (patch)
tree156bc087e80b596d76946523734fe7804beb2a3d /tools/perf/util/bpf_counter_cgroup.c
parentlibperf: Change tests to single static and shared binaries (diff)
downloadlinux-dev-38fe0e0156c037c060f81fe4e36549fae760322d.tar.xz
linux-dev-38fe0e0156c037c060f81fe4e36549fae760322d.zip
libperf: Move 'idx' from tools/perf to perf_evsel::idx
Move evsel::idx to perf_evsel::idx, so we can move the group interface to libperf. Committer notes: Fixup evsel->idx usage in tools/perf/util/bpf_counter_cgroup.c, that appeared in my tree in my local tree. Also fixed up these: $ find tools/perf/ -name "*.[ch]" | xargs grep 'evsel->idx' tools/perf/ui/gtk/annotate.c: evsel->idx + i); tools/perf/ui/gtk/annotate.c: evsel->idx); $ That running 'make -C tools/perf build-test' caught. 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-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/bpf_counter_cgroup.c')
-rw-r--r--tools/perf/util/bpf_counter_cgroup.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/util/bpf_counter_cgroup.c b/tools/perf/util/bpf_counter_cgroup.c
index 21261f1a0501..89aa5e71db1a 100644
--- a/tools/perf/util/bpf_counter_cgroup.c
+++ b/tools/perf/util/bpf_counter_cgroup.c
@@ -124,7 +124,7 @@ static int bperf_load_program(struct evlist *evlist)
map_fd = bpf_map__fd(skel->maps.events);
for (cpu = 0; cpu < nr_cpus; cpu++) {
int fd = FD(evsel, cpu);
- __u32 idx = evsel->idx * total_cpus +
+ __u32 idx = evsel->core.idx * total_cpus +
evlist->core.all_cpus->map[cpu];
err = bpf_map_update_elem(map_fd, &idx, &fd,
@@ -221,7 +221,7 @@ static int bperf_cgrp__sync_counters(struct evlist *evlist)
static int bperf_cgrp__enable(struct evsel *evsel)
{
- if (evsel->idx)
+ if (evsel->core.idx)
return 0;
bperf_cgrp__sync_counters(evsel->evlist);
@@ -232,7 +232,7 @@ static int bperf_cgrp__enable(struct evsel *evsel)
static int bperf_cgrp__disable(struct evsel *evsel)
{
- if (evsel->idx)
+ if (evsel->core.idx)
return 0;
bperf_cgrp__sync_counters(evsel->evlist);
@@ -251,7 +251,7 @@ static int bperf_cgrp__read(struct evsel *evsel)
int reading_map_fd, err = 0;
__u32 idx;
- if (evsel->idx)
+ if (evsel->core.idx)
return 0;
bperf_cgrp__sync_counters(evsel->evlist);
@@ -263,7 +263,7 @@ static int bperf_cgrp__read(struct evsel *evsel)
reading_map_fd = bpf_map__fd(skel->maps.cgrp_readings);
evlist__for_each_entry(evlist, evsel) {
- idx = evsel->idx;
+ idx = evsel->core.idx;
err = bpf_map_lookup_elem(reading_map_fd, &idx, values);
if (err) {
pr_err("bpf map lookup falied: idx=%u, event=%s, cgrp=%s\n",
@@ -288,7 +288,7 @@ out:
static int bperf_cgrp__destroy(struct evsel *evsel)
{
- if (evsel->idx)
+ if (evsel->core.idx)
return 0;
bperf_cgroup_bpf__destroy(skel);