python-hunter icon indicating copy to clipboard operation
python-hunter copied to clipboard

Can we trace all open() calls?

Open qlibp opened this issue 1 year ago • 3 comments

As said in the doc, there's a flag named builtin in Filtering session, but I still can't get it tracing open() calls with the following snippet.

import hunter
hunter.trace(hunter.Q(builtin=True, function="open", action=hunter.CallPrinter))

f = open("test_trace.py", "r")
lines = f.readlines()
print(lines[0])
f.close()

qlibp avatar Feb 19 '24 06:02 qlibp

Well it would appear that particular function doesn't emit any trace events. May I ask what are you trying to trace, or what the goals are?

ionelmc avatar May 01 '24 14:05 ionelmc

Actually I have similar needs. I want to trace the arguments of eval() and exec(). They are also builtin functions. I cannot find call in the trace about these two functions.

fubuki8087 avatar Jun 27 '24 12:06 fubuki8087

would like

Well it would appear that particular function doesn't emit any trace events. May I ask what are you trying to trace, or what the goals are?

would like to trace all accessed files in python rather than using strace

qlibp avatar Jun 27 '24 13:06 qlibp