From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755266AbdDMI2V (ORCPT ); Thu, 13 Apr 2017 04:28:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54120 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751193AbdDMI2T (ORCPT ); Thu, 13 Apr 2017 04:28:19 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B1CC1CA014 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B1CC1CA014 Date: Thu, 13 Apr 2017 10:28:15 +0200 From: Jiri Olsa To: David Carrillo-Cisneros Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Wang Nan , Andi Kleen , Adrian Hunter , Mathieu Poirier , Stephane Eranian , Paul Turner Subject: Re: [PATCH] perf/stat: fix bug in handling events in error state Message-ID: <20170413082815.GC4784@krava> References: <20170412182301.44406-1-davidcc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170412182301.44406-1-davidcc@google.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 13 Apr 2017 08:28:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 12, 2017 at 11:23:01AM -0700, David Carrillo-Cisneros wrote: > From: Stephane Eranian > > (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 . > > Signed-off-by: Stephane Eranian > Reviewed-by: David Carrillo-Cisneros Acked-by: Jiri Olsa thanks, jirka