public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Sergey V." <sftp.mtuci@gmail.com>
To: dave.bueso@gmail.com
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [RFC] [PATCH procfs] Add process age
Date: Sat, 24 Jul 2010 03:16:30 +0400	[thread overview]
Message-ID: <201007240316.30892.sftp.mtuci@gmail.com> (raw)
In-Reply-To: <1279910830.1851.5.camel@cowboy>

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

  reply	other threads:[~2010-07-23 23:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-23 17:47 [RFC] [PATCH procfs] Add process age Davidlohr Bueso
2010-07-23 18:35 ` Alexey Dobriyan
2010-07-23 18:47   ` Davidlohr Bueso
2010-07-23 23:16     ` Sergey V. [this message]
2010-07-26  7:47     ` Andi Kleen
2010-07-26 13:57       ` Davidlohr Bueso
2010-07-26 14:48         ` Andi Kleen
2010-07-26 15:10           ` Davidlohr Bueso
2010-07-28  6:56             ` Américo Wang
2010-07-30 14:58               ` Davidlohr Bueso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201007240316.30892.sftp.mtuci@gmail.com \
    --to=sftp.mtuci@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=dave.bueso@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox