[issue29400] Add instruction level tracing via sys.settrace

George King report at bugs.python.org
Mon Feb 6 14:01:47 EST 2017


George King added the comment:

I'm not sure exactly, but the way I see it (for code coverage), we want to trace transitions between basic blocks. So I would define it as: each entry into a BB is traced, with a tuple of (previous_offset, current_offset). This way when a function call starts, we callback with (-1, 0), and then get a callback for every transition between BBs. The code is well covered if we observe every possible transition.

I am not clear on the precise details, e.g. regarding unconditional branches. Since for code coverage this is essentially on optimization over per-instruction mode, I intend to first work out correctness details and test cases for the coverage tool, and then once the tests solid add the optimization.

I'm happy to discuss more, but this aspect is a lower priority for me (I still have to work out remaining correctness issues with my opcode analysis). Would it make sense to split it out into a second issue?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29400>
_______________________________________


More information about the Python-bugs-list mailing list