perf beauty: Hook up the x86 MSR table generator
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 26 Sep 2019 18:47:16 +0000 (15:47 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 9 Oct 2019 14:23:52 +0000 (11:23 -0300)
commitfd21834704a678a583cf294aea47c7ed3fd9d8d2
tree0f6035f68038c102328dbf85e4c1cbd92e54adef
parent693d345818e106318710ac150ae252b73765d0fa
perf beauty: Hook up the x86 MSR table generator

This way we generate the source with the table for later use by plugins,
etc.

I.e. after running:

  $ make -C tools/perf O=/tmp/build/perf

We end up with:

  $ head /tmp/build/perf/trace/beauty/generated/x86_arch_MSRs_array.c
  static const char *x86_MSRs[] = {
   [0x00000000] = "IA32_P5_MC_ADDR",
   [0x00000001] = "IA32_P5_MC_TYPE",
   [0x00000010] = "IA32_TSC",
   [0x00000017] = "IA32_PLATFORM_ID",
   [0x0000001b] = "IA32_APICBASE",
   [0x00000020] = "KNC_PERFCTR0",
   [0x00000021] = "KNC_PERFCTR1",
   [0x00000028] = "KNC_EVNTSEL0",
   [0x00000029] = "KNC_EVNTSEL1",
  $

Now its just a matter of using it, first in a libtracevent plugin.

At some point we should move tools/perf/trace/beauty to tools/beauty/,
so that it can be used more generally and even made available externally
like libbpf, libperf, libtraevent, etc.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-b3rmutg4igcohx6kpo67qh4j@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Makefile.perf