blob: 3b4bcf7f5084ff55901e508216e24f6853f2214d [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);
Yonghong Song73bc4d92018-05-24 11:21:11 -070014long ksym_get_addr(const char *name);
Yonghong Song28dbf862018-04-28 22:28:13 -070015
Jakub Kicinskid0cabbb2018-05-10 10:24:40 -070016typedef enum bpf_perf_event_ret (*perf_event_print_fn)(void *data, int size);
Yonghong Song28dbf862018-04-28 22:28:13 -070017
18int perf_event_mmap(int fd);
Jakub Kicinskid0cabbb2018-05-10 10:24:40 -070019/* return LIBBPF_PERF_EVENT_DONE or LIBBPF_PERF_EVENT_ERROR */
Yonghong Song28dbf862018-04-28 22:28:13 -070020int perf_event_poller(int fd, perf_event_print_fn output_fn);
21#endif