public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* OProfile vs. Perfmon
@ 2003-10-07 23:27 John Levon
  2003-10-08 19:46 ` John Levon
  0 siblings, 1 reply; 2+ messages in thread
From: John Levon @ 2003-10-07 23:27 UTC (permalink / raw)
  To: linux-ia64


2.6 still lacks proper OProfile support. Will Cohen's older patch was
rejected due to issues over lack of re-use of the perfmon interface.

I've been looking briefly at perfmon just now, and wanted to gather your
thoughts on the best way this needs to be integrated.

First, what OProfile needs :

o some way to set up the counter values
o system-wide statistical profiling
o an in-kernel notification on counter overflow, and reset of the
  counter value at that point
o some way to mark each generated event by a small integer value and the
  IP saved at the time of the overflow interrupt

And that's it, I think.

Previously mentioned was the suggestion that OProfile kernel glue should
hook into perfmon's custom buffer API. Having looked briefly at it, it
seems the perfmon core has a lot of buffer management code, that we
really do not want to use, as it would massively complicate the
arch-independent oprofile core. IOW, the overflow handler would feed
straight into oprofile_add_sample().  In effect, all we need is to be
able to receive the overflow interrupts.

It certainly looks like this is easy enough.

The next issue is setting up the counters. Basically the userspace
should be using pfmlib to program the required events, and using
sys_perfmonctl to set up a system-wide session. From oprofiled's point
of view, it would basically write the pmc's, create a session, and start
the profiling.

I'm a bit baffled by the code concerning ctx_cpu in system-wide mode. Is
user-space supposed to figure out how many CPUs are up and create a
context for each of them ? In particular:

   4229         the_cpu = ctx->ctx_cpu = smp_processor_id();

I cannot make head or tail of why the CPU that happens to be running the
task calling sys_perfmonctl() is relevant at all to system-wide
profiling. Can someone explain ?

Finally, is the above summary roughly accurate, and are there any
pitfalls I might need to watch out for ?

thanks,
john

-- 
Khendon's Law:
If the same point is made twice by the same person, the thread is over.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-10-08 19:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-07 23:27 OProfile vs. Perfmon John Levon
2003-10-08 19:46 ` John Levon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox