Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp926162pxj; Wed, 16 Jun 2021 17:26:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz65LhSoLYLlVYEvUP454mQIhze2fte4rr7JC6o+KD3Zp+tUgh0b8xj5xF9ksOiu93LphRf X-Received: by 2002:a17:906:5289:: with SMTP id c9mr2151390ejm.342.1623889591054; Wed, 16 Jun 2021 17:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623889591; cv=none; d=google.com; s=arc-20160816; b=0xZ8iFeMamETMbyDsNsrDkOc01xSZdbNoLPzaE2i3S8gIQ1Zc6L7FvG3LS+Is/H5GX EJDYi7oJ3Tsx4CsJwYh0T9EpFk71Uixe4XNGrz18XExz0NC2vzGRWRF6gLhHS07GgOH0 CUtQJPLT94HcmzWqsIvEDIQVMRdFy1dBzdd+zGGpaBpY2Avschb5dhkBMrzkN51dLmeA lpqShHhTZ5aeRO/omirNLl30ccbgNfY7aDWpe2Jvt8WS4VBbqoouZerVEmlyoWwaFAoR nx30BK9r1aW4Nl9nX7fHBsZgrftWqegJdnZ8l5+Cxi3NxM8XE4D/Q6HRHaHxHjGWnlMK DUTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7Ab2F8JSjlYnCzJirFssWWHEoD0T3BtbQJRhUI5LREI=; b=gHErw683gvQVpYNbCHUMYQzbmxDIk14f/oBlHtvkxihi/thXfneln7mXaHVzEgM22Z zaMqLoyI184EIj+Mly4QdWhNJ/mPqI0n6hBI3B36fumyxgrdJpixgMJbNfUvmLReA4rv AK5gHduEJRu/XMTbfMkLD6i2P2bbXavPIkHxkcPTWyntlbDYvIAmie8aHYa5IStZ0ZO+ Ci1bdmNLoh9Wghkpb6N/cRv69Yg/mv4dLY1pbKRN+b+T65qGM/LwB6Iupzhiz13bySqt X9QMN0bjggChA2I5Nb8/LXh9ToJw6n35uOHGj/o9gc4lYxsIHx6vYAiSHuKRzVwQexn7 q8dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gLrPfuXg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx16si3345167edb.256.2021.06.16.17.25.56; Wed, 16 Jun 2021 17:26:31 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gLrPfuXg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231251AbhFPR3v (ORCPT + 99 others); Wed, 16 Jun 2021 13:29:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:49086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbhFPR3v (ORCPT ); Wed, 16 Jun 2021 13:29:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 73D4160D07; Wed, 16 Jun 2021 17:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623864465; bh=DOHk4jFxa0NKi1FRc0HymIfKoP5GJ5H3EDosFnFv5Js=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gLrPfuXgXvISAFK/Xj3+3dMcYQ5Y+BoJFpphr24AQUF3EzaPFFzeEYNguSozK4i2L IO8wv/q/84ImD66N3hh6pumYPGdcd7PMwFgoE8ti2l1OwM4bTQ/HgYTjukAF5YIIF+ gLxtazSVeY/wcbQoVVllYASxgJlT7HYXAq7FpBARhcovkECI7vhDTUqHs1ZNVl+4t/ D7VYtaxspe5ZwwuYyBkWhks2ojHGEePp0o2nWDlI+ab/zKC7amfUPoLzrL0wgNc8A4 np/EwmWDPlxr6DjaF/KKCMdRAUYNlVmF/H/6gt7I7bnsaS1Dp9cX4yfiN363C0fPrZ bzea0zQym0dEw== Date: Wed, 16 Jun 2021 18:27:39 +0100 From: Will Deacon To: Bjorn Helgaas Cc: "liuqi (BA)" , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Linuxarm , mark.rutland@arm.com, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, zhangshaokun@hisilicon.com Subject: Re: [PATCH v6 2/2] drivers/perf: hisi: Add driver for HiSilicon PCIe PMU Message-ID: <20210616172739.GA23280@willie-the-truck> References: <20210616152343.GA2977964@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210616152343.GA2977964@bjorn-Precision-5520> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 16, 2021 at 10:23:43AM -0500, Bjorn Helgaas wrote: > On Wed, Jun 16, 2021 at 09:09:40AM +0800, liuqi (BA) wrote: > > On 2021/6/12 7:33, Krzysztof Wilczyński wrote: > > > > > +static ssize_t hisi_pcie_event_sysfs_show(struct device *dev, > > > > + struct device_attribute *attr, char *buf) > > > > +{ > > > > + struct dev_ext_attribute *eattr; > > > > + > > > > + eattr = container_of(attr, struct dev_ext_attribute, attr); > > > > + > > > > + return sysfs_emit(buf, "config=0x%lx\n", (unsigned long)eattr->var); > > > > +} > > > > > > I am not that familiar with the perf drivers, thus I might be completely > > > wrong here, but usually for sysfs objects a single value is preferred, > > > so that this "config=" technically would not be needed, unless this is > > > somewhat essential to the consumers of this attribute to know what the > > > value is?  What do you think? > > > > "config=" is a supported for userspace tool, it is a kind of alias, so > > cannot be remover here, thanks. > > I don't understand this part. This is brand-new functionality for the > kernel, so there's no requirement to maintain compatibility for > existing userspace tools. > > If there's a similar sysfs show function for other perf drivers, and > you need to be compatible with *that*, fine. But if this is merely > about being compatible with userspace that uses out-of-tree kernel > functionality, that's not a real factor. Right, I think this is standard for all perf drivers as it is how the perf tool figures out how to select a given event in the perf_event_attr (which has a 'config' field, which is what this refers to). Will