From: Thomas Richter <tmricht@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
acme@kernel.org
Cc: brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com,
heiko.carstens@de.ibm.com,
Thomas Richter <tmricht@linux.vnet.ibm.com>
Subject: [PATCH 2/2 v2] perf stat: Add support for flag T on s390
Date: Wed, 14 Mar 2018 13:40:04 +0100 [thread overview]
Message-ID: <20180314124004.98937-2-tmricht@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180314124004.98937-1-tmricht@linux.vnet.ibm.com>
This patch adds support for command 'perf stat -T' on s390.
It adds s390 specfic counter table for transactions.
The architecture is queried and the event string for
transaction counters is constructed
depending on the s390 type and model CPU measurement
facility counter list.
Output Before:
[root@s35lp76 perf]# perf stat -T -- sleep 1
Cannot set up transaction events
[root@s35lp76 perf]#
Output after:
[root@s35lp76 perf]# ./perf stat -T -- sleep 1
Performance counter stats for 'sleep 1':
0.939985 task-clock (msec) # 0.001 CPUs utilized
2,557,145 instructions # 0.53 insn per cycle
4,785,929 cycles # 5.091 GHz
0 cpum_cf/TX_C_TABORT_NO_SPECIAL/ # 0.000 K/sec
0 cpum_cf/TX_C_TABORT_SPECIAL/ # 0.000 K/sec
0 cpum_cf/TX_C_TEND/ # 0.000 K/sec
0 cpum_cf/TX_NC_TABORT/ # 0.000 K/sec
0 cpum_cf/TX_NC_TEND/ # 0.000 K/sec
1.001934710 seconds time elapsed
[root@s35lp76 perf]#
Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
---
tools/perf/builtin-stat.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 8d7b97c708e4..943ed3648049 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -2162,10 +2162,40 @@ static struct pmu_tx_events x86_tx_events[] = {/* x86 transaction counters */
}
};
+static struct pmu_tx_events s390_tx_events[] = {/* s390 transaction counters */
+ {
+ .pmu = "cpum_cf",
+ .name = "TX_C_TABORT_NO_SPECIAL",
+ },
+ {
+ .pmu = "cpum_cf",
+ .name = "TX_C_TABORT_SPECIAL",
+ },
+ {
+ .pmu = "cpum_cf",
+ .name = "TX_C_TEND",
+ },
+ {
+ .pmu = "cpum_cf",
+ .name = "TX_NC_TABORT",
+ },
+ {
+ .pmu = "cpum_cf",
+ .name = "TX_NC_TEND",
+ },
+ {
+ .pmu = 0
+ }
+};
+
struct arch_pmu_tx_events {
const char *archname; /* Architecture name */
struct pmu_tx_events *tx; /* Architecture specific counters */
} arch_pmu_tx_events[] = {
+ {
+ .archname = "s390",
+ .tx = s390_tx_events
+ },
{
.archname = "x86",
.tx = x86_tx_events
--
2.14.3
prev parent reply other threads:[~2018-03-14 12:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 12:40 [PATCH 1/2 v2] perf stat: Rework x86 transaction counter handling Thomas Richter
2018-03-14 12:40 ` Thomas Richter [this message]
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=20180314124004.98937-2-tmricht@linux.vnet.ibm.com \
--to=tmricht@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=brueckner@linux.vnet.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=schwidefsky@de.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
all inboxes | Powered by JetHome®