From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Alexander Yarygin <yarygin@linux.vnet.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@redhat.com>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 12/16] perf tools: Allow to use cpuinfo on s390
Date: Tue, 8 Jul 2014 16:03:00 -0300 [thread overview]
Message-ID: <1404846184-20075-13-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1404846184-20075-1-git-send-email-acme@kernel.org>
From: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
This patch defines CPUINFO_PROC for s390 and implements get_cpuid().
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/87ioneo7qh.wl%yarygin@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/arch/s390/Makefile | 1 +
| 28 ++++++++++++++++++++++++++++
tools/perf/perf-sys.h | 1 +
3 files changed, 30 insertions(+)
create mode 100644 tools/perf/arch/s390/util/header.c
diff --git a/tools/perf/arch/s390/Makefile b/tools/perf/arch/s390/Makefile
index 15130b50dfe3..744e629797be 100644
--- a/tools/perf/arch/s390/Makefile
+++ b/tools/perf/arch/s390/Makefile
@@ -2,3 +2,4 @@ ifndef NO_DWARF
PERF_HAVE_DWARF_REGS := 1
LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
endif
+LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o
--git a/tools/perf/arch/s390/util/header.c b/tools/perf/arch/s390/util/header.c
new file mode 100644
index 000000000000..9fa6c3e5782c
--- /dev/null
+++ b/tools/perf/arch/s390/util/header.c
@@ -0,0 +1,28 @@
+/*
+ * Implementation of get_cpuid().
+ *
+ * Copyright 2014 IBM Corp.
+ * Author(s): Alexander Yarygin <yarygin@linux.vnet.ibm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License (version 2 only)
+ * as published by the Free Software Foundation.
+ */
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "../../util/header.h"
+
+int get_cpuid(char *buffer, size_t sz)
+{
+ const char *cpuid = "IBM/S390";
+
+ if (strlen(cpuid) + 1 > sz)
+ return -1;
+
+ strcpy(buffer, cpuid);
+ return 0;
+}
diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h
index 5268a1481d23..937e4324ad94 100644
--- a/tools/perf/perf-sys.h
+++ b/tools/perf/perf-sys.h
@@ -54,6 +54,7 @@
#define mb() asm volatile("bcr 15,0" ::: "memory")
#define wmb() asm volatile("bcr 15,0" ::: "memory")
#define rmb() asm volatile("bcr 15,0" ::: "memory")
+#define CPUINFO_PROC "vendor_id"
#endif
#ifdef __sh__
--
1.9.3
next prev parent reply other threads:[~2014-07-08 19:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-08 19:02 [GIT PULL 00/16] perf/cor improvements and fixes Arnaldo Carvalho de Melo
2014-07-08 19:02 ` [PATCH 01/16] perf ui browser: Add ->rows to disambiguate from ->height Arnaldo Carvalho de Melo
2014-07-08 19:02 ` [PATCH 02/16] perf ui browser: Allow overriding refresh_dimensions method Arnaldo Carvalho de Melo
2014-07-08 19:02 ` [PATCH 03/16] perf hists browser: Introduce gotorc method Arnaldo Carvalho de Melo
2014-07-08 19:02 ` [PATCH 04/16] perf hists browser: Override ui_browser refresh_dimensions method Arnaldo Carvalho de Melo
2014-07-09 22:48 ` Jiri Olsa
2014-07-10 13:50 ` Arnaldo Carvalho de Melo
2014-07-08 19:02 ` [PATCH 05/16] perf hists browser: Add support for showing columns header Arnaldo Carvalho de Melo
2014-07-08 19:02 ` [PATCH 06/16] perf hists browser: Display columns header text on 'H' press Arnaldo Carvalho de Melo
2014-07-08 19:02 ` [PATCH 07/16] perf hists browser: Add ui.show-headers config file option Arnaldo Carvalho de Melo
2014-07-08 19:02 ` [PATCH 08/16] perf hists browser: Left justify column headers Arnaldo Carvalho de Melo
2014-07-08 19:02 ` [PATCH 09/16] perf kvm: Introduce HAVE_KVM_STAT_SUPPORT flag Arnaldo Carvalho de Melo
2014-07-08 19:02 ` [PATCH 10/16] perf kvm: Simplify exit reasons tables definitions Arnaldo Carvalho de Melo
2014-07-08 19:02 ` [PATCH 11/16] perf kvm: Refactoring of cpu_isa_config() Arnaldo Carvalho de Melo
2014-07-08 19:03 ` Arnaldo Carvalho de Melo [this message]
2014-07-08 19:03 ` [PATCH 13/16] perf tools: Convert open coded equivalents to asprintf() Arnaldo Carvalho de Melo
2014-07-08 19:03 ` [PATCH 14/16] perf tools: Suggest using -f to override perf.data file ownership message Arnaldo Carvalho de Melo
2014-07-08 19:03 ` [PATCH 15/16] perf trace: Add pagefault statistics Arnaldo Carvalho de Melo
2014-07-08 19:03 ` [PATCH 16/16] perf trace: Fix build on 32-bit systems Arnaldo Carvalho de Melo
2014-07-16 11:47 ` [GIT PULL 00/16] perf/cor improvements and fixes Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1404846184-20075-13-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=dsahern@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulus@samba.org \
--cc=yarygin@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox