mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Amerigo Wang <xiyou.wangcong@gmail.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Amerigo Wang <xiyou.wangcong@gmail.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Tatsuhiro Aoshima <tatsu.pc@gmail.com>,
	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>,
	albert@users.sf.net
Subject: Re: [PATCH] proc: let task status file print utime and stime.
Date: Mon, 17 Aug 2009 16:34:04 +0800	[thread overview]
Message-ID: <20090817083404.GC5868@cr0.nay.redhat.com> (raw)
In-Reply-To: <20090817153253.52bf9c69.kamezawa.hiroyu@jp.fujitsu.com>

On Mon, Aug 17, 2009 at 03:32:53PM +0900, KAMEZAWA Hiroyuki wrote:
>On Mon, 17 Aug 2009 14:32:02 +0800
>Amerigo Wang <xiyou.wangcong@gmail.com> wrote:
>
>> On Mon, Aug 17, 2009 at 03:22:06PM +0900, KAMEZAWA Hiroyuki wrote:
>> >On Mon, 17 Aug 2009 14:18:21 +0800
>> >Amerigo Wang <xiyou.wangcong@gmail.com> wrote:
>> >
>> >> Ah... in fact, I expected 'ps' can report this, however, surprisingly
>> >> it doesn't have this, at least not what I expect (unless I miss
>> >> something obvious).
>> >> 
>> >> 
>> >> >
>> >> >In another thinking, in old days, /proc/<pid>/stat was enough because most of
>> >> >users uses scanf() or some C langage to read fixed-format data.
>> >> >/proc/<pid>/status is useful for some script languages which has 
>> >> >good parser per line. 
>> >> >
>> >> 
>> >> Well... I think this work should be left to 'ps', e.g.
>> >> 
>> >>   ps -o pid,utime,stime
>> >> 
>> >> 'ps' is responsible to read /proc/<pid>/stat for the user.
>> >> 
>> >Hmm, personally, I don't like 'ps' and its unified filter.
>> >
>> >When I want to know status of a process of PID,
>> ># ps -o pid,utime,stime  PID
>> >
>> >'ps' scans *all* process and filter PID. (try #strace ps)
>> >I like checking /proc/<pid>/<something> without 'ps' in an environment
>> >where thousands of processes runs.
>> 
>> Sure, we already have '-p' for 'ps', e.g.
>> 
>>  ps -p 1 -o pid,user,comm
>> 
>> Enjoy. :-)
>I said it's verrrrry slow.


Hmm, for me it looks like that 'ps' should be fixed...

I haven't checked the source code of 'ps', but I don't think
this is O(n) if '-p' is specified. If we just use something
like 'test -d /proc/<pid>' it would be O(1).


>
>> 
>> Anyway, I would like to see 'ps' to have 'utime,stime' field, on
>> my machine, its output for 'utime,stime' looks wrong.
>> 
>> Maybe we should Cc procps developers?
>ya, maybe. it's good to be CCed.


Done. Albert?


>
>
>BTW, why all other status
>Name:   cat
>State:  R (running)
>Tgid:   7068
>Pid:    7068
>PPid:   6115
>TracerPid:      0
>Uid:    500     500     500     500
>Gid:    500     500     500     500
>FDSize: 256
>Groups: 500
>
>are allowed to be duplicated ?


I don't know... :( I still prefer to use 'ps'.

  reply	other threads:[~2009-08-17  8:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-15 14:36 KOSAKI Motohiro
2009-08-17  2:38 ` Amerigo Wang
2009-08-17  2:42   ` KAMEZAWA Hiroyuki
2009-08-17  6:18     ` Amerigo Wang
2009-08-17  6:22       ` KAMEZAWA Hiroyuki
2009-08-17  6:32         ` Amerigo Wang
2009-08-17  6:32           ` KAMEZAWA Hiroyuki
2009-08-17  8:34             ` Amerigo Wang [this message]
2009-08-18 16:27               ` KOSAKI Motohiro
2009-08-29  7:20 Tatsuhiro Aoshima

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=20090817083404.GC5868@cr0.nay.redhat.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=albert@users.sf.net \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tatsu.pc@gmail.com \
    --cc=yoshfuji@linux-ipv6.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

all inboxes | Powered by JetHome®