Skip to contentSkip to conversation

How does take use of EventName and UnitMask?

perfmon2 Arun Sharma 2 participants 3 messages Mar 17, 2011 – Mar 19, 2011 1 message not in the archive Library code

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

[ + Lin Ming, linux-perf-users ]

Quoted 1 line · Easley

EventNum and UmaskValue is control bits, but I can't find which address of msr to wirte.

Try Ming Lin's kernel patch here:

http://thread.gmane.org/gmane.linux.kernel/1071064

and my patch to link the perf tool with libpfm4:

http://article.gmane.org/gmane.comp.linux.perfmon2.devel/2912

Stephane has disabled the uncore event support in libpfm4 (since the patch is still not upstream yet). But by uncommenting 2-3 lines of code, you should be able to get uncore events working.

-Arun

#2 lore raw
Quoted 5 lines · Arun Sharma

Stephane has disabled the uncore event support in libpfm4 (since the patch is still not upstream yet). But by uncommenting 2-3 lines of code, you should be able to get uncore events working.

This is the patch I'm using for uncore events with perf + libpfm4.

include/perfmon/perf_event.h +1 -0
index 4ba6738..ef68265 100644
@@ -46,6 +46,7 @@ enum perf_type_id {
        PERF_TYPE_HW_CACHE      = 3,
        PERF_TYPE_RAW           = 4,
        PERF_TYPE_BREAKPOINT    = 5,
+       PERF_TYPE_UNCORE        = 6,
        PERF_TYPE_MAX
 };
 
(quoted diff) +0 -0

b/lib/pfmlib_intel_x86_perf_event.c
index ab282dd..b35dccd 100644

lib/pfmlib_intel_x86_perf_event.c +0 -0
@@ -81,10 +81,7 @@ pfm_intel_nhm_unc_get_perf_encoding(void *this,

pfmlib_event_desc_t *e)

        if (ret != PFM_SUCCESS)
                return ret;

-#if 0
- /* XXX: uncomment when uncore support is upstream */

        attr->type = PERF_TYPE_UNCORE;
-#endif
        attr->config = e->codes[0];
        /*
         * uncore measures at all priv levels
lib/pfmlib_perf_event.c +0 -0
index 824f9a5..d2eea5e 100644
@@ -157,7 +157,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);

        __pfm_vbprintf("PERF[type=%x config=0x%"PRIx64" config1=0x%"PRIx64
                        " e_u=%d e_k=%d e_hv=%d period=%"PRIu64" freq=%d"

-Arun

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d

#3 lore raw

Arun,

I have pushed a patch that enables uncore support in libpfm4. This is based on Lin's patch. It takes care of the priv level issue.

Quoted 65 lines · Arun Sharma
Quoted 5 lines · Arun Sharma

Stephane has disabled the uncore event support in libpfm4 (since the patch is still not upstream yet). But by uncommenting 2-3 lines of code, you should be able to get uncore events working.

This is the patch I'm using for uncore events with perf + libpfm4.

include/perfmon/perf_event.h +1 -0
index 4ba6738..ef68265 100644
@@ -46,6 +46,7 @@ enum perf_type_id {
        PERF_TYPE_HW_CACHE      = 3,
        PERF_TYPE_RAW           = 4,
        PERF_TYPE_BREAKPOINT    = 5,
+       PERF_TYPE_UNCORE        = 6,

       PERF_TYPE_MAX
 };

lib/pfmlib_intel_x86_perf_event.c +0 -3
index ab282dd..b35dccd 100644
@@ -81,10 +81,7 @@ pfm_intel_nhm_unc_get_perf_encoding(void *this,
 pfmlib_event_desc_t *e)
        if (ret != PFM_SUCCESS)
                return ret;
 
-#if 0
-       /* XXX: uncomment when uncore support is upstream */
        attr->type = PERF_TYPE_UNCORE;
-#endif
        attr->config = e->codes[0];
        /*

        * uncore measures at all priv levels

lib/pfmlib_perf_event.c +1 -1
index 824f9a5..d2eea5e 100644
@@ -157,7 +157,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);
 

       __pfm_vbprintf("PERF[type=%x config=0x%"PRIx64" config1=0x%"PRIx64 " e_u=%d e_k=%d e_hv=%d period=%"PRIu64" freq=%d"

 -Arun

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
perfmon2-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel