perf powerpc: Support CPU ID matching for Powerpc
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Thu, 15 Sep 2016 22:24:41 +0000 (15:24 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 3 Oct 2016 22:58:01 +0000 (19:58 -0300)
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>
tools/perf/arch/powerpc/util/header.c

index f8ccee132867c566dabf4bb727e9c17d78637894..9aaa6f5a93479f107c83123febfe8f8a8a59b63e 100644 (file)
@@ -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;
+}