Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Return only from the frame profiled
  • Loading branch information
pablogsal committed Dec 2, 2025
commit c5307fb62a9f63f2e79ae7efa365b03af0988e39
7 changes: 5 additions & 2 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -2006,8 +2006,11 @@ _PyEval_FrameClearAndPop(PyThreadState *tstate, _PyInterpreterFrame * frame)
{
// Update last_profiled_frame for remote profiler frame caching.
// By this point, tstate->current_frame is already set to the parent frame.
// The guarded check avoids writes when profiling is not active (predictable branch).
if (tstate->last_profiled_frame != NULL) {
// Only update if we're popping the exact frame that was last profiled.
// This avoids corrupting the cache when transient frames (called and returned
// between profiler samples) update last_profiled_frame to addresses the
// profiler never saw.
if (tstate->last_profiled_frame != NULL && tstate->last_profiled_frame == frame) {
tstate->last_profiled_frame = tstate->current_frame;
}

Expand Down
Loading