Subject: correctly counting user/sys/interrupt time
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 04/08/2006 21:33:28
I'm doing some experiments using the cpu's cycle-counter to count
the time spent inside system calls (per system call).
This works, and gives some quite informative numbers...

This seems to be almost enough information to do non-statistical
user/system/interrupt time for a process.

However to do the job properly I need to add instumentation to the
interrupt and trap/fault entry/exit points.  Whereas the code in syscalls.c
is quite simple (i386), that in trap.c seems to have more exit-points
than I've had hot dinners.... and I'm not even sure hardware interrupts
go through that code at all.

Is there a reasonable place to intercept traps and hardware interrupts ?
Where does the process preemption on interrupt happen ?

	David

-- 
David Laight: david@l8s.co.uk