Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6830804

Browse files
committed
Python: CG trace: More logging
1 parent 3752a25 commit 6830804

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • python/tools/recorded-call-graph-metrics/src/cg_trace

python/tools/recorded-call-graph-metrics/src/cg_trace/tracer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,16 @@ def profilefunc(self, frame: FrameType, event: str, arg):
207207
if event == "call":
208208
assert frame.f_back is not None
209209
# in call, the `frame` argument is new the frame for entering the callee
210-
call = Call.from_frame(frame.f_back)
211210
callee = PythonCallee.from_frame(frame)
211+
LOGGER.debug(f"callee={callee}")
212+
call = Call.from_frame(frame.f_back)
212213

213214
if event == "c_call":
214215
# in c_call, the `frame` argument is frame where the call happens, and the
215216
# `arg` argument is the C function object.
216-
call = Call.from_frame(frame)
217217
callee = ExternalCallee.from_arg(arg)
218+
LOGGER.debug(f"callee={callee}")
219+
call = Call.from_frame(frame)
218220

219221
LOGGER.debug(f"{call} --> {callee}")
220222
self.recorded_calls.add((call, callee))

0 commit comments

Comments
 (0)