Hi Rayson,
> Is it possible to provide an interface for other providers to read
> data from the hardware performance counters?
>
> The current CPC provider gives us hardware "events", but not the
> actual value of the counters. Say if I am interested in the number of
> cache misses caused a function, I can''t even with the support of
the
> CPC provider, as I don''t have access to the values of the counters
> inside the PID provider...
The short answer to your initial question is, no. The current
version of the provider employs the overflow mechanism present
on processors to allow you to sample after ''n'' events have
occurred. With enough samples you should be able to generate a
reasonably accurate picture of what code generated the most events.
To do what you are asking for would require virtualisation of the
counters for each thread and I didn''t want to do this in the
first implementation. I didn''t think the extra plumbing required
was actually worth it as there are solutions available now
and with the current cpc provider that you could use. If you
just want to analyse events for threads in a single process then
the collector/analyzer that comes with Sun Studio does an excellent
job of that. A slightly more cumbersome route (and less pretty) would
be to create a processor set just for your given application and run
it in there. You could then use the cpc provider and predicate using
the processor set id, i.e:
cpc:::PAPI_l2_ldm-user-50000
/pset == $1/
{
@[uaddr(arg1)] = count();
}
END
{
printa("%-60A %@d\n", @);
}
I know it''s not quite what you asked for but it should help build a
good picture of event distribution in your code.
Hope this helps in some way.
Jon.