-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add profiling with signals post #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few notes :)
|
||
> This signal typically indicates the expiration of a timer that measures both CPU time used by the current process, and CPU time expended on behalf of the process by the system. Such a timer is used to implement code profiling facilities, hence the name of this signal. | ||
|
||
We aren't using many CPU cycles in userspace as we have quickly been de-scheduled. The kernel might be using a bit of CPU for accounting purposes, but in any case it's probably very few CPU cycles, so it would take a very long time to ever a whole 2 seconds of kernel CPU time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this example I don't think it would ever happen -- the process is sitting on a sleep
so the only chance of the signal delivery happening is either before or after the sleep, which unless the CPU is running at 1MHz I don't think would happen :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a terrible example I agree! I think that the example below with the BPF loading where userspace uses no CPU but the kernel does might be a better thing to bring up. Will reword this :D
|
||
- [0] [signal-safety(7)](https://man7.org/linux/man-pages/man7/signal-safety.7.html) | ||
- [1] Go's [`PrintStack`](https://pkg.go.dev/runtime/debug#PrintStack) and Ruby's [`Kernel#Caller`](https://ruby-doc.org/3.2.1/Kernel.html#method-i-caller). | ||
- Seems like this issue was also found by Daniel. He wrote about it [in his website](https://dxuuu.xyz/bpf-go-pprof.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The clone system call also seems to potentially suffer from a similar issue, see async-profiler/async-profiler#97 , although there's workarounds for it.
75118a9
to
623bef7
Compare
Signed-off-by: Francisco Javier Honduvilla Coto <javierhonduco@gmail.com>
623bef7
to
6c86155
Compare
Signed-off-by: Francisco Javier Honduvilla Coto javierhonduco@gmail.com