Is there an existing issue for this?
Current Behavior
Profiling native applications employing embedded Python interpreter instances with native tracking enabled (--native) yields disjoint Python stacks.
Reporters are unable to match native stack frames against Python frames, since the following check doesn't work as designed:
|
if pidx >= 0 and "_PyEval_EvalFrameDefault" in symbol: |
At least with our libpython3.11.so frame _PyEval_EvalFrameDefault is missing from the native stacks, instead only _PyEval_EvalFrame is present
The check should actually look like this:
for nidx, native_frame in enumerate(native_stack):
symbol = native_frame[0]
if pidx >= 0 and ("_PyEval_EvalFrameDefault" in symbol
or ("_PyEval_EvalFrame" in symbol
and (nidx == len(native_stack) - 1
or "_PyEval_EvalFrameDefault" not in native_stack[nidx + 1][0]))):
it additionally tries to guard against a nested call to _PyEval_EvalFrameDefault.
Expected Behavior
Python stacks are shown embedded in native stacks.
Steps To Reproduce
Too complicated to provide a small repro.
Memray Version
1.17.2
Python Version
3.11
Operating System
Linux
Anything else?
No response
Is there an existing issue for this?
Current Behavior
Profiling native applications employing embedded Python interpreter instances with native tracking enabled (
--native) yields disjoint Python stacks.Reporters are unable to match native stack frames against Python frames, since the following check doesn't work as designed:
memray/src/memray/_memray.pyx
Line 230 in 80a3baa
At least with our libpython3.11.so frame
_PyEval_EvalFrameDefaultis missing from the native stacks, instead only_PyEval_EvalFrameis presentThe check should actually look like this:
it additionally tries to guard against a nested call to _PyEval_EvalFrameDefault.
Expected Behavior
Python stacks are shown embedded in native stacks.
Steps To Reproduce
Too complicated to provide a small repro.
Memray Version
1.17.2
Python Version
3.11
Operating System
Linux
Anything else?
No response