Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf hashmap: Tidy hashmap dependency

When libbpf is present the build uses definitions in libbpf hashmap.c,
however, libbpf's hashmap.h wasn't being used. Switch to using the
correct hashmap.h dependent on the define HAVE_LIBBPF_SUPPORT. This was
the original intent in:

https://lore.kernel.org/lkml/20200515221732.44078-8-irogers@google.com/

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20220824050604.352156-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
bdf45725 84f879c5

+19 -10
+5 -1
tools/perf/util/bpf-loader.c
··· 27 27 #include "util.h" 28 28 #include "llvm-utils.h" 29 29 #include "c++/clang-c.h" 30 - #include "hashmap.h" 30 + #ifdef HAVE_LIBBPF_SUPPORT 31 + #include <bpf/hashmap.h> 32 + #else 33 + #include "util/hashmap.h" 34 + #endif 31 35 #include "asm/bug.h" 32 36 33 37 #include <internal/xyarray.h>
+5 -1
tools/perf/util/evsel.c
··· 46 46 #include "string2.h" 47 47 #include "memswap.h" 48 48 #include "util.h" 49 - #include "hashmap.h" 49 + #ifdef HAVE_LIBBPF_SUPPORT 50 + #include <bpf/hashmap.h> 51 + #else 52 + #include "util/hashmap.h" 53 + #endif 50 54 #include "pmu-hybrid.h" 51 55 #include "off_cpu.h" 52 56 #include "../perf-sys.h"
+4 -7
tools/perf/util/expr.h
··· 2 2 #ifndef PARSE_CTX_H 3 3 #define PARSE_CTX_H 1 4 4 5 - // There are fixes that need to land upstream before we can use libbpf's headers, 6 - // for now use our copy unconditionally, since the data structures at this point 7 - // are exactly the same, no problem. 8 - //#ifdef HAVE_LIBBPF_SUPPORT 9 - //#include <bpf/hashmap.h> 10 - //#else 5 + #ifdef HAVE_LIBBPF_SUPPORT 6 + #include <bpf/hashmap.h> 7 + #else 11 8 #include "util/hashmap.h" 12 - //#endif 9 + #endif 13 10 14 11 struct metric_ref; 15 12
+5 -1
tools/perf/util/stat.c
··· 14 14 #include "evlist.h" 15 15 #include "evsel.h" 16 16 #include "thread_map.h" 17 - #include "hashmap.h" 17 + #ifdef HAVE_LIBBPF_SUPPORT 18 + #include <bpf/hashmap.h> 19 + #else 20 + #include "util/hashmap.h" 21 + #endif 18 22 #include <linux/zalloc.h> 19 23 20 24 void update_stats(struct stats *stats, u64 val)