lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20180314124004.98937-2-tmricht@linux.vnet.ibm.com>
Date:   Wed, 14 Mar 2018 13:40:04 +0100
From:   Thomas Richter <tmricht@...ux.vnet.ibm.com>
To:     linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        acme@...nel.org
Cc:     brueckner@...ux.vnet.ibm.com, schwidefsky@...ibm.com,
        heiko.carstens@...ibm.com,
        Thomas Richter <tmricht@...ux.vnet.ibm.com>
Subject: [PATCH 2/2 v2] perf stat: Add support for flag T on s390

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@...lp76 perf]# perf stat -T -- sleep 1
Cannot set up transaction events
[root@...lp76 perf]#

Output after:
[root@...lp76 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@...lp76 perf]#

Signed-off-by: Thomas Richter <tmricht@...ux.vnet.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@...ux.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ