From: tip-bot for Alexander Yarygin <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
hpa@zytor.com, mingo@kernel.org, a.p.zijlstra@chello.nl,
borntraeger@de.ibm.com, jolsa@redhat.com,
cornelia.huck@de.ibm.com, yarygin@linux.vnet.ibm.com,
dsahern@gmail.com, tglx@linutronix.de
Subject: [tip:perf/core] perf tools: Allow to use cpuinfo on s390
Date: Wed, 16 Jul 2014 12:16:46 -0700 [thread overview]
Message-ID: <tip-f8d9ccde2be4c24bfb8787af36a59a981b00a02d@git.kernel.org> (raw)
In-Reply-To: <87ioneo7qh.wl%yarygin@linux.vnet.ibm.com>
Commit-ID: f8d9ccde2be4c24bfb8787af36a59a981b00a02d
Gitweb: http://git.kernel.org/tip/f8d9ccde2be4c24bfb8787af36a59a981b00a02d
Author: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
AuthorDate: Thu, 3 Jul 2014 18:08:22 +0400
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 7 Jul 2014 16:55:24 -0300
perf tools: Allow to use cpuinfo on s390
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(+)
diff --git a/tools/perf/arch/s390/Makefile b/tools/perf/arch/s390/Makefile
index 15130b5..744e629 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 0000000..9fa6c3e
--- /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 5268a14..937e432 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__
next prev parent reply other threads:[~2014-07-16 19:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-03 13:59 [PATCH 0/4] perf kvm: Refactoring and small improvements Alexander Yarygin
2014-07-03 13:59 ` [PATCH 1/4] perf kvm: Introduce HAVE_KVM_STAT_SUPPORT flag Alexander Yarygin
2014-07-16 19:15 ` [tip:perf/core] " tip-bot for Alexander Yarygin
2014-07-03 13:59 ` [PATCH 2/4] perf kvm: Simplify of exit reasons tables definitions Alexander Yarygin
2014-07-16 19:16 ` [tip:perf/core] perf kvm: Simplify " tip-bot for Alexander Yarygin
2014-07-03 13:59 ` [PATCH 3/4] perf kvm: Refactoring of cpu_isa_config() Alexander Yarygin
2014-07-16 19:16 ` [tip:perf/core] " tip-bot for Alexander Yarygin
2014-07-03 14:08 ` [PATCH 4/4] perf: Allow to use cpuinfo on s390 Alexander Yarygin
2014-07-16 19:16 ` tip-bot for Alexander Yarygin [this message]
2014-07-03 14:47 ` [PATCH 0/4] perf kvm: Refactoring and small improvements Christian Borntraeger
2014-07-03 15:22 ` Arnaldo Carvalho de Melo
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=tip-f8d9ccde2be4c24bfb8787af36a59a981b00a02d@git.kernel.org \
--to=tipbot@zytor.com \
--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=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.