1

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.

gyuunyuu
  • 526
  • 5
  • 17
  • 1
    This broad of a question seems unfit for this site, but if you're on Windows, I'd recommend using [Process Monitor](https://learn.microsoft.com/en-us/sysinternals/downloads/procmon). But again you've specified nothing except what you want, not what you know how to do or what kind of system you're working with, so people on here probably aren't going to do all the legwork for you like you want. – Random Davis Oct 02 '20 at 17:48
  • I am on a windows program. The programs are Intel Quartus and Microsemi Libero. I want to trace of what external exe they invoke and what parameters they pass to them as I use them to synthesize and compile my digital circuit designs. – gyuunyuu Oct 02 '20 at 18:05
  • 1
    "It is possible that an answer already exists" -- have you searched for it? – glenn jackman Oct 02 '20 at 20:21

1 Answers1

2

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:

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215