Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1620798ybv; Fri, 14 Feb 2020 03:05:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxcQXh8BDSJIIGsNDXT+d9TvOTAKHd2ES2AyvWmHABEsjDwtpQINMqtEWV36wBOtL2t2JkN X-Received: by 2002:a9d:395:: with SMTP id f21mr1804167otf.67.1581678345097; Fri, 14 Feb 2020 03:05:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581678345; cv=none; d=google.com; s=arc-20160816; b=UUKqPTvc3yDwPDrghrckKDwehsgE9YTYeS1WCY3rX8TFa2VYYiF/eoee30rP/a6jzS abWPn0bYWzW0oBewI/krGa+VFQ7A/V6Q5zw6QC9VFOgGuKjroVp7eZzGRTXSciYKnAki 6ZTSeGwoKvrfxqbw0jqv2O89bw+3Cj7P+b3OG1fwHkFYtNr1tGvA9ZFAXXVqQP72LiX1 aHr7hUotElVG1iZ9rT3/MlM3NRXZcUff212l0EOCY5FrBhIdLSPcyL7S6O3jOu0EQFx+ zfOGIlJyJTDo0eGl2449bCNUy6x2xxggcNTqTVtwpeKTZhDLfp7+8Ot3ayCWnS6nvuo6 GBWA== 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=R0UmeIWJf0puw7538L4YPMVDUjHcctmqVmh5qZieSaw=; b=giyOfdMknUwdOGrkzogOTYQJy+IvsARBu9/uEKT/TpTekv/KS05vlmqN5JLkny0+o7 1+bADa/PTVPDhKbV1re6EzvmR/3FV9BFPlD2LqsSQTO0UhgvMl+cvy9P6rRiI3w2IMkV w0Tz2IhJFDgX5zEB9cU/aGOfI7ijS9EwIuRj49AuqIDc6I3SAyNe3+RboIMrdii/TKfM wENXyREc45VkYjyZcHoJ9DerDao2ua7qsqS/n9uzRolxHRSJ1URlX+qVOltAQ3xYmACt 0OtNjsVQea02mrZ/VXcydTEjLDCnUEaKKxiZKPE+i3uWjEh6cLZeYmrxO5u01vM11Ftd zabQ== 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 o18si2402405oic.18.2020.02.14.03.05.32; Fri, 14 Feb 2020 03:05:45 -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 S2387455AbgBNLEM (ORCPT + 99 others); Fri, 14 Feb 2020 06:04:12 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33808 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387424AbgBNLEL (ORCPT ); Fri, 14 Feb 2020 06:04:11 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01EAxVrn044476 for ; Fri, 14 Feb 2020 06:04:10 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2y4wuuwhke-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 14 Feb 2020 06:04:09 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 14 Feb 2020 11:04:08 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp02.uk.ibm.com (192.168.101.132) 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:04:03 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01EB41iA65208568 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Feb 2020 11:04:01 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A7262A4054; Fri, 14 Feb 2020 11:04:01 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7ABC7A405C; Fri, 14 Feb 2020 11:03:56 +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:56 +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 3/8] powerpc/hv-24x7: Add sysfs files inside hv-24x7 device to show processor details Date: Fri, 14 Feb 2020 16:33:30 +0530 X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200214110335.31483-1-kjain@linux.ibm.com> References: <20200214110335.31483-1-kjain@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20021411-0008-0000-0000-00000352CBE5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20021411-0009-0000-0000-00004A737858 Message-Id: <20200214110335.31483-4-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 phishscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 mlxscore=0 impostorscore=0 bulkscore=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 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 4248a9d1e2ed..9e486ec7269f 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 + 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, }; -- 2.18.1