Commit-ID:  ce88f27ccc724fa8e6766fdd4140768931f42f88
Gitweb:     http://git.kernel.org/tip/ce88f27ccc724fa8e6766fdd4140768931f42f88
Author:     Sukadev Bhattiprolu <[email protected]>
AuthorDate: Thu, 15 Sep 2016 15:24:41 -0700
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 3 Oct 2016 19:58:01 -0300

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 <[email protected]>
Acked-by: Ingo Molnar <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Madhavan Srinivasan <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
Link: 
http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
 tools/perf/arch/powerpc/util/header.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/perf/arch/powerpc/util/header.c 
b/tools/perf/arch/powerpc/util/header.c
index f8ccee1..9aaa6f5 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;
+}

Reply via email to