Replies: 2 comments 1 reply
-
Out of curiosity, if you add some time calculations in |
Beta Was this translation helpful? Give feedback.
-
(see previous comment - I think the time difference comes from
bpftrace does add on a few (normally single-digit microseconds) of latency, so for very short functions it can add a noticeable overhead. The large difference (hundreds of microseconds) you're seeing here seems to come from the kernel's scheduler, not bpftrace though.
I don't think there's anything for bpftrace to do here. The big difference you're seeing comes from the scheduler, and the small overhead of tracing comes from the kernel's tracing implementation. There's work actively going on to reduce the uprobe overhead to sub-microsecond levels, but we'll get the benefits automatically in newer kernels. |
Beta Was this translation helpful? Give feedback.
-
Hi. Here's my simple test program:
bpftrace version:v.0.20.3
My bt file:
Here's my results for running multiple times:
My finding is that the bigger parameter I give, the more precise bpftrace print timing. If I give a few microseconds, it's no longer very correct. I guess it's related to CPU schedule.
Beta Was this translation helpful? Give feedback.
All reactions