summaryrefslogtreecommitdiff
path: root/tools/perf/util/btf.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2024-12-09 16:00:39 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2024-12-09 17:52:41 -0300
commitdcf900429d1e7c9b528e3e4682d0255003ab7be3 (patch)
tree324a44eb9917ef8d795b166ceefffd48ec5d9d3d /tools/perf/util/btf.h
parentbfb946753550d8d5f5bd5a156e4413c3df359faa (diff)
perf btf: Make the sigtrap test helper to find a member by name widely available
By introducing a tools/perf/util/btf.c to collect utilities not yet available via libbpf, the first being a way to find a member by name once we get the type_id for the struct. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: James Clark <james.clark@linaro.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/btf.h')
-rw-r--r--tools/perf/util/btf.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/btf.h b/tools/perf/util/btf.h
new file mode 100644
index 000000000000..05e6e5bf23d6
--- /dev/null
+++ b/tools/perf/util/btf.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __PERF_UTIL_BTF
+#define __PERF_UTIL_BTF 1
+
+struct btf;
+struct btf_member;
+
+const struct btf_member *__btf_type__find_member_by_name(struct btf *btf,
+ int type_id, const char *member_name);
+#endif // __PERF_UTIL_BTF