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

From: bert hubert
Date: Wed Aug 27 2003 - 09:42:35 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/