blob: 36d90e3b1ea9c4bea1c4da872320a86a480558f2 [file] [log] [blame]
Yonghong Song28dbf862018-04-28 22:28:13 -07001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __TRACE_HELPER_H
3#define __TRACE_HELPER_H
4
Jakub Kicinskid0cabbb2018-05-10 10:24:40 -07005#include <libbpf.h>
6
Yonghong Song28dbf862018-04-28 22:28:13 -07007struct ksym {
8 long addr;
9 char *name;
10};
11
12int load_kallsyms(void);
13struct ksym *ksym_search(long key);
14
Jakub Kicinskid0cabbb2018-05-10 10:24:40 -070015typedef enum bpf_perf_event_ret (*perf_event_print_fn)(void *data, int size);
Yonghong Song28dbf862018-04-28 22:28:13 -070016
17int perf_event_mmap(int fd);
Jakub Kicinskid0cabbb2018-05-10 10:24:40 -070018/* return LIBBPF_PERF_EVENT_DONE or LIBBPF_PERF_EVENT_ERROR */
Yonghong Song28dbf862018-04-28 22:28:13 -070019int perf_event_poller(int fd, perf_event_print_fn output_fn);
20#endif