linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [perfmon2] How does take use of EventName and UnitMask?
       [not found] <tencent_5D9EFCFD67548CB92638B8BA@qq.com>
@ 2011-03-17 15:43 ` Arun Sharma
  2011-03-17 21:03   ` Arun Sharma
  0 siblings, 1 reply; 3+ messages in thread
From: Arun Sharma @ 2011-03-17 15:43 UTC (permalink / raw)
  To: Easley; +Cc: perfmon2-devel, chenwj, Lin Ming, linux-perf-users

[ + Lin Ming, linux-perf-users ]

On Thu, Mar 17, 2011 at 5:35 AM, Easley <ugiwgh@gmail.com> wrote:

> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How does take use of EventName and UnitMask?
  2011-03-17 15:43 ` [perfmon2] How does take use of EventName and UnitMask? Arun Sharma
@ 2011-03-17 21:03   ` Arun Sharma
  2011-03-19 15:04     ` [perfmon2] " stephane eranian
  0 siblings, 1 reply; 3+ messages in thread
From: Arun Sharma @ 2011-03-17 21:03 UTC (permalink / raw)
  To: Easley; +Cc: linux-perf-users, Lin Ming, chenwj, perfmon2-devel

On Thu, Mar 17, 2011 at 8:43 AM, Arun Sharma <arun@sharma-home.net> wrote:
>
> 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.

diff --git a/include/perfmon/perf_event.h b/include/perfmon/perf_event.h
index 4ba6738..ef68265 100644
--- a/include/perfmon/perf_event.h
+++ b/include/perfmon/perf_event.h
@@ -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
 };

diff --git a/lib/pfmlib_intel_x86_perf_event.c
b/lib/pfmlib_intel_x86_perf_event.c
index ab282dd..b35dccd 100644
--- a/lib/pfmlib_intel_x86_perf_event.c
+++ b/lib/pfmlib_intel_x86_perf_event.c
@@ -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
diff --git a/lib/pfmlib_perf_event.c b/lib/pfmlib_perf_event.c
index 824f9a5..d2eea5e 100644
--- a/lib/pfmlib_perf_event.c
+++ b/lib/pfmlib_perf_event.c
@@ -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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [perfmon2] How does take use of EventName and UnitMask?
  2011-03-17 21:03   ` Arun Sharma
@ 2011-03-19 15:04     ` stephane eranian
  0 siblings, 0 replies; 3+ messages in thread
From: stephane eranian @ 2011-03-19 15:04 UTC (permalink / raw)
  To: Arun Sharma; +Cc: Easley, linux-perf-users, Lin Ming, chenwj, perfmon2-devel

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.


On Thu, Mar 17, 2011 at 10:03 PM, Arun Sharma <arun@sharma-home.net> wrote:
> On Thu, Mar 17, 2011 at 8:43 AM, Arun Sharma <arun@sharma-home.net> wrote:
>>
>> 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.
>
> diff --git a/include/perfmon/perf_event.h b/include/perfmon/perf_event.h
> index 4ba6738..ef68265 100644
> --- a/include/perfmon/perf_event.h
> +++ b/include/perfmon/perf_event.h
> @@ -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
>  };
>
> diff --git a/lib/pfmlib_intel_x86_perf_event.c
> b/lib/pfmlib_intel_x86_perf_event.c
> index ab282dd..b35dccd 100644
> --- a/lib/pfmlib_intel_x86_perf_event.c
> +++ b/lib/pfmlib_intel_x86_perf_event.c
> @@ -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
> diff --git a/lib/pfmlib_perf_event.c b/lib/pfmlib_perf_event.c
> index 824f9a5..d2eea5e 100644
> --- a/lib/pfmlib_perf_event.c
> +++ b/lib/pfmlib_perf_event.c
> @@ -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
> perfmon2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perfmon2-devel
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-19 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <tencent_5D9EFCFD67548CB92638B8BA@qq.com>
2011-03-17 15:43 ` [perfmon2] How does take use of EventName and UnitMask? Arun Sharma
2011-03-17 21:03   ` Arun Sharma
2011-03-19 15:04     ` [perfmon2] " stephane eranian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).