-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ply 'kprobe:do_sys_open { printf("%v(%v): %s\n", comm, uid, str(arg1)); }' can not print filename #87
Comments
This issue should be related to comment 17864b9 ("ply: Use new read_kernel variants"). According to the definition of do_sys_open below, the argument *filename is declared with attribute __user, so we need to use BPF helper bpf_probe_read_user() / bpf_probe_read_str().
For local test, you can just revert the commit 17864b9 ("ply: Use new read_kernel variants"), and it should work correctly.
The solution should be something done in bpftrace below, adding syntax to let user specify the reading source from user/kernel space.
Hi @wkz , could you please give some advice on this? Thank you. :) This issue should be similar with #85. |
This error not happans in arm64 arch |
hi,I tried again according to your instructions and solved the problem I mentioned |
I've been working on bringing back userland probes and as part of that added a "uptr" mechanism: (sorry, this commit is not all of it - also needs the prev commit adding the "user" hint) This allows for a probe like 'kprobe:do_sys_open { printf("%v(%v): %s\n", comm, uid, str(uptr(arg1))); }' and will correctly print the filename. |
hi, I can not print filename in my x86 arch system
The text was updated successfully, but these errors were encountered: