Re: [PATCH v2] Add support for IBM Power event codes longer than sizeof int

Maynard Johnson <[email protected]>
Newsgroups gmane.linux.oprofile
Message-ID <[email protected]>
On 11/21/2014 02:22 PM, Carl Love wrote:
> Maynard:
> 
> The patch does seem to work.  It is a bit of a hack.  Not sure how well
> this will scale to future processors if we get more opcodes that don't
> fit in 32-bits.  The patch describes the code well and what is going on.
> The description should allow someone to add new event codes, if needed,
> or to understand the issues and work out a more general solution, if
> needed.
> 
Patch applied.  Thanks for the sanity check.  I'll investigate adding a check
in the code to ensure the event code from the events file is not larger than
an integer -- a check that 'make check' would execute via the libop/tests.
But in this particular case, such a check would not have caught the error
because the event codes in question in events/ppc64/power8/events had already
been improperly truncated to integer size before importing into oprofile.

-Maynard
>            Carl Love
> 
> On Fri, 2014-11-21 at 13:56 -0600, Maynard Johnson wrote:
>> Add support for IBM Power event codes longer than sizeof int
>>
>> A small number of events on newer IBM Power processors have event codes
>> that are larger than sizeof(int). Rather than change the width of the
>> event code everywhere to be a long int (which would include having to
>> change the sample file format), we have defined some internal-use-only
>> unit masks for those events. These unit masks are not shown in the ophelp
>> output, and IBM Power users should never use them in event specifications;
>> instead, they should use the usual 'null' unit mask value of '0x0' in event
>> specifications -- e.g.,
>>        PM_L1MISS_LAT_EXC_256:0x0:0:1
>>
>> See libpe_utils/op_pe_utils.cpp:_get_event_code for how these unit masks are
>> used.
>>
>> Signed-off-by: Maynard Johnson <[email protected]>
>> ---
>>  events/ppc64/power8/events     |   16 ++++++++--------
>>  events/ppc64/power8/unit_masks |    8 ++++++++
>>  libop/op_events.c              |   39 +++++++++++++++++++++++++++++++++++++--
>>  libop/op_events.h              |    2 +-
>>  libpe_utils/op_pe_utils.cpp    |   15 +++++++++++----
>>  utils/ophelp.c                 |    2 +-
>>  6 files changed, 66 insertions(+), 16 deletions(-)
[snip]


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.