summaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/utils.py
diff options
context:
space:
mode:
authorHengqi Chen <hengqi.chen@gmail.com>2023-09-29 18:59:54 +0300
committerAndrii Nakryiko <andrii@kernel.org>2023-09-30 00:32:20 +0300
commit2147c8d07e1abc8dfc3433ca18eed5295e230ede (patch)
treeae624ec94a2518190b7e8969c2ddfa9276fcb4dd /scripts/gdb/linux/utils.py
parent9e09b75079e229b08f12a732712100fdb9af8cab (diff)
downloadlinux-2147c8d07e1abc8dfc3433ca18eed5295e230ede.tar.xz
libbpf: Allow Golang symbols in uprobe secdef
Golang symbols in ELF files are different from C/C++ which contains special characters like '*', '(' and ')'. With generics, things get more complicated, there are symbols like: github.com/cilium/ebpf/internal.(*Deque[go.shape.interface { Format(fmt.State, int32); TypeName() string;github.com/cilium/ebpf/btf.copy() github.com/cilium/ebpf/btf.Type}]).Grow Matching such symbols using `%m[^\n]` in sscanf, this excludes newline which typically does not appear in ELF symbols. This should work in most use-cases and also work for unicode letters in identifiers. If newline do show up in ELF symbols, users can still attach to such symbol by specifying bpf_uprobe_opts::func_name. A working example can be found at this repo ([0]). [0]: https://github.com/chenhengqi/libbpf-go-symbols Suggested-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20230929155954.92448-1-hengqi.chen@gmail.com
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions