Skip to content
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

[PROF-4081] Make threads with empty backtrace visible #1719

Merged

Conversation

ivoanjo
Copy link
Member

@ivoanjo ivoanjo commented Oct 15, 2021

As documented in the code, there's a few situations in which a thread can have an empty backtrace. Previously, these threads were not visible in the profiling UX, which was a gap in our provided information.

(It also could be confusing, for instance, if a thread spent some time executing Ruby and some time in native code, as happens with the Iodine web server, the "wall clock time" would not add up to 60s in a regular profile, because we ignored these threads).

To fix this, we now replace empty backtraces with a fake stack that displays (In native code). We currently have no way of showing what's up in native code (is the code running? is the thread idle? we don't know), but at least we know it's there.

Screen Shot 2021-10-15 at 09 52 31

As documented in the code, there's a few situations in which a thread
can have an empty backtrace. Previously, these threads were not visible
in the profiling UX, which was a gap in our provided information.

(It also could be confusing, for instance, if a thread spent some time
executing Ruby and some time in native code, as happens with the Iodine
web server, the "wall clock time" would not add up to 60s in a regular
profile, because we ignored these threads).

To fix this, we now replace empty backtraces with a fake stack that
displays `(In native code)`. We currently have no way of showing
what's up in native code (is the code running? is the thread idle?
we don't know), but at least we know it's there.
@ivoanjo ivoanjo requested a review from a team October 15, 2021 09:42
@ivoanjo ivoanjo merged commit 66dd1e9 into master Oct 15, 2021
@ivoanjo ivoanjo deleted the ivoanjo/prof-4081-handle-threads-with-empty-backtrace branch October 15, 2021 17:29
@github-actions github-actions bot added this to the 0.54.0 milestone Oct 15, 2021
ivoanjo added a commit that referenced this pull request May 4, 2022
…K_IN_NATIVE_CODE`

This feature was already supported by the
`Datadog::Profiling::Collectors::OldStack` in much the same manner
(it's called `SYNTHETIC_STACK_IN_NATIVE_CODE` there, but I think
placeholder is a better name).

See #1719 for details.

I have validated that the detection in `rb_profile_frames` correctly
works for the ffi and iodine gems as well.
ivoanjo added a commit that referenced this pull request May 18, 2022
…K_IN_NATIVE_CODE`

This feature was already supported by the
`Datadog::Profiling::Collectors::OldStack` in much the same manner
(it's called `SYNTHETIC_STACK_IN_NATIVE_CODE` there, but I think
placeholder is a better name).

See #1719 for details.

I have validated that the detection in `rb_profile_frames` correctly
works for the ffi and iodine gems as well.
ivoanjo added a commit that referenced this pull request May 20, 2022
…K_IN_NATIVE_CODE`

This feature was already supported by the
`Datadog::Profiling::Collectors::OldStack` in much the same manner
(it's called `SYNTHETIC_STACK_IN_NATIVE_CODE` there, but I think
placeholder is a better name).

See #1719 for details.

I have validated that the detection in `rb_profile_frames` correctly
works for the ffi and iodine gems as well.
ivoanjo added a commit that referenced this pull request May 23, 2022
…K_IN_NATIVE_CODE`

This feature was already supported by the
`Datadog::Profiling::Collectors::OldStack` in much the same manner
(it's called `SYNTHETIC_STACK_IN_NATIVE_CODE` there, but I think
placeholder is a better name).

See #1719 for details.

I have validated that the detection in `rb_profile_frames` correctly
works for the ffi and iodine gems as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants