Subject: Re: user profiling improvements
To: Eduardo Horvath <eeh@turbolinux.com>
From: Ethan Solomita <ethan@geocast.com>
List: tech-kern
Date: 08/11/2000 13:44:50
Eduardo Horvath wrote:
> 
> Hm.  Arguably it would make sense to reimplement this using cycle counters
> where possible rather than sampling.
> 
	I'll start off by admitting to not knowing what cycle counters vs.
sampling means. While I'm not going to reject something I don't
understand, I've got plenty of other things that I'm working on, so when
you say "reimplement" I get nervous. 8-)

> Why do you want to count time spent sleeping waiting for an event against
> the process?
> 
> ...
>
> Then you probably want to separate iowait time from just sleeping.
> 
	I'm not sure how you separate anything in the end, since gprof just
wants to see counts in buckets which map to the PC. But I should clarify
-- I'm not suggesting counting time spent sleeping idly, only when
waiting on a wchan. That's why I use setrunnable(). And I only count
time until setrunnable is called, not time from then until the process
is resumed.

	Also, in the gprof output, it's very clear. The sleeping time gets
added to libc's read() function (as an example), and you can follow the
call graph back to your function.

> Who do you charge the time spent servicing interrupts to?  They may be
> completely unrelated to any particular process.
> 
	This is a good point -- I should look at the frame to determine is
statclock() is interrupting an interrupt or just a system call. I'll
look into that.
	-- Ethan