From d720f94f7067139a2e76b6733684368a127dfe42 Mon Sep 17 00:00:00 2001
From: Phil Mucci <phil@minimalmetrics.com>
Date: Mon, 20 Jun 2016 03:53:18 -0600
Subject: [PATCH] Power8 support for PLM U/K/H

---
 lib/pfmlib_power8.c     | 1 +
 lib/pfmlib_power_priv.h | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/lib/pfmlib_power8.c b/lib/pfmlib_power8.c
index ea964b7..d30f036 100644
--- a/lib/pfmlib_power8.c
+++ b/lib/pfmlib_power8.c
@@ -42,6 +42,7 @@ pfmlib_pmu_t power8_support={
 	.pmu			= PFM_PMU_POWER8,
 	.pme_count		= LIBPFM_ARRAY_SIZE(power8_pe),
 	.type			= PFM_PMU_TYPE_CORE,
+	.supported_plm		= POWER8_PLM,
 	.num_cntrs		= 4,
 	.num_fixed_cntrs	= 2,
 	.max_encoding		= 1,
diff --git a/lib/pfmlib_power_priv.h b/lib/pfmlib_power_priv.h
index 04f1437..8b5c3ac 100644
--- a/lib/pfmlib_power_priv.h
+++ b/lib/pfmlib_power_priv.h
@@ -97,6 +97,9 @@ typedef struct {
 #define PV_POWER8NVL	0x004c
 #define PV_POWER8	0x004d
 
+#define POWER_PLM (PFM_PLM0|PFM_PLM3)
+#define POWER8_PLM (POWER_PLM|PFM_PLMH)
+
 extern int pfm_gen_powerpc_get_event_info(void *this, int pidx, pfm_event_info_t *info);
 extern int pfm_gen_powerpc_get_event_attr_info(void *this, int pidx, int umask_idx, pfm_event_attr_info_t *info);
 extern int pfm_gen_powerpc_get_encoding(void *this, pfmlib_event_desc_t *e);
-- 
1.8.3.1

