I had to hack around one thing to make perf+libpfm4 work with uncore events:

--- a/lib/pfmlib_perf_event.c
+++ b/lib/pfmlib_perf_event.c
@@ -153,7 +153,7 @@ pfmlib_perf_event_encode(void *this, const char *str, int 
dfl_plm, void *data)
 
        attr->exclude_user = !(plm & PFM_PLM3);
        attr->exclude_kernel = !(plm & PFM_PLM0);
-       attr->exclude_hv = !(plm & PFM_PLMH);
+       //attr->exclude_hv = !(plm & PFM_PLMH);

The problem is that the kernel expects exclude_hv == 0, otherwise the
perf_event_open syscall errors out. However, if I pass PFM_PLMH
pfm_get_perf_event_encoding(), I get a different error.

static int
pfm_nhm_unc_get_encoding(void *this, pfmlib_event_desc_t *e)
{
        ...
        if (e->dfl_plm != (PFM_PLM0|PFM_PLM3)) {
                DPRINT("dfl_plm must be PLM0|PLM3 with Intel uncore PMU\n");
                return PFM_ERR_INVAL;
        }
}

Perhaps there is a better answer?

 -Arun


------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
perfmon2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to