[RFC] Support for performance event sampling

Josh Stone jistone@redhat.com
Wed Feb 24 23:17:00 GMT 2010


On 02/18/2010 08:27 AM, William Cohen wrote:
> Due to check that the performance event kernel api makes the script
> will need to be run as root.

Or "echo 0 >/proc/sys/kernel/perf_counter_paranoid", but that opens it
up for everyone...

That's only for cpu-global counters though.  We could also use
task_finder and attach to user-owned processes, which requires just
ptrace-equivalent privilege.

> One difficulty is the perf_event_create_kernel_counter() allocates
> memory for the event descriptor and returns a pointer to that
> structure. [...] So the systemtap translator will need to generate a 
> unique callback for each performance event.

You have the saved perf_event*, so a shared callback could do a linear
scan to find the matching probepoint.

Josh



More information about the Systemtap mailing list