Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757046Ab1FUScd (ORCPT ); Tue, 21 Jun 2011 14:32:33 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:65064 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756710Ab1FUScb (ORCPT ); Tue, 21 Jun 2011 14:32:31 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=wYTDA5WIjvw+TycWMfl5IwrmULib0LD0WDnvjVrOlGn+WXWprD7/FPHHk03B488vjx jykZ+aXSKzhZzM/oyM3Pla4gVTTRGUg04mElcgF+FwLBK3PO5ZHTWv4Tesk0Lp4X6gH9 /q0qrlPDuajSTpctRp+nmauDmtivgCSKx+pno= Date: Tue, 21 Jun 2011 22:32:27 +0400 From: Cyrill Gorcunov To: Stephane Eranian Cc: Peter Zijlstra , Don Zickus , Ingo Molnar , Lin Ming , Arnaldo Carvalho de Melo , Frederic Weisbecker , Vince Weaver , lkml Subject: Re: [RFC -tip] perf, x86: Add PERF_COUNT_HW_NMI_WATCHDOG event v2 Message-ID: <20110621183227.GG21641@sun> References: <1308671933.26237.183.camel@twins> <20110621164820.GC21641@sun> <20110621172319.GE21641@sun> <20110621175421.GF21641@sun> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1375 Lines: 41 On Tue, Jun 21, 2011 at 08:06:54PM +0200, Stephane Eranian wrote: ... > > If in arch/x86/kernel/cpu/perf_event.c I add a callback which > checks: > > if (netburst_host) { > attr.type = PERF_TYPE_RAW > attr.config = 0x3c > } else { > attr.type = PERF_TYPE_HARDWARE > attr.config = PERF_COUNT_HW__CPU_CYCLES > } > > I simply don't think PERF_COUNT_HW_NMI_WATCHDOG should > ever be exposed to users. yes, and peterz pointed it out as well, i agree of course. > So, you mean to put it into x86_pmu_event_init, right? How would we know if this event comes from watchdog.c or not? And what if user wanted to pass _exactly_ this crazy values to RAW event but I will threat it as a sign for nmi-watchdog event and will map it internally to P4_EVENT_EXECUTION_EVENT? Don't get me wrong, Stephane, this approach will work and it's not a problem (actually I think I would put -1ULL into config since it's kinda "icorrect" and can be treated as special one) but I think it introduce more complexity, it should not be like this. Gimme some time, probably I invent something more convenient. Cyrill -- 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/