xref: /openbmc/linux/tools/testing/selftests/bpf/trace_helpers.h (revision c4c8f39a57bf5057fc51a848d42b7e348ecfa31d)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __TRACE_HELPER_H
3 #define __TRACE_HELPER_H
4 
5 #include <libbpf.h>
6 
7 struct ksym {
8 	long addr;
9 	char *name;
10 };
11 
12 int load_kallsyms(void);
13 struct ksym *ksym_search(long key);
14 
15 typedef enum bpf_perf_event_ret (*perf_event_print_fn)(void *data, int size);
16 
17 int perf_event_mmap(int fd);
18 /* return LIBBPF_PERF_EVENT_DONE or LIBBPF_PERF_EVENT_ERROR */
19 int perf_event_poller(int fd, perf_event_print_fn output_fn);
20 #endif
21