mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-135953: Simplify GC markers in the tachyon profiler (#141666)
This commit is contained in:
parent
cc6b62ac56
commit
274a26cca8
3 changed files with 9 additions and 23 deletions
|
|
@ -186,7 +186,6 @@ static PyStructSequence_Field ThreadInfo_fields[] = {
|
|||
{"thread_id", "Thread ID"},
|
||||
{"status", "Thread status (flags: HAS_GIL, ON_CPU, UNKNOWN or legacy enum)"},
|
||||
{"frame_info", "Frame information"},
|
||||
{"gc_collecting", "Whether GC is collecting (interpreter-level)"},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
|
|
@ -2726,8 +2725,6 @@ unwind_stack_for_thread(
|
|||
goto error;
|
||||
}
|
||||
|
||||
int gc_collecting = GET_MEMBER(int, gc_state, unwinder->debug_offsets.gc.collecting);
|
||||
|
||||
// Calculate thread status using flags (always)
|
||||
int status_flags = 0;
|
||||
|
||||
|
|
@ -2827,18 +2824,10 @@ unwind_stack_for_thread(
|
|||
goto error;
|
||||
}
|
||||
|
||||
PyObject *py_gc_collecting = PyBool_FromLong(gc_collecting);
|
||||
if (py_gc_collecting == NULL) {
|
||||
set_exception_cause(unwinder, PyExc_RuntimeError, "Failed to create gc_collecting");
|
||||
Py_DECREF(py_status);
|
||||
goto error;
|
||||
}
|
||||
|
||||
// py_status contains status flags (bitfield)
|
||||
PyStructSequence_SetItem(result, 0, thread_id);
|
||||
PyStructSequence_SetItem(result, 1, py_status); // Steals reference
|
||||
PyStructSequence_SetItem(result, 2, frame_info); // Steals reference
|
||||
PyStructSequence_SetItem(result, 3, py_gc_collecting); // Steals reference
|
||||
|
||||
cleanup_stack_chunks(&chunks);
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue