From: William Lee Irwin III <wli@holomorphy.com>
To: Peter Chubb <peterc@gelato.unsw.edu.au>
Cc: akpm@digeo.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.6.0-test4 -- add context switch counters
Date: Tue, 26 Aug 2003 23:54:35 -0700 [thread overview]
Message-ID: <20030827065435.GV4306@holomorphy.com> (raw)
In-Reply-To: <16204.520.61149.961640@wombat.disy.cse.unsw.edu.au>
On Wed, Aug 27, 2003 at 10:57:44AM +1000, Peter Chubb wrote:
> Currently, the context switch counters reported by getrusage() are
> always zero. The appended patch adds fields to struct task_struct to
> count context switches, and adds code to do the counting.
> The patch adds 4 longs to struct task struct, and a single addition to
> the fast path in schedule().
Thanks, this will be useful. We're still missing a fair number of them:
struct rusage {
struct timeval ru_utime; /* user time used */
struct timeval ru_stime; /* system time used */
long ru_maxrss; /* maximum resident set size */
long ru_ixrss; /* integral shared memory size */
long ru_idrss; /* integral unshared data size */
long ru_isrss; /* integral unshared stack size */
long ru_minflt; /* page reclaims */
long ru_majflt; /* page faults */
long ru_nswap; /* swaps */
long ru_inblock; /* block input operations */
long ru_oublock; /* block output operations */
long ru_msgsnd; /* messages sent */
long ru_msgrcv; /* messages received */
long ru_nsignals; /* signals received */
long ru_nvcsw; /* voluntary context switches */
long ru_nivcsw; /* involuntary " */
};
...
case RUSAGE_SELF:
jiffies_to_timeval(p->utime, &r.ru_utime);
jiffies_to_timeval(p->stime, &r.ru_stime);
r.ru_minflt = p->min_flt;
r.ru_majflt = p->maj_flt;
r.ru_nswap = p->nswap;
break;
and we're worse off yet: "FIXME! Get the fault counts properly!" ...
AFAICT literally the only useful number here is utime/stime.
-- wli
P.S.:
The stuff in /proc/$PID/statm isn't a big deal; I've got full 2.4.x
semantics (modulo the VSZ correction) with fully O(1) algorithmic
overhead in some patch originally by bcrl I forward ported somewhere.
next prev parent reply other threads:[~2003-08-27 6:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-27 0:57 [PATCH] 2.6.0-test4 -- add context switch counters Peter Chubb
2003-08-27 1:18 ` Andrew Morton
2003-08-27 1:29 ` Mike Fedyk
2003-08-27 1:52 ` Peter Chubb
2003-08-27 7:16 ` William Lee Irwin III
2003-08-27 7:39 ` Peter Chubb
2003-08-27 7:51 ` William Lee Irwin III
2003-08-28 16:55 ` Mike Fedyk
2003-08-28 17:07 ` William Lee Irwin III
2003-08-28 17:09 ` William Lee Irwin III
2003-08-28 17:48 ` Mike Fedyk
2003-08-27 8:10 ` William Lee Irwin III
2003-08-27 1:50 ` Peter Chubb
2003-08-27 7:26 ` William Lee Irwin III
2003-11-18 1:18 ` William Lee Irwin III
2003-08-27 14:41 ` bert hubert
2003-08-27 6:54 ` William Lee Irwin III [this message]
2003-08-27 15:52 ` Larry McVoy
2003-08-27 16:01 ` William Lee Irwin III
2003-08-27 16:09 ` Larry McVoy
2003-08-27 17:57 ` William Lee Irwin III
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=20030827065435.GV4306@holomorphy.com \
--to=wli@holomorphy.com \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterc@gelato.unsw.edu.au \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.