diff options
author | Mark Brown <broonie@kernel.org> | 2020-12-28 14:20:00 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-12-28 14:20:00 +0000 |
commit | 2ae6f64ce1ce304b502461fdfe0b96c8171ae2cc (patch) | |
tree | 88e987c447daf2c29e2d4c15e58d1029b0cc78c2 /tools/perf/util/env.c | |
parent | 3b66e4a8e58a85af3212c7117d7a29c9ef6679a2 (diff) | |
parent | 5c8fe583cce542aa0b84adc939ce85293de36e5e (diff) |
Merge tag 'v5.11-rc1' into regulator-5.11
Linux 5.11-rc1
Diffstat (limited to 'tools/perf/util/env.c')
-rw-r--r-- | tools/perf/util/env.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c index fadc59708ece..9130f6fad8d5 100644 --- a/tools/perf/util/env.c +++ b/tools/perf/util/env.c @@ -5,16 +5,18 @@ #include "util/header.h" #include <linux/ctype.h> #include <linux/zalloc.h> -#include "bpf-event.h" #include "cgroup.h" #include <errno.h> #include <sys/utsname.h> -#include <bpf/libbpf.h> #include <stdlib.h> #include <string.h> struct perf_env perf_env; +#ifdef HAVE_LIBBPF_SUPPORT +#include "bpf-event.h" +#include <bpf/libbpf.h> + void perf_env__insert_bpf_prog_info(struct perf_env *env, struct bpf_prog_info_node *info_node) { @@ -163,6 +165,11 @@ static void perf_env__purge_bpf(struct perf_env *env) up_write(&env->bpf_progs.lock); } +#else // HAVE_LIBBPF_SUPPORT +static void perf_env__purge_bpf(struct perf_env *env __maybe_unused) +{ +} +#endif // HAVE_LIBBPF_SUPPORT void perf_env__exit(struct perf_env *env) { @@ -197,11 +204,13 @@ void perf_env__exit(struct perf_env *env) zfree(&env->memory_nodes); } -void perf_env__init(struct perf_env *env) +void perf_env__init(struct perf_env *env __maybe_unused) { +#ifdef HAVE_LIBBPF_SUPPORT env->bpf_progs.infos = RB_ROOT; env->bpf_progs.btfs = RB_ROOT; init_rwsem(&env->bpf_progs.lock); +#endif } int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[]) |