diff --git a/chapters/6-Performance-Analysis-Approaches/6-4 Marker APIs.md b/chapters/6-Performance-Analysis-Approaches/6-4 Marker APIs.md index 07a35eae7e..b58d694012 100644 --- a/chapters/6-Performance-Analysis-Approaches/6-4 Marker APIs.md +++ b/chapters/6-Performance-Analysis-Approaches/6-4 Marker APIs.md @@ -15,15 +15,11 @@ Listing: Using libpfm4 marker API on the C-Ray benchmark ~~~~ {#lst:LibpfmMarkerAPI .cpp} +#include +#include - ... - /* render a frame of xsz/ysz dimensions into the provided framebuffer */ void render(int xsz, int ysz, uint32_t *fb, int samples) { ... - + pfm_initialize(); -+ + struct perf_event_attr perf_attr; + memset(&perf_attr, 0, sizeof(perf_attr)); + perf_attr.size = sizeof(struct perf_event_attr); @@ -49,9 +45,7 @@ void render(int xsz, int ysz, uint32_t *fb, int samples) { for(j=0; j