18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef __TRACE_HELPER_H 38c2ecf20Sopenharmony_ci#define __TRACE_HELPER_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#include <bpf/libbpf.h> 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_cistruct ksym { 88c2ecf20Sopenharmony_ci long addr; 98c2ecf20Sopenharmony_ci char *name; 108c2ecf20Sopenharmony_ci}; 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ciint load_kallsyms(void); 138c2ecf20Sopenharmony_cistruct ksym *ksym_search(long key); 148c2ecf20Sopenharmony_cilong ksym_get_addr(const char *name); 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci/* open kallsyms and find addresses on the fly, faster than load + search. */ 178c2ecf20Sopenharmony_ciint kallsyms_find(const char *sym, unsigned long long *addr); 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_civoid read_trace_pipe(void); 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#endif 22