linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
To: mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org
Cc: ak@linux.intel.com, srivatsa@mit.edu,
	linux-kernel@vger.kernel.org, eranian@google.com,
	linuxppc-dev@ozlabs.org,
	Madhavan Srinivasan <maddy@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: [RFC PATCH 0/7] powerpc/powernv: Nest Instrumentation support
Date: Wed, 11 Mar 2015 18:37:06 +0530	[thread overview]
Message-ID: <1426079233-16720-1-git-send-email-maddy@linux.vnet.ibm.com> (raw)

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

             reply	other threads:[~2015-03-11 13:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 13:07 Madhavan Srinivasan [this message]
2015-03-11 13:07 ` [RFC PATCH 1/7] powerpc/powernv: Data structure and macros definition Madhavan Srinivasan
2015-03-11 13:07 ` [RFC PATCH 2/7] powerpc/powernv: uncore foundation code Madhavan Srinivasan
2015-03-11 13:07 ` [RFC PATCH 3/7] powerpc/powernv: uncore cpumask and CPU hotplug Madhavan Srinivasan
2015-03-11 13:07 ` [RFC PATCH 4/7]powerpc/powernv: Add OPAL support for Nest pmu Madhavan Srinivasan
2015-03-11 22:57   ` Stewart Smith
2015-03-12  8:47     ` maddy
2015-03-11 13:07 ` [RFC PATCH 5/7]powerpc/powernv: Add POWER8 specific nest pmu support Madhavan Srinivasan
2015-03-11 13:07 ` [RFC PATCH 6/7]powerpc/powernv: add support to parse dt for nest pmu Madhavan Srinivasan
2015-03-11 13:07 ` [RFC PATCH 7/7]powerpc/powernv: enable nest pmu related file in Makefile Madhavan Srinivasan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426079233-16720-1-git-send-email-maddy@linux.vnet.ibm.com \
    --to=maddy@linux.vnet.ibm.com \
    --cc=ak@linux.intel.com \
    --cc=benh@kernel.crashing.org \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=srivatsa@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).