]> Git Repo - linux.git/commitdiff
perf expr: Tidy hashmap dependency
authorIan Rogers <[email protected]>
Wed, 9 Nov 2022 18:49:11 +0000 (10:49 -0800)
committerArnaldo Carvalho de Melo <[email protected]>
Wed, 16 Nov 2022 15:17:15 +0000 (12:17 -0300)
hashmap.h comes from libbpf but isn't installed with its
headers. Always use the header file of the code in util. Change the
hashmap.h dependency in expr.h to a forward declaration, add the
necessary header file includes in the C files.

Signed-off-by: Ian Rogers <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andrii Nakryiko <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Masahiro Yamada <[email protected]>
Cc: Nick Desaulniers <[email protected]>
Cc: Nicolas Schier <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: [email protected]
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/tests/expr.c
tools/perf/tests/pmu-events.c
tools/perf/util/bpf-loader.c
tools/perf/util/evsel.c
tools/perf/util/expr.c
tools/perf/util/expr.h
tools/perf/util/metricgroup.c
tools/perf/util/stat-shadow.c
tools/perf/util/stat.c

index 6512f5e22045a53f5be21ca3f30fff349f57186c..b6667501ebb454177b2781e5d2da0c9a6a3c07c4 100644 (file)
@@ -2,6 +2,7 @@
 #include "util/cputopo.h"
 #include "util/debug.h"
 #include "util/expr.h"
+#include "util/hashmap.h"
 #include "util/header.h"
 #include "util/smt.h"
 #include "tests.h"
index 5d0d3b239a68bd004627e3c3554afdccf050994e..f7b9dbbad97f5665f17d78016ddb4167f3b66230 100644 (file)
@@ -12,6 +12,7 @@
 #include <perf/evlist.h>
 #include "util/evlist.h"
 #include "util/expr.h"
+#include "util/hashmap.h"
 #include "util/parse-events.h"
 #include "metricgroup.h"
 #include "stat.h"
index f4adeccdbbcb4aef54e4b23dc9cf56880768cb40..b3c8174360bf33e76cfe3ee2fedb2c56f43f6ac5 100644 (file)
 #include "util.h"
 #include "llvm-utils.h"
 #include "c++/clang-c.h"
-#ifdef HAVE_LIBBPF_SUPPORT
-#include <bpf/hashmap.h>
-#else
 #include "util/hashmap.h"
-#endif
 #include "asm/bug.h"
 
 #include <internal/xyarray.h>
index ca6abb64c91d2d8a2d9d867cfbe50ee947e7ecdb..ca554f8202f949eb03b41dcf651d096109a51a1e 100644 (file)
 #include "string2.h"
 #include "memswap.h"
 #include "util.h"
-#ifdef HAVE_LIBBPF_SUPPORT
-#include <bpf/hashmap.h>
-#else
 #include "util/hashmap.h"
-#endif
 #include "pmu-hybrid.h"
 #include "off_cpu.h"
 #include "../perf-sys.h"
index aaacf514dc09c54dc046c51acc9946ff2568cc2b..140f2acdb3259faed48c5ed43b84b44b9bbd669e 100644 (file)
@@ -11,6 +11,7 @@
 #include "expr.h"
 #include "expr-bison.h"
 #include "expr-flex.h"
+#include "util/hashmap.h"
 #include "smt.h"
 #include "tsc.h"
 #include <linux/err.h>
index d6c1668dc1a08c38438f2a10895efdda5b3585ab..029271540fb0d1c0bc6ab8867a079341b5725cc0 100644 (file)
@@ -2,12 +2,7 @@
 #ifndef PARSE_CTX_H
 #define PARSE_CTX_H 1
 
-#ifdef HAVE_LIBBPF_SUPPORT
-#include <bpf/hashmap.h>
-#else
-#include "util/hashmap.h"
-#endif
-
+struct hashmap;
 struct metric_ref;
 
 struct expr_scanner_ctx {
index 1943fed9b6d920d68c75fa520aaea1e9fb2f02b6..cf9e2452d32297dfdc541424bac783b41ae3b555 100644 (file)
@@ -28,6 +28,7 @@
 #include "util.h"
 #include <asm/bug.h>
 #include "cgroup.h"
+#include "util/hashmap.h"
 
 struct metric_event *metricgroup__lookup(struct rblist *metric_events,
                                         struct evsel *evsel,
index 07b29fe272c79a823e284fe616ca95f56e197ec2..9bde9224a97cee18a13e8c50d25c8d0ce16140f0 100644 (file)
@@ -14,6 +14,7 @@
 #include "units.h"
 #include <linux/zalloc.h>
 #include "iostat.h"
+#include "util/hashmap.h"
 
 /*
  * AGGR_GLOBAL: Use CPU 0
index acf0edf5fdd1a6cfd7313f475ed2d60df5c20131..673f017a211f66c6cdb70ff7d9ed800db6bdb805 100644 (file)
 #include "evlist.h"
 #include "evsel.h"
 #include "thread_map.h"
-#ifdef HAVE_LIBBPF_SUPPORT
-#include <bpf/hashmap.h>
-#else
 #include "util/hashmap.h"
-#endif
 #include <linux/zalloc.h>
 
 void update_stats(struct stats *stats, u64 val)
This page took 0.099313 seconds and 4 git commands to generate.