1

To find a performance problem I use "top" commands TIME column in cumulative mode (which is important for me because it also captures all the small executed child processes)

When any changes in the software have been made I want to see the impact e.g. after 1h.

How to reset or clear the TIME+ counter to start from the beginning?

To restart the whole system is not an option.

2 Answers 2

1

If I understand well your question, basically top command shows by default non cumulative time:

       Task_Area_defaults
       ...
        * ’S’ - Cumulative time  Off (no, dead children)
       ...

The TIME+ column itself shows CPU time by hundredths of a second, which is the same as TIME but with more granularity.

Unfortunately the only way to reset time on a particular process is restarting the process itself as Linux kernel keeps track of process creation time and CPU time it consumes during its lifetime.

Hope that helps.

1
  • Aaaah, I've tried a simple "service myProcess restart" and it works - the counter now starts from 0, Thanks
    – Achim
    Aug 16, 2013 at 10:41
2

top command is just the messenger telling you the value, the value itself comes from the OS and the process, not from the top command.

The only way to reset the time value is to restart the process.

I think the only way to make your monitoring more detailed is to try a different approach. You can use sysstat package and its sadc daemon for collecting data and sar and sa commands to give you OS/process level statistics based on those stats. You might want to get process info via snmpd and graph it with mrtg, collectdor other tool. You might want to use the Linux kernel audit framework, its auditd daemon and the various reporting tools. Anyway, time for you to think something different than the plain old top.

1
  • 1
    Wow, that is an extensive answer, thanks a lot for all the hints for newer methods. Unfortunately I'm on a small embedded Linux board, so I have to search for, compile and install all this tools before, whereas "top" is already available. Anyway: thanks!!!!!
    – Achim
    Aug 16, 2013 at 10:47

You must log in to answer this question.

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