Created
November 10, 2017 19:22
-
-
Save elprans/74a3ac6f883777d225e1edc54efe1a4a to your computer and use it in GitHub Desktop.
ptracer basic usage example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ptracer | |
def callback(syscall): | |
print('{}({}) -> {}'.format( | |
syscall.name, | |
', '.join(repr(arg.value) for arg in syscall.args), | |
syscall.result.text)) | |
print('Traceback:') | |
print(''.join(traceback.format_list(syscall.traceback))) | |
with ptracer.context(callback, filter=ptracer.SysCallPattern('open')): | |
# do some stuff here | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment