Software Tuning, Performance Optimization & Platform Monitoring
Discussion around monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform monitoring
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Using PEBS facility

Jithin_Parayil_T_
232 Views

Hi,

I've been going through the documentation for the PEBS facility as described in the Intel software-developer manual vol 3b section 18.7.1.1

It is mentioned that, in order to use PEBS, software needs to initialize the DS_BUFFER_MANAGEMENT_AREA data structure in memory (in non-paged pool) and then store the beginning linear address of this data structure in the IA32_DS_AREA register. 

Is there a sample piece of code that illustrates how this data structure initialization and setting of IA32_DS_AREA register needs to be done?

I'm a bit confused about using PEBS and haven't been able to find any useful examples of how PEBS is utilized either.

It would be quite helpful if I could refer to a piece of sample code that configures and utilizes PEBS? 

I'm working on an IvyBridge machine.

Thanks in advance,

Jithin

0 Kudos
3 Replies
Thomas_W_Intel
Employee
232 Views

Jithin,

did you have a look at the pmu-tools that Andi has put on github? It contains the code to access raw PEBS information.

Best regards

Thomas

Jithin_Parayil_T_
232 Views

Thanks a lot Thomas!

I went through the pebs-grabber module in the pmu-tools repo and it cleared a lot of doubts.

However, I ran into an issue while trying to use the module. 

Following are the commands I used to build the code and use it (I followed these commands from the comments mentioned in pebs-grabber.c):

1. make [KDIR=/lib/modules/3.13.0-46-generic/build]

2. insmod pebs-grabber.ko

3. perf record -e cycles:p,pebs_v1,pebs\_v2 ../../a.out 

The third command hits an error:

invalid or unsupported event: 'cycles:p,pebs_v1,pebs_v2'

Run 'perf list' for a list of valid events

Have I missed something?

Thanks,

Jithin

Mike_U_
Beginner
232 Views

 

I am also trying to use this toolset.

I can get the simple-pebs driver compiled and installed.

when I try to follow the above instructions to get the pebs-grabber module installed, it fails.

dmesg says:

pebs-grabber: PEBS version 2

pebs-grabber: Cannot register kprobe: -2

this is with kernel linux-4.2.0-19

 

Reply