-
Notifications
You must be signed in to change notification settings - Fork 127
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
Samples skewed by Thread#join #142
Comments
Oh wow, I figured it out while preparing a reproduce case. For some reason I was under the impression that the default mode was That would explain it. Switching to |
Ah, README currently claims One of the two should probably be corrected for accuracy. |
I'm working on rolling out stackprof for gitlab.com (ref), and started testing on our canary hosts today.
I got very odd results, for some reason a
Thread#join
from puma kept showing up as 80% of the profile.In an attempt to verify the accuracy of this, I ran a
perf record
while runningstackprof
, in order to get a C-level flamegraph and possibly be able to correlate. Luckily,perf record
stacks include thread names, making it feasible to compare the flamegraphs directly.In the perf profile, that very same
Thread#join
code path shows up as consuming only 1.4% of all samples.I am seeing
stackprof_job_handler
in that stack though, triggered by theRUBY_VM_CHECK_INTS_BLOCKING
call in ruby'sthread_join_sleep
. This makes me wonder if theSIGPROF
is waking up the waiting thread, and then that thread instantly runs the signal handler (presumably before going back to sleep), leading to that code path being over-represented in the stackprof profile.That is just a hypothesis. Would love to get more input on this. Have any of you seen anything similar?
Flamegraphs:
flamegraph.svg.gz
flamegraph.meta.svg.gz
Possibly related to #25 and #91.
The text was updated successfully, but these errors were encountered: