lkml.org 
[lkml]   [2010]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC] [PATCH procfs] Add process age
Date
On Friday 23 of July 2010 22:47:10 Davidlohr Bueso wrote:
> On Fri, 2010-07-23 at 21:35 +0300, Alexey Dobriyan wrote:
> > On Fri, Jul 23, 2010 at 01:47:51PM -0400, Davidlohr Bueso wrote:
> > > This patch exports a process's age, in seconds, adding a /proc/#/age
file.
> >
> > What for?
>
> I have not found any straight way to get the run time of a processes,
> without having to interpret the start_time entry in /proc/#/stat and
> manually subtract the uptime from it.

Agree. I thing this feature can be useful in some cases.

I have not found better than run something like this:

echo `cat /proc/uptime | awk '{print $1}'` - \
`cat /proc/$PID/stat | awk '{print $22}'`/100 | bc

> This small file simply aids the users to obtain the information easier
> and quicker. Another alternative would be to add an entry
> in /proc/#/status.
>
> Davidlohr


\
 
 \ /
  Last update: 2010-07-24 01:19    [W:0.157 / U:1.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site