process running time
I want to find out the running time for any process over a period of time in linux i.e. how many times did the process ran in say a month and for how long each time.
- Is there any hook in the kernel which signals for any change in the kernel process table, which I can trap to check in a kernel module or else i will have to probe every sec, which is dirty ?
- Is thr a mapping between the process and the actual executable file that initiated it in the process structure ?
Any help is appreciated.
# time <command_name with arguments>
it gives time taken for execution in the order of milliseconds.
Just needing this information now and am wondering if there's a command that will allow you to do this after the fact? e.g. on the last command I just ran.
I'm building some binaries and it's taking an excessively long time and did not run the time command on the process.
I'm just curious to see how long it's going to take. I have a record of when the process started from the output of the 'ps' command, but am not sure how to track when it ends.
Thanks for any assistance,