Hi,

I have updated the GIT tree once again, this time to simplify the PMU
API.

        There is a new call:
                int pfm_get_pmu_info(pfm_pmu_t pmu, pfm_pmu_info_t *info);

        To replace:
                int pfm_pmu_present(pfm_pmu_t p);
                const char *pfm_get_pmu_desc(pfm_pmu_t pmu);
                const char *pfm_get_pmu_name(pfm_pmu_t pmu);


This way the API is very homogeneous. Examples have been updated
accordingly.


On Thu, Dec 17, 2009 at 7:52 PM, stephane eranian
<eran...@googlemail.com> wrote:
> Hello,
>
> Based on my conversation with Corey, I have been working hard to
> update libpfm to implement all the modifications we've talked about.
>
> I am glad to report that I have just updated the GIT tree with the changes.
> They are quite massive. The user API has been changed, I would say
> simplified, with fewer more compact calls.
>
> There are some new user visible features and many internal changes.
> The motivation was to:
>  - provide default unit masks for some events
>  - reinforce the unit mask combinations constraints to avoid mistakes
>  - provide the user with the description of what is actually setup
>
>
> It is possible for tools to figure out default unit masks. Here is
> an example on Intel Core with showevtinfo:
>
> PMU name : core (Intel Core)
> Name     : L2_ST
> Desc     : L2 store requests
> Code     : 0x2a
> Umask-00 : 0x40 : [SELF] : This core (DEFAULT)
> Umask-01 : 0xc0 : [BOTH_CORES] : Both cores
> Umask-02 : 0x0f : [MESI] : Any cacheline access (DEFAULT)
> Umask-03 : 0x01 : [I_STATE] : Invalid cacheline
> Umask-04 : 0x02 : [S_STATE] : Shared cacheline
> Umask-05 : 0x04 : [E_STATE] : Exclusive cacheline
> Umask-06 : 0x08 : [M_STATE] : Modified cacheline
> Modif-00 : 0x00 : [u] : monitor at priv level 1, 2, 3 (boolean)
> Modif-01 : 0x01 : [k] : monitor at priv level 0 (boolean)
> Modif-02 : 0x02 : [i] : invert (boolean)
> Modif-03 : 0x03 : [e] : edge level (boolean)
> Modif-04 : 0x04 : [c] : counter-mask in range [0-255] (integer)
>
> By typing:
>
> $ LIBPFM_VERBOSE=1 perf_examples/task -e l2_st date
> [0x514f2a event_sel=0x2a umask=0x4f os=0 usr=1 en=1 int=1 inv=0 edge=0
> cnt_mask=0] L2_ST:SELF:I_STATE:S_STATE:E_STATE:M_STATE:k=0:u=1:e=0:i=0:c=0
> PERF[type=4 val=0x514f2a e_u=0 e_k=1 e_hv=1]
> L2_ST:SELF:I_STATE:S_STATE:E_STATE:M_STATE:k=0:u=1:e=0:i=0:c=0
> Thu Dec 17 19:38:17 CET 2009
>                 495 l2_st
>
> You see that the library picked  up a default for each unit mask group
> for the event.
> If an event has unit masks which are logically grouped, then either
> there is a default for each
> group, or the user has to specify one otherwise an error is generated.
>
> There are two new API calls:
>       pfm_get_event_info(int idx, pfm_event_info_t *info);
>        pfm_get_event_attr_info(int idx, int attridx,
> pfm_event_attr_info_t *info);
>
>  They supersede the following calls (which have been removed):
>
>        const char *pfm_get_event_name(int idx);
>        const char *pfm_get_event_desc(int idx);
>        pfm_pmu_t pfm_get_event_pmu(int idx);
>        pfm_err_t pfm_get_event_code(int idx, uint64_t *code);
>
>        int pfm_get_event_nattrs(int idx);
>        const char *pfm_get_event_attr_name(int idx, int attr_idx);
>        const char *pfm_get_event_attr_desc(int idx, int attr_idx);
>        pfm_err_t pfm_get_event_attr_code(int idx, int attr_idx,
> uint64_t *code);
>        pfm_attr_t pfm_get_event_attr_type(int idx, int attr_idx);
>
>
> There are way more internal changes which help provide a much more robust
> library which ensures the user does understand what is being setup while at
> the same time making it easier to measure an event quickly.
>
> Simply pull from GIT to get the update.
> Note that the man pages have not yet been updated, but all examples
> have been.
>
> Special thanks to Corey for a fruitful discussion.
>

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to