Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1719835imm; Thu, 21 Jun 2018 01:07:38 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJpE8+y2KMAzV92ey6GrUJjHJ1kXOw/tdj/421sXj98j1yFVR6NBhSbewfvkvoAjuxa5hrp X-Received: by 2002:a63:b256:: with SMTP id t22-v6mr1320714pgo.101.1529568458611; Thu, 21 Jun 2018 01:07:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529568458; cv=none; d=google.com; s=arc-20160816; b=JS4F65oyC0NuuYVN0LGN5MeTL9vqCRvyATl/4Kt5SIB3tpD+W+PTn0haSUwRmjBZTA z13kLQ2W/Bj55yyncxJw1xhmSpdd8zZI3gXl/VmptCGY3/nWDuWdvBa+wajPQG/jp2yh W9xy2fd8fO7YGa5A5SbXq+7cdO/U8gla0boua500IWVFqYmpKzY1WxpGIacYN36iLmJR OuZuT/GkY2BAN1pV4hj9o4TCasaEtNFSGB5cHhpNvDPI0NIHNHZaX9oEPfyEz9D/RcfP bUyktOAkXLPqMzmOPxWlrrwMObAbQlCi2bz8IYXrAZjV8Vx+qSSgAkJEfXHfs8HOoJGr op3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=XRfOEtVuKtcw7wDjaGNUoP/dZEikZF2jeNyYfjcakqQ=; b=OAfrvg37rNBTAyiZHGwF4Ed6rHB96DwF3CtaWQBX2Wise1c1/lPynm4pEDLbXGpWmG OjUjDfGLQD8YOLr8L6OQrtbTNcINDHPYrjAamsBBrnQxs5kMMK9rQNxWz0ceR4Qhwme4 sW2LvwmwA+85MCTxRQwSO7jswoWF6Kvm9QmkG4PSvfBVn4X+C3rsoOJ3uXiEICh+PZ9z qQeQQNFeUIYt0wWzHXni/xS83D9k2a7KIrVNEFjqEdFdo8jO0wpdgc2PoAZCxXOfT3+F OWTq8wl/776lt9k/ScSV3l5d5vLj0bF7R0vCtYmLLQ+141rY6dkKI7Ojxtv+jJBhqri4 vk6A== 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 h1-v6si4334459pfb.70.2018.06.21.01.07.24; Thu, 21 Jun 2018 01:07:38 -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 S1754366AbeFUIFU (ORCPT + 99 others); Thu, 21 Jun 2018 04:05:20 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53230 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754296AbeFUIFR (ORCPT ); Thu, 21 Jun 2018 04:05:17 -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 w5L84uTk102777 for ; Thu, 21 Jun 2018 04:05:17 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jr5jee115-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 21 Jun 2018 04:05:16 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 21 Jun 2018 09:05:14 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 21 Jun 2018 09:05:11 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5L85AGi35586296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 21 Jun 2018 08:05:10 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B11CE11C04C; Thu, 21 Jun 2018 08:55:33 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8247811C054; Thu, 21 Jun 2018 08:55:33 +0100 (BST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 21 Jun 2018 08:55:33 +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] perf stat: Add transaction flag (-T) support for s390 Date: Thu, 21 Jun 2018 10:04:52 +0200 X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180621080452.61012-1-tmricht@linux.ibm.com> References: <20180621080452.61012-1-tmricht@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18062108-0012-0000-0000-00000281D0B7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062108-0013-0000-0000-000020B31414 Message-Id: <20180621080452.61012-4-tmricht@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-21_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-1805220000 definitions=main-1806210091 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index a4f662a462c6..aea1650cf107 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -2425,6 +2425,17 @@ 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 archiectures + * will use this approach. + */ + if (!strcmp(perf_env__arch(NULL), "s390")) { + 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