Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1619372ybv; Fri, 14 Feb 2020 03:04:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyO7+2j1D1njedRBAyx5HHxirfpTJZPtzGj5Wq/0xRXahQbJvZ34khrAWJL72e5tIl1fg9c X-Received: by 2002:aca:2109:: with SMTP id 9mr1358115oiz.119.1581678263712; Fri, 14 Feb 2020 03:04:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581678263; cv=none; d=google.com; s=arc-20160816; b=hxMZP6rvqFsL7Gjwo1PpndanWoq7QXd2o0qSBIM9Xuuda8MLrAYlcNGJv6akl0SmCG c8qtNIN+Mn3zp0nLu5Uc7iQXDMQpDbKdSViV8RuEJIO/CkDNU5vtSgk0iJ4hxOMACG1J zAU66YXsx2PEebYMmp9ofhbB15v2Mj/HrrHOaUxJnj1Ug1IVEMST4VYHMngSE7F2dvMo lQXZ6adstJpyHV7hAlO12EuprKc4W1HLHPhZQPuQU26DISH8sBSAqA6PXdD3+BiR8l2T 7Qk5+/fd6AaA8oAYjR4QSBMOHg0PQN2LcyqRxikt6YEB3wyJyaY1i4I0nog6STvcq6/C zXLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:date:subject:cc:to:from; bh=BdUkljC81zH9eOdAwO7+o1MUkV087DTHQNEYJRSKId4=; b=mLHlRdWrbMB9dwl5mLyvJXjFjeryjHNCWKls/E32ZIt9whXRhFgptPt4XA0kfGMeo/ G0/b+fHcKvqVkt7uemwC3bwY3QV+T/PQ30JKMkIlTCYBO9dNAlOXXjR/zND/DQ63SNrF +rE4JQM90Q4rBgqqQ5G3NiU6iVF4cGyfobv1fKaV7Pd+zuNswcI9EpL2bcf+zXS0BfVV cxD++h3+G5yQxxUwqImWA/bFIjLi9LpZy0B77tqJMO4vcGcJV9RPJbX2apmyp7uoGniJ LN90Rn6ABQb8zwLul1nCxWKbmaBmrff5Ey72bsE1REdHoycNehyXqBS8hClsgaPkMbEI fMXA== 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 l6si2618324oti.249.2020.02.14.03.04.05; Fri, 14 Feb 2020 03:04:23 -0800 (PST) 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 S1729017AbgBNLD4 (ORCPT + 99 others); Fri, 14 Feb 2020 06:03:56 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:28130 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728807AbgBNLD4 (ORCPT ); Fri, 14 Feb 2020 06:03:56 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01EAwpLS035932 for ; Fri, 14 Feb 2020 06:03:55 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2y5g8brnm4-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 14 Feb 2020 06:03:55 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 14 Feb 2020 11:03:52 -0000 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) 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, 14 Feb 2020 11:03:47 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01EB3jRr47186200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Feb 2020 11:03:45 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8EFFDA4064; Fri, 14 Feb 2020 11:03:45 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A7BABA4054; Fri, 14 Feb 2020 11:03:40 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.199.37.109]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 14 Feb 2020 11:03:40 +0000 (GMT) From: Kajol Jain To: acme@kernel.org, linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, anju@linux.vnet.ibm.com, maddy@linux.vnet.ibm.com, ravi.bangoria@linux.ibm.com, peterz@infradead.org, yao.jin@linux.intel.com, ak@linux.intel.com, jolsa@kernel.org, kan.liang@linux.intel.com, jmario@redhat.com, alexander.shishkin@linux.intel.com, mingo@kernel.org, paulus@ozlabs.org, namhyung@kernel.org, mpetlan@redhat.com, gregkh@linuxfoundation.org, benh@kernel.crashing.org, kjain@linux.ibm.com Subject: [PATCH 0/8] powerpc/perf: Add json file metric support for the hv_24x7 socket/chip level events Date: Fri, 14 Feb 2020 16:33:27 +0530 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20021411-0028-0000-0000-000003DA7838 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20021411-0029-0000-0000-0000249EF294 Message-Id: <20200214110335.31483-1-kjain@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-14_03:2020-02-12,2020-02-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 mlxlogscore=999 lowpriorityscore=0 phishscore=0 priorityscore=1501 mlxscore=0 spamscore=0 bulkscore=0 adultscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002140090 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The hv_24×7 feature in IBM® POWER9™ processor-based servers provide the facility to continuously collect large numbers of hardware performance metrics efficiently and accurately. First patch of the patchset fix inconsistent results we are getting when we run multiple 24x7 events. Patchset adds json file metric support for the hv_24x7 socket/chip level events. "hv_24x7" pmu interface events needs system dependent parameter like socket/chip/core. For example, hv_24x7 chip level events needs specific chip-id to which the data is requested should be added as part of pmu events. So to enable JSON file support to "hv_24x7" interface, patchset expose total number of sockets and chips per-socket details in sysfs files (sockets, chips) under "/sys/devices/hv_24x7/interface/". To get sockets and number of chips per sockets, patchset adds a rtas call with token "PROCESSOR_MODULE_INFO" to get these details. Patchset also handles partition migration case to re-init these system depended parameters by adding proper calls in post_mobility_fixup() (mobility.c). Patch 6 & 8 of the patchset handles perf tool plumbing needed to replace the "?" character in the metric expression to proper value and hv_24x7 json metric file for different Socket/chip resources. Patch set also enable Hz/hz prinitg for --metric-only option to print metric data for bus frequency. Kajol Jain (8): powerpc/perf/hv-24x7: Fix inconsistent output values incase multiple hv-24x7 events run powerpc/hv-24x7: Add rtas call in hv-24x7 driver to get processor details powerpc/hv-24x7: Add sysfs files inside hv-24x7 device to show processor details Documentation/ABI: Add ABI documentation for chips and sockets powerpc/hv-24x7: Update post_mobility_fixup() to handle migration perf/tools: Enhance JSON/metric infrastructure to handle "?" tools/perf: Enable Hz/hz prinitg for --metric-only option perf/tools/pmu-events/powerpc: Add hv_24x7 socket/chip level metric events .../sysfs-bus-event_source-devices-hv_24x7 | 14 +++ arch/powerpc/perf/hv-24x7.c | 96 ++++++++++++++- arch/powerpc/platforms/pseries/mobility.c | 12 ++ arch/powerpc/platforms/pseries/pseries.h | 3 + tools/perf/arch/powerpc/util/header.c | 40 +++++++ .../arch/powerpc/power9/hv_24x7_metrics.json | 19 +++ tools/perf/util/expr.h | 1 + tools/perf/util/expr.y | 17 ++- tools/perf/util/metricgroup.c | 112 +++++++++++------- tools/perf/util/metricgroup.h | 1 + tools/perf/util/stat-display.c | 2 - tools/perf/util/stat-shadow.c | 5 + 12 files changed, 277 insertions(+), 45 deletions(-) create mode 100644 tools/perf/pmu-events/arch/powerpc/power9/hv_24x7_metrics.json -- 2.18.1