-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat: Implement instruction_addr_adjustment #42533
Conversation
Implements handling of `instruction_addr_adjustment` and attaching appropriate per-frame attributes when sending stack traces to symbolicator. It implements the Sentry and Profiling side of [RFC 43](getsentry/rfcs#43)
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.
Should the possible values for "adjustment" be documented somewhere?
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
There was a concern from profiling folks that this approach might introduce the slight chance that one deduplicated frame in the big list of frames can be both a leaf and non-leaf. That happens when the leaf (top most) frame of a stack happens to be the instruction following a
In this edge case, the same addr should be adjusted in the first stack, but not the second. We could solve this in two ways:
In this proposal, we would still send a single large list to symbolicator, and only M leaf frames (for M stacks) are duplicated. |
Proposal 2 sounds reasonable. Should we implement this in Symbolicator first? |
Symbolicator does not need to know about that, this is purely work in the profiling processor. |
Derp, right. Sorry, had a brain fart. |
}, | ||
"debug_meta": {"images": []}, | ||
} | ||
|
||
_, stacktraces = _prepare_frames_from_profile(profile) | ||
assert profile["profile"]["stacks"] == [[3, 0], [4, 1, 2]] |
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.
You are correctly asserting that _prepare_frames_from_profile
is mutating its parameter which is nice.
However, is that mutation also being observed end to end when the request comes back from symbolicator?
src/sentry/profiles/task.py
Outdated
frames.append(frame) | ||
stack[0] = len(frames) - 1 | ||
|
||
stacktraces = [{"registers": {}, "frames": [dict(frame) for frame in frames]}] |
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.
Why not transform the frame to a dict
in the append
above so you don't have to loop once more?
src/sentry/profiles/task.py
Outdated
] | ||
stacktraces = [] | ||
for s in profile["sampled_profile"]["samples"]: | ||
frames = [dict(frame) for frame in s["frames"]] |
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.
Not sure why you're casting as a dict
again, it's already a dict
.
@phacops I removed the dict-casting. |
Implements handling of `instruction_addr_adjustment` and attaching appropriate per-frame attributes (`adjust_instruction_addr`) when sending stack traces to symbolicator. It implements the Sentry and Profiling side of [RFC 43](getsentry/rfcs#43) The Symbolicator side is implemented in getsentry/symbolicator#948. --------- Co-authored-by: Sebastian Zivota <loewenheim@mailbox.org>
Implements handling of
instruction_addr_adjustment
and attaching appropriate per-frame attributes when sending stack traces to symbolicator.It implements the Sentry and Profiling side of RFC 43
The Symbolicator side is implemented in getsentry/symbolicator#948.
Well,
instruction_addr_needs_adjustment
is indeed a mouthful :-D Should we use a shorter name for the flag?