0

I am aware of for example the GNU profiler gprof, but I am thinking of something that can measure it on any program in a more black-box fashion where I do not have access to compiling the program myself. I also thought about ps, but that seems to only give me a snapshot. I am thinking more in terms of start-to-end run of a program.

Ideally, I would like something like:

black-box-profile [program-to-start-and-any-posible-child-processes] --outfile [report-file]
3

3 Answers 3

1

Perhaps igprof:

IgProf is a simple nice tool for measuring and analysing application memory and performance characteristics. IgProf requires no changes to the application or the build process. It currently works on Linux (ia32, x86_64).

0

One which I believe is standard on any GNU is top. It has a batch mode to send output to a file, it can monitor PIDs - that is, it can be focused on a single process. It runs in xterm or other GUI term. Manual page 'man top'

2
  • I know top but am not very experienced in its finer details. How do you invoke it to monitor a process from its start? I mean: if I start a program and then subsequently manually invoke top on it, the program may have already done a lot of things that top has not detected before I start it? May 22, 2014 at 8:33
  • 1
    Ctr+Z stops the process, and with bg you can send it to the background. If this is the only job running you do not need to know PID, fg is going to bring it to the front by default. You can start monitoring it at any of this stages - stopped or running.
    – arch-abit
    May 22, 2014 at 8:43
-1

You could use the watch command:

watch 'ps -u -p processId | tail -n 1 >>output.txt'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .