diff options
| author | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2025-07-03 23:48:09 +0300 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2025-07-04 05:30:06 +0300 |
| commit | 0e521efaf36350b8f783984541efa56f560c90b0 (patch) | |
| tree | 99e96cec508a05fccc7e5d0086f8f713713346e0 /include/linux | |
| parent | 5ab154f1463a111e1dc8fd5d31eaa7a2a71fe2e6 (diff) | |
| download | linux-0e521efaf36350b8f783984541efa56f560c90b0.tar.xz | |
bpf: Add function to extract program source info
Prepare a function for use in future patches that can extract the file
info, line info, and the source line number for a given BPF program
provided it's program counter.
Only the basename of the file path is provided, given it can be
excessively long in some cases.
This will be used in later patches to print source info to the BPF
stream.
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20250703204818.925464-4-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bpf.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index f61aeccb23c3..c3802af11bac 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -3661,4 +3661,7 @@ static inline bool bpf_is_subprog(const struct bpf_prog *prog) return prog->aux->func_idx != 0; } +int bpf_prog_get_file_line(struct bpf_prog *prog, unsigned long ip, const char **filep, + const char **linep, int *nump); + #endif /* _LINUX_BPF_H */ |
