mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 16:44:10 +08:00
2c2f6abeff
Selftests for typed ksyms. Tests two types of ksyms: one is a struct, the other is a plain int. This tests two paths in the kernel. Struct ksyms will be converted into PTR_TO_BTF_ID by the verifier while int typed ksyms will be converted into PTR_TO_MEM. Signed-off-by: Hao Luo <haoluo@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/20200929235049.2533242-4-haoluo@google.com
22 lines
435 B
C
22 lines
435 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __TRACE_HELPER_H
|
|
#define __TRACE_HELPER_H
|
|
|
|
#include <bpf/libbpf.h>
|
|
|
|
struct ksym {
|
|
long addr;
|
|
char *name;
|
|
};
|
|
|
|
int load_kallsyms(void);
|
|
struct ksym *ksym_search(long key);
|
|
long ksym_get_addr(const char *name);
|
|
|
|
/* open kallsyms and find addresses on the fly, faster than load + search. */
|
|
int kallsyms_find(const char *sym, unsigned long long *addr);
|
|
|
|
void read_trace_pipe(void);
|
|
|
|
#endif
|