Gary,

Sorry for late reply. Was on vacation for some time.

On Thu, Aug 28, 2014 at 4:24 PM, Gary Mohr <gary.m...@bull.com> wrote:

>  Hi Stephane,
>
>
>
> We have run into an error condition which I do not think is handled
> properly.  If I run the following command, I get this error:
>
>
>
>
>
> papi_command_line snbep_unc_cbo0::UNC_C_TOR_INSERTS:MISS_ALL:cpu=0
> snbep_unc_cbo0::UNC_C_TOR_INSERTS:NID_MISS_ALL:nf=0x1:cpu=0
>
>
>
> PAPI Error: Error!  short read!
>
> PAPI Error: read: fd:  4, tid: 0, cpu: 0, ret: 0
>
> PAPI Error: Error Code -3,A System/C library call failed: No such file or
> directory.
>
> System error in PAPI_stop: No such file or directory
>
> Successfully added: snbep_unc_cbo0::UNC_C_TOR_INSERTS:MISS_ALL:cpu=0
>
> Successfully added:
> snbep_unc_cbo0::UNC_C_TOR_INSERTS:NID_MISS_ALL:nf=0x1:cpu=0
>
> command_line.c                       FAILED
>
> Line # 122
>
>
>
>
>
> When looking in the libpfm4 event tables for snbep_unc_cbo, it looks like
> the MISS_ALL and NID_MISS_ALL masks are not allowed to both be used at the
> same time.  But when looking at the PAPI debug output, I find the following
> behavior:
>
>
>
>
>
> Papi called libpfm4 to encode the event
> ‘snbep_unc_cbo0::UNC_C_TOR_INSERTS:MISS_ALL:cpu=0’ successfully.
>
> Papi called libpfm4 to encode the event
> ‘snbep_unc_cbo0::UNC_C_TOR_INSERTS:NID_MISS_ALL:nf=0x1:cpu=0’ successfully.
>
>
>
> Papi called the kernel to open the first event (in a disabled state) and
> the kernel returned fd 3.
>
> Papi called the kernel to open the second event (in a disabled state) and
> the kernel returned fd 4 (the open calls did not use event grouping).
>
>
>
> Papi called the kernel for the first event to enable event counting (ioctl
> fd 3) and the kernel did not return -1 (what Papi checks for an error).
>
> Papi called the kernel for the second event to enable event counting
> (ioctl fd 4) and the kernel did not return -1.
>
>
>
> The papi_command_line tool did some work.
>
>
>
> Papi called the kernel for the first event to disable event counting
> (ioctl fd 3) and the kernel did not return -1.
>
> Papi called the kernel for the second event to disable event counting
> (ioctl fd 4) and the kernel did not return -1.
>
>
>
> Papi called the kernel for the first event to read the result (read fd 3)
> and the kernel returned 8 bytes with a value of 1562.
>
> Papi called the kernel for the second event to read the result (read fd 4)
> and the kernel returned 0 bytes which papi considers an error (caused short
> read).
>
>
>
> Given this sequence of events, I understand why neither PAPI or libpfm4
> detected that these events cannot be used at the same time.  But it seems
> to me like the kernel should have been able to detect this when the second
> event was opened and return an error.  This would have been a much better
> time to report the error than when trying to read the results of an event
> that the kernel said was successfully opened.
>
>
>
Those events can be measured together, I think. If it was not possible AND
you had put them in the same event group, then when opening the 2nd
event you would have received an error.
So I think the problem is elsewhere in this case.
When I try your cmdline with perf stat -a -e .... and without the cpu=XX I
do not get any error.
Which kernel is this running on?



>  Do you think this is something that the kernel could/should handle
> better ?
>
> We run rhel6 which is pretty old now, does a current version of the kernel
> handle this pair of events better ?
>
> Is there a way that PAPI or libpfm4 could have detected this invalid
> combination of events before doing the kernel opens ?
>
>
>
I think the event can be masured together. You are not using the opcode
matcher. The nf filter will
only apply to the NID_* events.


>  Thanks
>
> Gary
>
>
>
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to