Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751334AbbEFNBV (ORCPT ); Wed, 6 May 2015 09:01:21 -0400 Received: from one.firstfloor.org ([193.170.194.197]:60284 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750737AbbEFNBT (ORCPT ); Wed, 6 May 2015 09:01:19 -0400 Date: Wed, 6 May 2015 15:01:16 +0200 From: Andi Kleen To: "Liang, Kan" Cc: Peter Zijlstra , "mingo@kernel.org" , "acme@infradead.org" , "eranian@google.com" , "andi@firstfloor.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V7 3/6] perf, x86: handle multiple records in PEBS buffer Message-ID: <20150506130116.GM2366@two.firstfloor.org> References: <1429517270-8079-1-git-send-email-kan.liang@intel.com> <1429517270-8079-4-git-send-email-kan.liang@intel.com> <20150505131637.GO23123@twins.programming.kicks-ass.net> <37D7C6CF3E00A74B8858931C1DB2F0770180BB27@SHSMSX103.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F0770180BB27@SHSMSX103.ccr.corp.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 831 Lines: 23 > > > + if (p->status != (1 << bit)) { > > > + u64 pebs_status; > > > + > > > + /* slow path */ > > > + pebs_status = p->status & cpuc->pebs_enabled; > > > + pebs_status &= (1ULL << MAX_PEBS_EVENTS) - 1; > > > + if (pebs_status != (1 << bit)) { > > > + perf_log_lost(event); > > > > Does it make sense to keep an error[bit] count and only log once with the > > actual number in? -- when !0 obviously. > > Yes, will do it. If you use anything but u8 for the array member it would be too large for the NMI stack, and u8 is lilkely overflow prone. Would not do it. -Andi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/