summaryrefslogtreecommitdiff
path: root/tools/perf/util/env.h
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2019-03-12 08:30:44 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-03-19 22:52:07 +0300
commit3792cb2ff43b1b193136a03ce1336462a827d792 (patch)
tree264a653ee28353181a73b2a226b26769277445a6 /tools/perf/util/env.h
parent606f972b1361f477cbd4e6e8ac00742fde4b39db (diff)
downloadlinux-3792cb2ff43b1b193136a03ce1336462a827d792.tar.xz
perf bpf: Save BTF in a rbtree in perf_env
BTF contains information necessary to annotate BPF programs. This patch saves BTF for BPF programs loaded in the system. Signed-off-by: Song Liu <songliubraving@fb.com> Reviewed-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stanislav Fomichev <sdf@google.com> Cc: kernel-team@fb.com Link: http://lkml.kernel.org/r/20190312053051.2690567-9-songliubraving@fb.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/env.h')
-rw-r--r--tools/perf/util/env.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/util/env.h b/tools/perf/util/env.h
index 24b11c564ba4..4f8e2b485c01 100644
--- a/tools/perf/util/env.h
+++ b/tools/perf/util/env.h
@@ -75,10 +75,13 @@ struct perf_env {
struct rw_semaphore lock;
struct rb_root infos;
u32 infos_cnt;
+ struct rb_root btfs;
+ u32 btfs_cnt;
} bpf_progs;
};
struct bpf_prog_info_node;
+struct btf_node;
extern struct perf_env perf_env;
@@ -99,4 +102,6 @@ void perf_env__insert_bpf_prog_info(struct perf_env *env,
struct bpf_prog_info_node *info_node);
struct bpf_prog_info_node *perf_env__find_bpf_prog_info(struct perf_env *env,
__u32 prog_id);
+void perf_env__insert_btf(struct perf_env *env, struct btf_node *btf_node);
+struct btf_node *perf_env__find_btf(struct perf_env *env, __u32 btf_id);
#endif /* __PERF_ENV_H */