-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
disksnoop.py errors out #1534
Comments
This is due to a kernel patch introduced in 4.13 which outputs symbol address. Just submitted a patch to address this issue. Thanks. |
Do we want to convert the |
Let us keep it with using printk as an example how to use the API. |
Yes, I use printk early in the tutorial and then introduce the ring buffer later. Easier to learn that way, so one isn't trying to learn too much at once. |
I saw the pull request but instead of bcc actually printing some hex address why does it always print 000001 ? |
It is due to the old implementation. The message after find the |
If you are asking why always 0x1 for the symbol address, I did not trace kernel source deep enough enough to find out. I suspect most likely this is due to that this is from trace_printk. Based on Steve's example, some function tracer symbol address seems reasonable. |
@lorddoskias The 0x1 value is a fake ip value hardcoded for BPF: http://elixir.free-electrons.com/linux/v4.14.8/source/kernel/trace/bpf_trace.c#L212. |
Oh, thanks! Quoting the kernel code:
Now, the fake ip does get printed in 4.13 and later, or whatever ip will be printed. |
So I've been doing the python developer tutorial and when I tried running disksnoop as per lesson 6 I got the following error:
After printing out the contents of msg it turns out it looks like that:
00000001: 16384 801 1495
. So the extra 0000001 that's coming frombpf_trace_printk
breaks disksnoop. If I instead change the msg.split line to:(ignored, bytes_s, bflags_s, us_s) = msg.split()
Everything works as expected.
I've installed iovisor on Ubuntu 16.04, using the latest HWE kernel : 4.13.0-26-generic #29~16.04.2-Ubuntu
The text was updated successfully, but these errors were encountered: