Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

zh/tutorials/5-uprobe-bashreadline/ #150

giscus[bot] bot started this conversation in General
Discussion options

zh/tutorials/5-uprobe-bashreadline/

Unlock the potential of eBPF

https://eunomia.dev/zh/tutorials/5-uprobe-bashreadline/

You must be logged in to vote

Replies: 1 comment

Comment options

参考:iovisor/bcc#1851

% sudo ecli run package.json
INFO [faerie::elf] strtab: 0x455 symtab 0x490 relocs 0x4d8 sh_offset 0x4d8
libbpf: elf: 'readline' is 0 in symtab for '/bin/bash': should not be 0 in a shared library
Error: Failed to run native eBPF program
Caused by:
 Bpf error: Failed to start polling: Bpf("Failed to load and attach: Failed to attach program `printret`: Internal error: bpf call \"libbpf_rs::program::Program::attach::{{closure}}\" returned NULL"), RecvError

如果你也在这一节遇到了相同的困扰,应该是动态链接的问题,检查一下 ldd

% ldd /bin/bash 
 ...
 libreadline.so.8 => /usr/lib/libreadline.so.8 (0x00007bad65e9f000)
 ...

所以我们可以把 SEC("uretprobe//bin/bash:readline") 换成 SEC("uretprobe//usr/lib/libreadline.so.8:readline") 来达到最后的效果。注意:这里替换的binary路径需要和你的 ldd 中的 libreadline 相一致。

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /