Re: [PATCH 2/6] perf stat: Fix metrics calculation with event qualifiers

From: Namhyung Kim
Date: Wed Apr 08 2015 - 09:29:51 EST


Hi Jiri and Andi,

On Tue, Apr 07, 2015 at 11:25:15PM +0200, Jiri Olsa wrote:
> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> Currently in perf IPC and other metrics cannot be directly shown
> separately for both user and kernel in a single run. The problem was
> that the metrics matching code did not check event qualifiers.
>
> With this patch the following case works correctly.
>
> % perf stat -e cycles:k,cycles:u,instructions:k,instructions:u true
>
> Performance counter stats for 'true':
>
> 531,718 cycles:k
> 203,895 cycles:u
> 338,151 instructions:k # 0.64 insns per cycle
> 105,961 instructions:u # 0.52 insns per cycle
>
> 0.002989739 seconds time elapsed
>
> Previously it would misreport the ratios because they were matching
> the wrong value.

This patch reminds me of following change: