From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753001AbbCKNIY (ORCPT ); Wed, 11 Mar 2015 09:08:24 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:53774 "EHLO e23smtp03.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751176AbbCKNIW (ORCPT ); Wed, 11 Mar 2015 09:08:22 -0400 From: Madhavan Srinivasan To: mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linuxppc-dev@ozlabs.org, eranian@google.com, ak@linux.intel.com, srivatsa@mit.edu, Madhavan Srinivasan Subject: [RFC PATCH 0/7] powerpc/powernv: Nest Instrumentation support Date: Wed, 11 Mar 2015 18:37:06 +0530 Message-Id: <1426079233-16720-1-git-send-email-maddy@linux.vnet.ibm.com> X-Mailer: git-send-email 1.9.1 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15031113-0009-0000-0000-0000010A463F Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset enables Nest Instrumentation support on powerpc. POWER8 has per-chip Nest Intrumentation which provides various per-chip utilisation metrics like memory bandwidth, IO bandwidth and many other component metrics. Nest Instrumentation provides an interface (via PORE Engine) to configure and move the nest counter data to memory. From kernel side, OPAL Call interface is used to activate/deactivate PORE Engine for nest data collection. OPAL at boot, detects the feature, initializes it and pass on the nest units and other related information such as memory region, events supported so on, to kernel via device-tree. Patchset uses Intel's uncore framework to enable the consumption of Nest instrumentation data on powerpc. First three patches are derived from arch/x86/kernel/cpu/perf_event_intel_uncore.[c/h]. But patches differ since "box" level abstration is not implemented As a TODO, need to rework the code to reduce code duplication. Fourth patch in the series adds the OPAL call interface to kernel. Fifth patch defines a generic pmu functions to be shared by all nest pmu units. And sixth patch defines the Device-tree parsing functions to populate various structures to aid the pmu registration. Patch also explains the device-tree layout for nest counter units. Here is sample perf usage to explain the interface and values represeneted here are bogus, since platform enablement is under-developement. # ./perf list .... uncore_mcs_0/mcs_read/ [Kernel PMU event] uncore_mcs_0/mcs_write/ [Kernel PMU event] uncore_mcs_1/mcs_read/ [Kernel PMU event] uncore_mcs_1/mcs_write/ [Kernel PMU event] uncore_mcs_2/mcs_read/ [Kernel PMU event] uncore_mcs_2/mcs_write/ [Kernel PMU event] uncore_mcs_3/mcs_read/ [Kernel PMU event] uncore_mcs_3/mcs_write/ [Kernel PMU event] ... [root@ltctul57a-p1 perf]# ./perf stat -e 'uncore_mcs_0/mcs_read/' -e 'uncore_mcs_0/mcs_write/' -a sleep 1 Performance counter stats for 'system wide': 64.00 MiB/s uncore_mcs_0/mcs_read/ [100.00%] 64.00 MiB/s uncore_mcs_0/mcs_write/ 1.000723515 seconds time elapsed Kindly let me know you comments and feedback. Madhavan Srinivasan (7): powerpc/powernv: Data structure and macros definition powerpc/powernv: uncore foundation code powerpc/powernv: uncore cpumask and CPU hotplug powerpc/powernv: Add OPAL support for uncore pmu powerpc/powernv: Add POWER8 uncore pmu support powerpc/powernv: add support to parse dt for uncore pmu powerpc/powernv: enable uncore related file in Makefile arch/powerpc/include/asm/opal.h | 3 + arch/powerpc/perf/Makefile | 2 +- arch/powerpc/perf/uncore_pmu.c | 260 ++++++++++++++++ arch/powerpc/perf/uncore_pmu.h | 89 ++++++ arch/powerpc/perf/uncore_pmu_p8.c | 403 +++++++++++++++++++++++++ arch/powerpc/platforms/powernv/opal-wrappers.S | 1 + 6 files changed, 757 insertions(+), 1 deletion(-) create mode 100644 arch/powerpc/perf/uncore_pmu.c create mode 100644 arch/powerpc/perf/uncore_pmu.h create mode 100644 arch/powerpc/perf/uncore_pmu_p8.c -- 1.9.1