Re: [PATCH] 2.6.0-test4 -- add context switch counters

bert hubert
2003-08-27T14:41:05Z

On Tue, Aug 26, 2003 at 06:18:07PM -0700, Andrew Morton wrote:

> > always zero. The appended patch adds fields to struct task_struct to
> > count context switches, and adds code to do the counting.

> OK... Why is this useful? A bit of googling doesn't show much interest in
> it.

I'm unaware of the cost of accounting this, but I for one have had
occasions where my system was reporting 20kcs, and I had no clue which
process was causing it. After a while I learned that linuxthreads on SMP can
cause this.

> What apps should be reporting this info? /usr/bin/time?

/proc/$$/stat would also be nice.

Thanks.

--
http://www.PowerDNS.com Open source, database driven DNS Software
http://lartc.org Linux Advanced Routing & Traffic Control HOWTO