Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758013AbcK3Pia (ORCPT ); Wed, 30 Nov 2016 10:38:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35488 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757929AbcK3PiW (ORCPT ); Wed, 30 Nov 2016 10:38:22 -0500 Date: Wed, 30 Nov 2016 16:38:19 +0100 From: Jiri Olsa To: "Liang, Kan" Cc: Andi Kleen , Peter Zijlstra , Jiri Olsa , lkml , Ingo Molnar , Michael Petlan Subject: Re: [RFC] perf/x86/intel/uncore: pmu->type->single_fixed question Message-ID: <20161130153819.GB29414@krava> References: <20161130105105.GA25720@krava> <37D7C6CF3E00A74B8858931C1DB2F07750CA46F0@SHSMSX103.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F07750CA46F0@SHSMSX103.ccr.corp.intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 30 Nov 2016 15:38:21 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2013 Lines: 53 On Wed, Nov 30, 2016 at 03:27:52PM +0000, Liang, Kan wrote: > > > > > > hi, > > > I'm trying to find out some documentation background for this part of > > > uncore code: > > > > > > --- > > > static int uncore_pmu_event_init(struct perf_event *event) { > > > ... > > > if (event->attr.config == UNCORE_FIXED_EVENT) { > > > /* no fixed counter */ > > > if (!pmu->type->fixed_ctl) > > > return -EINVAL; > > > /* > > > * if there is only one fixed counter, only the first pmu > > > * can access the fixed counter > > > */ > > > if (pmu->type->single_fixed && pmu->pmu_idx > 0) > > > return -EINVAL; > > > ... > > > --- > > > > > > that for some uncore types (those with pmu->type->single_fixed) only > > > the first pmu (code_id == 0) will allow to touch the clocktick event > > > > > > other cores boxes will not allow to open clocktick event, eventhough > > > it's announced via /sys/../events/.. > > > > > > I'm probably missing some HW logic of specific boxes that would > > > explain that, but I can't find it. > > > > The client uncore has a standalone clocktick fixed counter. It doesn't belong > > to any boxes, which is different from server uncore. > > > > But client and server uncore share the same uncore_pmu_event_init. > > So it forces that only the first box can access the fixed counter. > > > > Maybe we should create a clocktick box for client uncore to fix it. > > > > You can find the fixed counter information from 18.11.6 in latest SDM > > (Order Number: 325384-060US). > > > > There should be a Skylake client uncore document published somewhere. > > But I cannot find it from Google. Let me ask around. > > Here is the published document. > http://www.intel.com/content/www/us/en/processors/core/6th-gen-core-family-uncore-performance-monitoring-manual.html > will check, thanks a lot! jirka