I have a Python script which uses os.system()
to call certain commands an Linux machine.
These commands might be standard commands such as ls
, grep
etc., or some custom commands present on that machine.
I want to trace what syscalls get called by these commands, but within the Python script itself. So, once I do:
os.system(command)
I want to return a list of all system calls made by that particular command.
So that I can iterate over the list and filter for any syscalls I need to investigate. Ideally, what I am planning to do is create a dictionary which will help me map the parameters that I gave to my command above, and what went in to the syscall eventually.
Is there a nice Pythonic way to do this?
Have a look at python p-trace
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.