Re: [perfmon2] [Perfapi-devel] FW: Proposed enhancement to libpfm4.
Status: Beta
Brought to you by:
seranian
From: Stephane E. <er...@go...> - 2014-06-08 19:49:24
|
On Tue, Jun 3, 2014 at 8:24 PM, Gary Mohr <Gar...@bu...> wrote: > Stephane, > > > > Attached is a libpfm4 patch for Intel x86 systems to export the constraint > masks when doing a pfm_get_event_info() call. With this change, I have > been able to get the papi_native_avail tool to show the counter constraints > at both the event and umask level. I currently works for core events but > not for uncore events. > > > > I wanted to pass this by you to see if it satisfies your “portable and > backward compatible” requirements. > > If so I will extend it to also handle the Intel uncore events. > > > The patch is okay except for one thing. It breaks the ABI. An existing program linked with libpfm.so.4 will break when likned against your version. The cntmsk field is where there was something else before. You need to change the ABI rev and handle programs linked with ABI0. > > One other question. I have been able to get PAPI to use “ > PFM_OS_PERF_EVENT_EXT” to get support for the cpu mask provided with this > mode. When this effort was started you provided me with a libpfm4 patch > file (copy attached) which looks like it adds the cpu mask to the this > mode. It appears to me like this patch is not yet committed to the head of > your GIT. Will you be able to commit this patch so that the next time PAPI > pulls a new libpfm4, the cpu mask will be included in the extended mode. > > > > Thanks > > Gary > > > > My todo list has one other thing that may affect libpfm4. I would like be > able to create an event list which includes the counter register > constraints for the events and/or umasks (when there are constraints). I > see the information already exists in the libpfm4 event tables, but I see > no way to get the information back from libpfm4. Perhaps these values > could be added as a new field in the information structures returned from > the pfm_get_event_info and pfm_get_attr_info function calls. > > > > There is currently no way to extract that constraint mask. If it were > implemented it would be via the existing pfm_get_event_info() call. I'd > like to avoid > > adding yet another call just for that. > > The reason it is not yet exposed is because nowadays on Linux it is > irrelevant because ultimately controlled by the kernel. > > Even though the user could know, it would have only a small influence on > the actual scheduling, except on a single user > > machine. > > > > Exposing this also assumes that the constraints can always be expressed as > a simple bitmask. Some events have more dynamic constraints > > which depend on what is measured on the other sibling CPUs for instance > (offcore_response_* events). > > > > I agree though that the info could help with grouping of events, should > you need this for some measurements. > > > > > > > > It would be nice if the user could see the counter constraints without > having to go find the intel/amd/??? manuals. I understand that the counter > constraints are actually enforced by the kernel and not libpfm4 but being > able to provide this information to the user would help them determine > which events can be used together. With the newer kinds of hardware, > counter constraints are becoming more common so I think additional help for > the user in this area is a good idea. > > > > Thoughts ?? > > > > Make a patch proposal to add this. > > Needs to be portable and backward compatible with what is already there. > > > |