[RFC] Support for performance event sampling
William Cohen
wcohen@redhat.com
Thu Feb 18 16:29:00 GMT 2010
I have been working on PR909 and have revised the perf.c and perf.h file in the
runtime to make use of the new performance event kernel api. Given the changes
it seems easier to send the files as complete files rather than patches on the
old versions.
The perf_test2.stp is a simple example that is compiled using guru mode (-g) to
exercise the run time. Due to check that the performance event kernel api makes
the script will need to be run as root.
One difficulty is the perf_event_create_kernel_counter() allocates memory for
the event descriptor and returns a pointer to that structure. When the
performance event overflows the callback function has the following prototype:
int perf_event_overflow(struct perf_event *event, int nmi,
struct perf_sample_data *data,
struct pt_regs *regs)
For hrtimer probes one function is used to dispatch all of hrtimer related
events. Unfortunately, the approach used for the hrtimer doesn't won't work
here. the hrtimer probes embed the hrtimer struct in a struct that includes the
other useful information. So the systemtap translator will need to generate a
unique callback for each performance event.
-Will
-------------- next part --------------
A non-text attachment was scrubbed...
Name: perf.h
Type: text/x-chdr
Size: 892 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/systemtap/attachments/20100218/321c7423/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: perf.c
Type: text/x-csrc
Size: 2255 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/systemtap/attachments/20100218/321c7423/attachment-0001.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: perf_test2.stp
URL: <http://sourceware.org/pipermail/systemtap/attachments/20100218/321c7423/attachment.ksh>
More information about the Systemtap
mailing list