public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Albert Cahalan <albert@users.sf.net>
To: dada1 <dada1@cosmosbay.com>
Cc: Albert Cahalan <albert@users.sourceforge.net>,
	linux-kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: "busy" load counters
Date: 13 Sep 2003 11:39:46 -0400	[thread overview]
Message-ID: <1063467585.314.9060.camel@cube> (raw)
In-Reply-To: <027d01c379d2$1d7b0380$890010ac@edumazet>

On Sat, 2003-09-13 at 04:36, dada1 wrote:
> From: "Albert Cahalan" <albert@users.sourceforge.net>
> > The feature is available, but you'll need to upgrade
> > to procps-3.1.12 and linux-2.6.0-test4 at least.
> >
> > http://www.kernel.org/pub/linux/kernel/v2.6/
> > http://procps.sf.net/
> >
> 
> With procps-3.1.12 and linux-2.6.0-test5, top and ps reports 0.00 time for
> multi-threaded programs.
> 
> It seems only the 'main' thread is now visible in /proc, and its cpu time
> dont include the cpu time of other threads...

This is correct. For now, the kernel does not report the
existance of new-style threads. I intend to deal with this
problem during the coming week.

I could use a bit of help with research. If you have access
to a non-Linux system, please let me know how the native ps
and top programs handle threads. I do know that many non-Linux
implementations will group threads together in ps output.

Ways to display all threads include:

ps -m   (Tru64, AIX)
ps m    (Tru64, AIX)
ps -T   (IRIX)
ps -L   (Solaris, UnixWare)
ps H    (FreeBSD)
ps k    (OpenBSD)
ps s    (NetBSD)

Examples:
AIX:     ps -eo pid,thcount,tid,comm
Solaris: ps -eLf
Tru64:   ps -emO THREAD

Please use procps-feedback@lists.sf.net for this data.
Here's a program you can use for testing; you may need
to compile it as "cc foo.c -lpthread".

////////////////////////////////////////////
#include <unistd.h>
#include <pthread.h>
void *hanger(void *vp){
  (void)vp;
  for(;;) pause();
}
int main(int argc, char *argv[]){
  pthread_t thread;
  (void)argc;
  (void)argv;
  pthread_create(&thread, NULL, hanger, NULL);
  hanger(NULL);
  return 0; // keep gcc happy
}
/////////////////////////////////////////////




  reply	other threads:[~2003-09-13 15:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-13  7:00 "busy" load counters Albert Cahalan
2003-09-13  8:36 ` dada1
2003-09-13 15:39   ` Albert Cahalan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-09-12  2:59 Xuân Baldauf

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=1063467585.314.9060.camel@cube \
    --to=albert@users.sf.net \
    --cc=albert@users.sourceforge.net \
    --cc=dada1@cosmosbay.com \
    --cc=linux-kernel@vger.kernel.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