When named unit mask support was added by Andi Kleen (Intel) in the 0.9.7 timeframe, it became possible for multiple unit masks to have the same hex value for a given event. The (only) way to disambiguate these duplicated unit mask values is to specify them by name. It was pointed out during patch reviews that OR'ing together such unit masks (for bitmask types of unit masks) was problematic. Andi asserted that bitmasks containing any of the duplicated values simly would not be supported. Unfortunately, we dropped the ball and did not document this restriction, and neither did we put any checks into the code to prevent users from doing something like the following:
On i386/sandybridge, the int_misc event has the following possible unit mask values that can be put into a bitmask:
Unit masks (default 0x40)
0x40: rat_stall_cycles Cycles Resource Allocation Table (RAT) external stall is sent to
Instruction Decode Queue (IDQ) for this thread.
0x03: recovery_cycles Number of cycles waiting to be recover after Nuke due to all other
cases except JEClear. (extra: cmask=1)
0x03: recovery_stalls_count Edge applied to recovery_cycles, thus counts occurrences.
(extra: edge cmask=1)
The event specification of int_misc:2000000:43 will be incorrectly accepted as valid even though i it is clearly ambiguous. Such unit mask bitmask specifications should be detected, and we should exit gracefully with an informative error message.
Log in to post a comment.