summaryrefslogtreecommitdiff
path: root/tools/perf/util/header.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-08-29 14:40:28 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-08-29 17:38:32 -0300
commita77494026309711a5f1e4b078e353cd46c2dad9f (patch)
tree25968976bb92b264a77b10cec087cf2ce4391d88 /tools/perf/util/header.c
parent108a1bb9d1d88bff47d5eccd2cf18dc09a04fb9f (diff)
downloadlwn-a77494026309711a5f1e4b078e353cd46c2dad9f.tar.gz
lwn-a77494026309711a5f1e4b078e353cd46c2dad9f.zip
perf header: Move CPUINFO_PROC to the only file where it is used
To reduce perf-sys.h and eventually nuke it. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-ars2j5m3if3gypsvkbbijucq@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r--tools/perf/util/header.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index dd2bb0861ab1..d252124f926d 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -436,7 +436,25 @@ done:
static int write_cpudesc(struct feat_fd *ff,
struct evlist *evlist __maybe_unused)
{
+#if defined(__powerpc__) || defined(__hppa__) || defined(__sparc__)
+#define CPUINFO_PROC { "cpu", }
+#elif defined(__s390__)
+#define CPUINFO_PROC { "vendor_id", }
+#elif defined(__sh__)
+#define CPUINFO_PROC { "cpu type", }
+#elif defined(__alpha__) || defined(__mips__)
+#define CPUINFO_PROC { "cpu model", }
+#elif defined(__arm__)
+#define CPUINFO_PROC { "model name", "Processor", }
+#elif defined(__arc__)
+#define CPUINFO_PROC { "Processor", }
+#elif defined(__xtensa__)
+#define CPUINFO_PROC { "core ID", }
+#else
+#define CPUINFO_PROC { "model name", }
+#endif
const char *cpuinfo_procs[] = CPUINFO_PROC;
+#undef CPUINFO_PROC
unsigned int i;
for (i = 0; i < ARRAY_SIZE(cpuinfo_procs); i++) {