Hello,

Here is an update on the current status of libpfm redesign, i.e., libpfm4.
I have been playing around with some changes both visible and internal
to take into account what we have discussed so far. In particular:

   - no more pfmlib_event_t, i.e., visible event decomposition

   - event specification with unified syntax, i.e.,
event:umask:attr1=1:umask2:attr2=10

   - no visible distinction between attributes and unit masks, everything is
called attributes

   - internally there is a layering of PMU support: hardware and OS. Either
one of those could
     be empty. For perfmon, you'll have hardware only. For PCL you'll have
both hardware and
     OS. In that case, OS implements the PCL generic SW and  HW events.

   - the listing and event info API is still returning integer, but they are
opaque identifiers. It is
     not possible to do for(i=0;  i< num_events;i++). Instead, you can use a
helper macros with
     accessor functions: for_each_event(). The same kind of opaque
identifiers is used to list and
     query  attributes.

   - attributes are always defined per event. Parsing and decomposition
happens internally in the generic
     libpfm layer. Not all events have the same set of attributes. It is up
to the developer of each PMU
     support to try and unify attributes with the same meaning, e.g. "u" on
AMD64 mean priv user 1,2,3
     same thing on Intel.

   - to make things simpler, I have modified all calls which return a
string, e.g, description of an event or
     attribute, to allocate the string internally. Thus, no need to worry
about the buffer size but you need
     to free the string whenever you are done.

   - pfm_get_event_encoding() to return raw event encoding (not PCL)

   - PCL to be handled via specific call: pfm_get_pcl_event_encoding() and
it takes struct perf_counter_attr.
     PCL definitions are in a dedicated header file.

   - I have renamed pfm_dispatch_events() to pfm_assign_events(), the input
is now an argv-style array.
     The call still takes some extra parameters which are needed on input
(list of unavailable pmcs) and on
     output (list of registers to program). I am still not too satisfied
about the output structure, it is big. The
     alternative would be to dynamically allocate just the number of
registers needed for the measurement.

Find attached the current state of pfmlib.h.

Comments welcome.

Attachment: pfmlib.h
Description: Binary data

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to