]> git.baikalelectronics.ru Git - kernel.git/commit
perf bpf_counter: Move common functions to bpf_counter.h
authorNamhyung Kim <namhyung@kernel.org>
Fri, 25 Jun 2021 07:18:25 +0000 (00:18 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 1 Jul 2021 19:14:19 +0000 (16:14 -0300)
commit6b82427883fd72eda1c11d577f809f002dc51f7d
treee0038ac2f047c4a753485631f77c83c5ae094d22
parent516fed556fc338b9c38e2d6d1c9a6211f0145b08
perf bpf_counter: Move common functions to bpf_counter.h

Some helper functions will be used for cgroup counting too.  Move them
to a header file for sharing.

Committer notes:

Fix the build on older systems with:

  -       struct bpf_map_info map_info = {0};
  +       struct bpf_map_info map_info = { .id = 0, };

This wasn't breaking the build in such systems as bpf_counter.c isn't
built due to:

tools/perf/util/Build:

  perf-$(CONFIG_PERF_BPF_SKEL) += bpf_counter.o

The bpf_counter.h file on the other hand is included from places that
are built everywhere.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20210625071826.608504-4-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/bpf_counter.c
tools/perf/util/bpf_counter.h