2 ms·
I went to use bpftrace to solve a real problem recently, and unfortunately found I had to resort to systemtap. I wanted to print a debug log as it was being sa
by rincebrain 5y ago
I went to use bpftrace to solve a real problem recently, and unfortunately found I had to resort to systemtap.
I wanted to print a debug log as it was being saved in a kernel module - that's fine, the module has an equivalent of save_log(char* foo), just probe on entrance and print that, right?
...except bpftrace has a hard cap of 200-odd bytes for getting char *s out with str() at a time. [1]
Fine, so you just do some pointer math and print foo, foo+200, etc, right?
No strlen, no printf return value, so you don't know where the end of the string is.
At that point, I said "sod it" and broke out systemtap.
[1] - https://github.com/iovisor/bpftrace/issues/305 https://github.com/iovisor/bpftrace/issues/305