lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 16 Jun 2021 18:27:39 +0100
From:   Will Deacon <will@...nel.org>
To:     Bjorn Helgaas <helgaas@...nel.org>
Cc:     "liuqi (BA)" <liuqi115@...wei.com>,
        Krzysztof Wilczyński <kw@...ux.com>,
        Linuxarm <linuxarm@...wei.com>, mark.rutland@....com,
        bhelgaas@...gle.com, linux-pci@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        zhangshaokun@...ilicon.com
Subject: Re: [PATCH v6 2/2] drivers/perf: hisi: Add driver for HiSilicon PCIe
 PMU

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ