Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp399883ybz; Wed, 29 Apr 2020 02:14:11 -0700 (PDT) X-Google-Smtp-Source: APiQypIKPzEE7C0+EIMy61ZLaZrODtefOF4XOZFFuoZ39T2JaRcQxMCndr31kRgJ3NHur7sMzJ6y X-Received: by 2002:a05:6402:30ae:: with SMTP id df14mr1441153edb.86.1588151651050; Wed, 29 Apr 2020 02:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588151651; cv=none; d=google.com; s=arc-20160816; b=Sv3c9PvL1GI9hsgoGM5k/oDOkK413SWhCTF+815MdAbeKTzLiqXLK8afzKzOGPIPwa vt8GxWsSaSyi+Cr21AMqj3iFTCtZj2xWm3eqUsIYaBSxsbtskFbPiIZpof0T223rR4nh 7T24bCReGN5MEQY5NHKhTSIi5vwA0F7COCxxv6HnKnKnRRx36e0728dxyOaI5cyGid1y /F55zy/B1lSW03XgAVMYomwEs7AAuYDOVbuHehiqKwvGAruH09ioXlGiDDTrxc16S+o+ GFV5CwM7vqlRFrehNi/wUffJ+NUPz82ycdctyXtn9qHpwcrxJf+226oWUzXrjZvyy6/0 +T+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=VIT9+Zu+p0FYVPcIY1T/0zXsg4I1Y4dXDHXeeNpCLcE=; b=QC15olplCjObDDcnduNMXTwFCJzWAsfVJlxWOPzPdRrcGYQsI3Bob5fIc+DdcgRGId /dZG2jM2Vye4XOXMfqHzRCEvDcj0mGklRmst2iFO/K6jmHBVKXvVbDoMZomsaD2tNmnv 0wN54ioGcMc2qqVa/eLqQ5fcWp1HcQaR8FXor0C7oqz6tkt0ZwBUwkkUllgWrc4R/usx Lf22jLfBoVMGn2/AimJRQ4G6ArLcpNpnE+uoiR5iQO47SRKwT03CeaH2mS/7gEcdH4ld 73YtQonH2Ic3Luq24PxDrtRrBKxXCkvxTj7xySmi/Qx53psCMId/RwBfJKqqj7TqCpLP OFMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id dn15si3027878edb.555.2020.04.29.02.13.46; Wed, 29 Apr 2020 02:14:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726685AbgD2JJe (ORCPT + 99 others); Wed, 29 Apr 2020 05:09:34 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:12356 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbgD2JJd (ORCPT ); Wed, 29 Apr 2020 05:09:33 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03T91dbP041371; Wed, 29 Apr 2020 05:09:10 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 30mfhf7c6u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Apr 2020 05:09:10 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 03T91j1i042091; Wed, 29 Apr 2020 05:09:10 -0400 Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 30mfhf7c5u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Apr 2020 05:09:09 -0400 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03T95rUL002009; Wed, 29 Apr 2020 09:09:07 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma05fra.de.ibm.com with ESMTP id 30mcu51mtc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Apr 2020 09:09:07 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03T97u0g63504810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Apr 2020 09:07:56 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8052BAE051; Wed, 29 Apr 2020 09:09:04 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2D3C3AE045; Wed, 29 Apr 2020 09:08:59 +0000 (GMT) Received: from localhost.localdomain (unknown [9.85.81.16]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 29 Apr 2020 09:08:58 +0000 (GMT) Subject: Re: [PATCH v7 3/5] powerpc/hv-24x7: Add sysfs files inside hv-24x7 device to show processor details To: Kajol Jain , acme@kernel.org, linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, sukadev@linux.vnet.ibm.com 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, mamatha4@linux.vnet.ibm.com, mark.rutland@arm.com, tglx@linutronix.de References: <20200327063642.26175-1-kjain@linux.ibm.com> <20200327063642.26175-4-kjain@linux.ibm.com> From: Madhavan Srinivasan Message-ID: Date: Wed, 29 Apr 2020 14:38:58 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200327063642.26175-4-kjain@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-29_02:2020-04-28,2020-04-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 impostorscore=0 clxscore=1015 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004290071 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/27/20 12:06 PM, Kajol Jain wrote: > To expose the system dependent parameter like total number of > sockets and numbers of chips per socket, patch adds two sysfs files. > "sockets" and "chips" are added to /sys/devices/hv_24x7/interface/ > of the "hv_24x7" pmu. > > Signed-off-by: Kajol Jain > --- > arch/powerpc/perf/hv-24x7.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c > index 9ae00f29bd21..a31bd5b88f7a 100644 > --- a/arch/powerpc/perf/hv-24x7.c > +++ b/arch/powerpc/perf/hv-24x7.c > @@ -454,6 +454,20 @@ static ssize_t device_show_string(struct device *dev, > return sprintf(buf, "%s\n", (char *)d->var); > } > > +#ifdef CONFIG_PPC_RTAS > +static ssize_t sockets_show(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + return sprintf(buf, "%d\n", physsockets); > +} > + > +static ssize_t chips_show(struct device *dev, struct device_attribute *attr, > + char *buf) > +{ > + return sprintf(buf, "%d\n", physchips); > +} > +#endif > + rtas call gives you the cores per chip too. We can expose that also with this patch?  I understand tool side patchset is using only metrics added to socket/chip information, its better to include that cores also here.. > static struct attribute *device_str_attr_create_(char *name, char *str) > { > struct dev_ext_attribute *attr = kzalloc(sizeof(*attr), GFP_KERNEL); > @@ -1100,6 +1114,10 @@ PAGE_0_ATTR(catalog_len, "%lld\n", > (unsigned long long)be32_to_cpu(page_0->length) * 4096); > static BIN_ATTR_RO(catalog, 0/* real length varies */); > static DEVICE_ATTR_RO(domains); > +#ifdef CONFIG_PPC_RTAS > +static DEVICE_ATTR_RO(sockets); > +static DEVICE_ATTR_RO(chips); > +#endif > > static struct bin_attribute *if_bin_attrs[] = { > &bin_attr_catalog, > @@ -1110,6 +1128,10 @@ static struct attribute *if_attrs[] = { > &dev_attr_catalog_len.attr, > &dev_attr_catalog_version.attr, > &dev_attr_domains.attr, > +#ifdef CONFIG_PPC_RTAS > + &dev_attr_sockets.attr, > + &dev_attr_chips.attr, > +#endif > NULL, > }; >