From: Maynard Johnson <maynardj@us...> - 2013-01-07 20:30:55
I'm starting a new thread on this topic (initially reported by me on July 30, 2012, but most recently mentioned in my Jan 2 posting, subject "Re: [PATCH] Fix operf default unit mask handling").
I need your help/advice on how to fix the following problem:
The extra/named unit mask stuff is pretty badly broken right now insofar as named default unit masks (and possibly others?) -- as I reported in my July 30 2012 posting (subject "Duplicated unit mask values without "extra" field are not working"), to which I never got a response. Profiling (with either operf or opcontrol) is not possible with unit masks whose hex value is non-unique (thus, has a name), but have no "extra" parameter. Lots of default unit masks fall into this category for the newer Intel processors. For example:
On i386/sandybridge, we have the following unit mask definitions for uops_issued:
uops_issued: (counter: all)
Number of Uops issued (min count: 2000000)
Unit masks (default 0x1)
0x01: any Number of Uops issued by the Resource Allocation Table (RAT) to the Reservation
0x01: stall_cycles cycles no uops issued by this thread. (extra: inv cmask=1)
First problem is that the default unit mask value of 0x1 is ambiguous. Is the default supposed to be 'any' or 'stall_cycles'?
Secondly, issuing the command 'operf -e uops_issued:2000000:any ls' will fail with:
Named unit masks not allowed for events without 'extra:' values.
And (with my patch posted on Jan 3: subject "[PATCH] Fix default unit mask when it's a bitmask, and fix error message for non-unique numerical unit mask"), issuing the command 'operf -e uops_issued:2000000:0x1 ls' fails with:
Non-unique numerical unit mask.
Please specify the unit mask using the first word of the description
If you recall, the reason we have the check for "extra:" values when using a name for unit mask is because the first word of the unit mask description (used as the symbolic name) is not universally unique for all unit masks. Of course, this implies that all new unit masks added that have "extra:" values must be verified to have a unique first word in the description compared to all other UMs with "extra:" values.
I presume the unit mask files included with oprofile are based on some existing Intel unit mask specs for the associated processor type. It seems to me the ambiguity in the default unit masks that specify a non-unique UM value would be a problem no matter what profiler you would use. Has there been any discussion within Intel on how to disambiguate these default UMs? How about adding a 'name' field for default UM entries where needed that would reference (by first word of the description) the desired unit mask value?
And as for the problem of unit masks whose hex value is non-unique but have no "extra" parameter . . . perhaps a dummy extra: value could be added.
What do you think?
This bug is being tracked via: