Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9000276ybl; Fri, 17 Jan 2020 04:48:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxLBjX4TUYdv8fL7xMiigEyRnfLxXQeDshGuXurBvvEgzpdEN8aD0wsLZ41Gw0XLD6ygIfq X-Received: by 2002:a9d:7618:: with SMTP id k24mr5999249otl.65.1579265297936; Fri, 17 Jan 2020 04:48:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579265297; cv=none; d=google.com; s=arc-20160816; b=dy7BK8Mpf2MQpBklK9UPFsfc2ZkafBeh8QONmNEWZxkcKZN+0umOXCy4lyL2z/X8NI OSV7ssBM0fUGdvnEF0I2fOVbAblt5Zjosc58KjNc/3jSS3i7jDSdaFnV6G4NO/HUBjIn uMIGgsV0ZMWG64LtTmWwiqOP2TnhmJ08TrZHl1sytES8ZOqa//tTpEzXc8+H+RbL3KIS e6ZAiQKgC3TDtGjJinMmq3HZIB+HSFEoESbXzX3elmnCTQ54Ec9mMjEJjiin1eFWMYpA gLkj1bggjwp5VSsiDagQZ1SRVvQjn+xKiX1P5m3pFIY+xAiDLBdlRjViMD9DKJwK4owb UwAg== 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:references:in-reply-to:date:subject:cc:to:from; bh=r4Dk1iDmPer2ge5jfwrPJ0gNG5ZiiIvSP4dTo5F6fzI=; b=yUuDNGKFf9Rli55RGdj55lJifspsS4thE11kxPRfBCG8WpTaNRydyWOidzcI96eXuU wdeESDg74ivt84mgkJOLjbYnVcH/6CnjnFp7s1sd31VIoV9d/tUD/CGaW1RBNraME/dP sZP1iNXxc+GGe6OBQDfXMmiDv5vi5BOav6Fcn96n9Y0sTy0fuF0TxFevShibuAfKPwFS 8jd/t1GcpANgIHUWuDI/g8DwjVG4f/DP8oS8WUms5hGUqrqUKy/mLxDMq6igdnBOojeo XK0z3hYD0C4TQo+U80hK3p58czudtlyXs+aiiD3wqAwHTS8vz6qQE6YCdtebEuOpAcyO S6Nw== 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 u191si12868661oia.86.2020.01.17.04.48.05; Fri, 17 Jan 2020 04:48:17 -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 S1726942AbgAQMq4 (ORCPT + 99 others); Fri, 17 Jan 2020 07:46:56 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52790 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726559AbgAQMq4 (ORCPT ); Fri, 17 Jan 2020 07:46:56 -0500 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00HCbfnw132606 for ; Fri, 17 Jan 2020 07:46:54 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2xk0qvm0pe-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 Jan 2020 07:46:54 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 Jan 2020 12:46:52 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) 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) Fri, 17 Jan 2020 12:46:46 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 00HCkja658065088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Jan 2020 12:46:45 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2063EAE04D; Fri, 17 Jan 2020 12:46:45 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 45D60AE051; Fri, 17 Jan 2020 12:46:40 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.199.44.232]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 17 Jan 2020 12:46:40 +0000 (GMT) From: Kajol Jain To: acme@kernel.org, mpe@ellerman.id.au, 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, kjain@linux.ibm.com, benh@kernel.crashing.org Subject: [RFC 2/6] powerpc/hv-24x7: Add sysfs files inside hv-24x7 device to show processor details Date: Fri, 17 Jan 2020 18:16:16 +0530 X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200117124620.26094-1-kjain@linux.ibm.com> References: <20200117124620.26094-1-kjain@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20011712-0012-0000-0000-0000037E43C6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20011712-0013-0000-0000-000021BA7A9F Message-Id: <20200117124620.26094-3-kjain@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-01-17_03:2020-01-16,2020-01-17 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 mlxscore=0 impostorscore=0 malwarescore=0 phishscore=0 adultscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001170101 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 64d9fc526d68..e498824eb4f7 100644 --- a/arch/powerpc/perf/hv-24x7.c +++ b/arch/powerpc/perf/hv-24x7.c @@ -450,6 +450,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 + static struct attribute *device_str_attr_create_(char *name, char *str) { struct dev_ext_attribute *attr = kzalloc(sizeof(*attr), GFP_KERNEL); @@ -1096,6 +1110,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, @@ -1106,6 +1124,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, }; -- 2.18.1