Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp561638imm; Fri, 22 Jun 2018 01:09:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ8bAzIteMcylkBGKlvVjvI6yKz+HDo9yhLJdJ1NqCHFgBYE3LzzSbSXUuHMRfgjSZzYnMP X-Received: by 2002:a62:86c3:: with SMTP id x186-v6mr668808pfd.4.1529654998823; Fri, 22 Jun 2018 01:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529654998; cv=none; d=google.com; s=arc-20160816; b=kigXxaRcb/D7siWxM3DQ+ONnVh06DRlP9DIZJ9XCH2KvRLJVcFuh4os37Fr8LWE+Z7 Y2hdElxVjK/3Hov5zuzihyb1J1YfnZClnctcAgb6oBiQW6cn+pxAR9uKOVRCZIex/PfX jySl7Kl1KfSd6pTr9geN4P9DeHEagAt3xXD7hn5QaaYC7QcD7d7H2sosEFUiTjCobnX8 wk51HXZLbxcRJLe3x376x6A3kCaZWwm0KqO28hAcByTSy6J7XkzjxUr6wOOddfw+xByc dPp/Gn+yzQB1y/grlZ/BkDA74wUqgeTFcDinBo9XdQWqFW9eQWxgZrS68vjBCCFG62EE OGSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3Q8qm9rgIoAhZVs+ALVI/VOsyHhCHkm7c0iKaun1Nyg=; b=f2pVtqWCopG0Ccu1xLCQJcBPm+gOjx41BdVhieUfaSv2ogzO39cngAvYY0L8PQ8jOW LWn7X8abDTRCI4ldxOIZi/CITcKJDrL/U6aM2LrvUhNwKIBYSjpefwe1qPq5W1Wb6u/F 5PIkCW8MNpliFrOj21rwUr1f4/Grz4eLiG+4SGDHeCgXfDo4YsfQbACMEAS8jD2jmlZ1 8C5wTwcdDxcz7dN9YmtaHjgbGG1xzqj6mkURulKwYhVDIZtDMr6XH/V22trfxE3ICUrk iK0qwefZb/y72WgwPeKTvJConyGUuqku9Ch+1k2HCwwCnfQcr/dyhT3zQcIEz7FEjWUY zLHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3-v6si6848693plp.506.2018.06.22.01.09.44; Fri, 22 Jun 2018 01:09:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751406AbeFVIIH (ORCPT + 99 others); Fri, 22 Jun 2018 04:08:07 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42256 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751235AbeFVIID (ORCPT ); Fri, 22 Jun 2018 04:08:03 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5M84Igf032797 for ; Fri, 22 Jun 2018 04:08:03 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jrphqwcaq-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 22 Jun 2018 04:08:02 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Jun 2018 09:08:00 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 22 Jun 2018 09:07:57 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5M87ur131588390 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 22 Jun 2018 08:07:56 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A91F42047; Fri, 22 Jun 2018 09:07:56 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1F6304204C; Fri, 22 Jun 2018 09:07:56 +0100 (BST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 22 Jun 2018 09:07:56 +0100 (BST) From: Thomas Richter 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 Subject: [PATCH 4/4 v2] perf stat: Add transaction flag (-T) support for s390 Date: Fri, 22 Jun 2018 10:07:50 +0200 X-Mailer: git-send-email 2.16.4 X-TM-AS-GCONF: 00 x-cbid: 18062208-0028-0000-0000-000002D3AB38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062208-0029-0000-0000-0000238AF9BB Message-Id: <20180622080750.25545-1-tmricht@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-22_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806220092 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org perf stat command line flag -T to display transaction counters is currently supported for x86 only. Add support for s390. It is based on the metrics flag -M transaction using the architecture dependend json files This requires a metric named transaction in the json files for the platform. As suggested by Andi Kleen, this is the new approach to support transactions counters. Other architectures will follow. Output before: [root@p23lp27 perf]# ./perf stat -T -- sleep 1 Cannot set up transaction events [root@p23lp27 perf]# Output after: [root@s35lp76 perf]# ./perf stat -T -- ~/mytesttx 1 >/tmp/111 Performance counter stats for '/root/mytesttx 1': 1 tx_c_tend # 13.0 transaction 1 tx_nc_tend 11 tx_nc_tabort 0 tx_c_tabort_special 0 tx_c_tabort_no_special 0.001070109 seconds time elapsed [root@s35lp76 perf]# Suggested-by: Andi Kleen Signed-off-by: Thomas Richter Reviewed-by: Hendrik Brueckner --- tools/perf/builtin-stat.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index a4f662a462c6..c8e2c5a1692f 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -2425,6 +2425,18 @@ static int add_default_attributes(void) if (transaction_run) { struct parse_events_error errinfo; + /* Handle -T as -M transaction. Once platform specific metrics + * support has been added to the json files, all archictures + * will use this approach. To determine transaction support + * on an architecture test for such an alias. + */ + if (pmu_have_event("cpum_cf", "TX_NC_TEND")) { + struct option opt = { .value = &evsel_list }; + + return metricgroup__parse_groups(&opt, "transaction", + &metric_events); + } + if (pmu_have_event("cpu", "cycles-ct") && pmu_have_event("cpu", "el-start")) err = parse_events(evsel_list, transaction_attrs, -- 2.14.3