summaryrefslogtreecommitdiffstats
path: root/tools/perf/arch/powerpc
diff options
context:
space:
mode:
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>2016-09-15 15:24:41 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-10-03 19:58:01 -0300
commitce88f27ccc724fa8e6766fdd4140768931f42f88 (patch)
tree6d9f15179bf5c799acac1c79396e79c6311d5f8f /tools/perf/arch/powerpc
parent933f82ff72d7d1641663462f61f3056ee1fe3f8b (diff)
downloadtalos-op-linux-ce88f27ccc724fa8e6766fdd4140768931f42f88.tar.gz
talos-op-linux-ce88f27ccc724fa8e6766fdd4140768931f42f88.zip
perf powerpc: Support CPU ID matching for Powerpc
Implement code that returns the generic CPU ID string for Powerpc. This will be used to identify the specific table of PMU events to parse/compare user specified events against. Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Acked-by: Ingo Molnar <mingo@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/r/1473978296-20712-5-git-send-email-sukadev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/arch/powerpc')
-rw-r--r--tools/perf/arch/powerpc/util/header.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/arch/powerpc/util/header.c b/tools/perf/arch/powerpc/util/header.c
index f8ccee132867..9aaa6f5a9347 100644
--- a/tools/perf/arch/powerpc/util/header.c
+++ b/tools/perf/arch/powerpc/util/header.c
@@ -32,3 +32,14 @@ get_cpuid(char *buffer, size_t sz)
}
return -1;
}
+
+char *
+get_cpuid_str(void)
+{
+ char *bufp;
+
+ if (asprintf(&bufp, "%.8lx", mfspr(SPRN_PVR)) < 0)
+ bufp = NULL;
+
+ return bufp;
+}
OpenPOWER on IntegriCloud