Reputation: 684
I am from a hardware engineering background. It is possible that an answer already exists on this website to my question.
I user certain programs as hardware engineer that are quite vast and complex. The main program relies on many smaller executables to do its job. Is there a way by which I can get a trace of what other programs it calls and with what parameters as I use the program, when they start and when they end?
The purpose is to be able to write a Python script or TCL script that will automatically carry out all those steps.
Upvotes: 1
Views: 1393
Reputation: 137587
On Linux, the simplest approach is to use strace to track all system calls, looking for the execve()
system call (which is what actually starts running another binary). There will be a lot of other output generated as most programs do quite a few system calls, so you'll need to experiment a bit to get the information you want.
# Hint: it's much easier to write the output to a file with the -o option
strace -o strace_dump.txt your_program argument_1 argument_2 ...
The equivalent on macOS is dtruss
but you should read carefully about how to make it work:
On Windows, there seems to be a few options:
Upvotes: 2