Re: [PATCH] Remove Powerpc OProfile events the kernel will reject

William Cohen <[email protected]>
Newsgroups gmane.linux.oprofile
Message-ID <[email protected]>
On 12/01/2015 11:35 AM, Carl E. Love wrote:
> On Thu, 2015-11-26 at 17:52 -0600, 大平怜 wrote:
>> Hi Carl,
>>
>>
>> I am using the commit a58c3953a1c5f5fb00b873a5e22c878f9f4d5a2d, which
>> was the latest before your patch was applied, in the git repository.
>> My machine is bare-metal POWER8, running Linux 3.16.0:
>>
>>
>> cpu : POWER8E (raw), altivec supported
>> clock : 2061.000000MHz
>> revision : 2.1 (pvr 004b 0201)
>>
>>
>> $ uname -r
>> 3.16.0-31-generic
>> $ uname -v
>> #41-Ubuntu SMP Tue Feb 10 21:05:50 UTC 2015
>> $ uname -m
>> ppc64le
>>
>>         > > The event code for  PM_DATA_ALL_FROM_RL2L3_MOD is
>>         0x62c046.  Bits 22:20
>>         > > are 2. According to the note 1 in the patch the kernel
>>         will reject any
>>         > > event with non zero bits in 22:20.  Hence it was included.
>>         I tried the
>>         > > event on my Power 8 machine:
>>
>>
>> The bits 22:20 of 0x62c046 are 6, aren't they?  By the way, in my
>> understanding,
>> any event with non zero bits in 22:20 will be rejected,
>> only when unit >= 6 && unit <= 9.  The unit (bits 15:12) of 0x62c046
>> is 0xc.
>> Hence PM_DATA_ALL_FROM_RL2L3_MOD should not be rejected.
>>
> 
> OK, I checked any yes I agree this should be unit c.  The perf code
> shouldn't be rejecting it if it is unit 0xc.  So there is something else
> causing the event to be rejected.
> 
>>
>>
>>
>>         > > ocount -e PM_DATA_ALL_FROM_RL2L3_MOD ls
>>         > > Cannot find event PM_DATA_ALL_FROM_RL2L3_MOD
>>         > > Error retrieving info for event PM_DATA_ALL_FROM_RL2L3_MOD
>>         > >
>>         > > and it was rejected.
>>
>>
>> If it was the kernel that rejected the event, the error message should
>> have been something like this:
>>
>>
>> $ ./ocount -e PM_L2_LD_MISS ls
>> perf_event_open failed with Invalid argument
>> Caught runtime error while setting up counters
>> Internal Error.  Perf event setup failed.
>> Error running ocount
>>
>>
>> Your error message simply said there was no such event, like this:
> 
> So, I grepped the error messages "Cannot find event" and "Error
> retrieving info for event", these are messages in the OProfile source
> code.  Specifically, libpe_utils/op_pe_utils.cpp.  I have started
> digging to see why the OProfile code is not finding the info.  My first
> thought is there is something missing in the libpfm.  I haven't chased
> that down.  I will try and see if I can track down why OProfile is
> having an issue with the event.  It looks like there are a few others
> that also have unit 0xc which I removed because they are not working.
> When we figure out why this event is not working it should fix a few of
> the other events as well.
> 
>                   Carl Love
> 

Hi Carl,

Which versions of libpfm are being to test out things?  RHEL7 has libpfm-4.4.0 with backported patches for a number of fixes and fedora 23 has libpfm-4.6.0.

The op_pe_utils.cpp code looks to be doing simple string compare (strncmp).  searching through the upstream libpfm git repo find:

 find -path "*.h" -exec grep ATA_ALL_FROM_RL2L3_MOD {} /dev/null \;
./lib/events/power8_events.h:#define POWER8_PME_PM_DATA_ALL_FROM_RL2L3_MOD 119
./lib/events/power8_events.h:[ POWER8_PME_PM_DATA_ALL_FROM_RL2L3_MOD ] = {
./lib/events/power8_events.h:	.pme_name = "PM_DATA_ALL_FROM_RL2L3_MOD",

Also see these lines on the current rhel7 and fedora 23 sources.

One thing that libpfm is doind is putting the initializers in specific indices of the array.  Could libpfm not be scanning to the end of the array do to some sentinel entry causing it it stop earlier in the list of power8 events?  It might be good to compile showevtinfo  in libpfm4/examples and look over the list of events that are available for the power8 to see what libpfm things is available on the machine.

What is the purpose of libpfm explicitly putting a particular power8 entry in a particular location in the event list?  Other processors in libpfm don't bother to place entries in particular locations in the array.  Elimination that placement would get rid of over 1000 lines in the power8_events.h file.

-Will





------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
oprofile-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oprofile-list
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.