Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756620AbZFWDjx (ORCPT ); Mon, 22 Jun 2009 23:39:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752561AbZFWDjl (ORCPT ); Mon, 22 Jun 2009 23:39:41 -0400 Received: from mga02.intel.com ([134.134.136.20]:32681 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752511AbZFWDjk convert rfc822-to-8bit (ORCPT ); Mon, 22 Jun 2009 23:39:40 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.42,273,1243839600"; d="scan'208";a="526963251" From: "Wang, Yong Y" To: "eranian@gmail.com" CC: Ingo Molnar , Peter Zijlstra , LKML , Paul Mackerras Date: Tue, 23 Jun 2009 11:38:36 +0800 Subject: RE: perf_counter Atom patch Thread-Topic: perf_counter Atom patch Thread-Index: Acnzd7W+LJf0q1C+SPuJ7hbMoHeBlgANx2pQ Message-ID: <9F0C1DB20AFA954FA1DA05309350433D7B2584D1@pdsmsx503.ccr.corp.intel.com> References: <7c86c4470906221326j6edbf9f3g5d65e96d86aaf7ab@mail.gmail.com> In-Reply-To: <7c86c4470906221326j6edbf9f3g5d65e96d86aaf7ab@mail.gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2445 Lines: 73 > From: stephane eranian [mailto:eranian@googlemail.com] > > I would like to better understand what makes you think > this is the case. > Because I observed that the output of 'perf stat -e 0:0 -e 0:1 -e 0:6 ' is always like below without the quirk. Performance counter stats for '': 0 cycles 0 instructions 0 bus-cycles > Perfmon is working on Atom and there, fixed counters work perfectly: > $ head -6 /proc/cpuinfo > processor : 0 > vendor_id : GenuineIntel > cpu family : 6 > model : 28 > model name : Intel(R) Atom(TM) CPU 230 @ 1.60GHz > stepping : 2 > ... My cpuinfo is below and the only difference I can see is 270 vs 230. processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 28 model name : Intel(R) Atom(TM) CPU N270 @ 1.60GHz stepping : 2 > $ pfmon -v --us-c -e > unhalted_core_cycles,unhalted_reference_cycles,instructions_retired > noploop 10 > [FIXED_CTRL(pmc16)=0xaaa pmi0=1 en0=0x2 any0=0 pmi1=1 en1=0x2 any1=0 > pmi2=1 en2=0x2 any2=0] INSTRUCTIONS_RETIRED UNHALTED_CORE_CYCLES > UNHALTED_REFERENCE_CYCLES > [FIXED_CTR0(pmd16)] > [FIXED_CTR1(pmd17)] > [FIXED_CTR2(pmd18)] > noploop for 10 seconds > 15,902,604,169 UNHALTED_CORE_CYCLES > 15,902,586,180 UNHALTED_REFERENCE_CYCLES > 7,941,842,505 INSTRUCTIONS_RETIRED > Could you pls try to revert my patch, run 'perf stat -e 0:0 -e 0:1 -e 0:6 ' and see whether the counters count or not? I tried pfmon on my atom box but it always runs into segfault. If the fixed counters work for you, I will ask Atom hw foks here in Intel why this is the case and revise the code accordingly. > > I seem to recall that what may be bogus on Atom is what is returned by > CPUID(0xa) > for the fixed counters. But they are there and they work. Thus, I > believe, the quirk > should be at the location where CPUID(0xa) is invoked not > where you've put it. > The return value of CPUID(0xa) is indeed bogus, too and there is another quirk for that in intel_pmu_init() in arch/x86/kernel/cpu/perf_counter.c x86_pmu.num_counters_fixed = max((int)edx.split.num_counters_fixed, 3); Is this what you were talking about?-- 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/