[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: determining context switching?
From:       Dan Nelson <dnelson () allantgroup ! com>
Date:       2002-03-29 17:26:44
[Download RAW message or body]

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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic