Re: [PATCH] perf/stat: fix bug in handling events in error state
From: Jiri Olsa
Date: Thu Apr 13 2017 - 04:28:28 EST
On Wed, Apr 12, 2017 at 11:23:01AM -0700, David Carrillo-Cisneros wrote:
> From: Stephane Eranian <eranian@xxxxxxxxxx>
>
> (This is a patch has been sitting in the Intel CQM/CMT driver series
> for a while, despite not depend on it. Sending it now independently
> since the series is being discarded.)
>
> When an event is in error state, read() returns 0
> instead of sizeof() buffer. In certain modes, such
> as interval printing, ignoring the 0 return value
> may cause bogus count deltas to be computed and
> thus invalid results printed.
>
> This patch fixes this problem by modifying read_counters()
> to mark the event as not scaled (scaled = -1) to force
> the printout routine to show <NOT COUNTED>.
>
> Signed-off-by: Stephane Eranian <eranian@xxxxxxxxxx>
> Reviewed-by: David Carrillo-Cisneros <davidcc@xxxxxxxxxx>
Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>
thanks,
jirka