Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Mar 2002 11:26:44 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Russell Francis <frussell@p1.cs.ohiou.edu>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: determining context switching?
Message-ID:  <20020329172644.GD7197@dan.emsphone.com>
In-Reply-To: <Pine.GSO.3.96.1020329082538.25172A-100000@p2>
References:  <Pine.GSO.3.96.1020329082538.25172A-100000@p2>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Mar 29), Russell Francis said:
> I was wondering if there is a way to determine the context switching
> rate?
> 
> In /usr/include/sys/vmmeter.h the structure
> 
> struct vmmeter {
> 	u_int v_swtch;		/* context switches */
> 	...
> }
> 
> looks like what I want but I can't find a function which returns this
> data to a user land application.  Is this possible?  If so how?

Take a look at /usr/src/usr.sbin/vmstat.c.  You'll want to use sysctl()
to pull the vm.vmmeter data block, which is of type "struct vmmeter".

-- 
	Dan Nelson
	dnelson@allantgroup.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020329172644.GD7197>