Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp799012pxj; Wed, 16 Jun 2021 13:58:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzE4+3SDHqQR0OpQFlvojtWs9tJBDlpTPcmNYJE8rOIfeN+/VwzImcHwDOqBlcnIOynxy/7 X-Received: by 2002:a6b:6b06:: with SMTP id g6mr1035377ioc.140.1623877083651; Wed, 16 Jun 2021 13:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623877083; cv=none; d=google.com; s=arc-20160816; b=sjf4oPYEPabT0QY6QYSmrCekJ1uDzvZ/nGDRogGnbH4sREr29xk3ebAhReTXYt+QHf 1NdDbzbqTMePawesZbJK15nyyRLstULj0ycXxoSEKiF3bFQGZZSXxElNe65nJeCqTPyM y9tuE8kCOBBpvtfP34aR1s6TXkTqFFpBHZ4rVdZ4BOXfu+deats7EiTIP8ETbvTPfEVF cU8gXyOoSfUbAdNrwUhv39DYITs87wn4XwX6WlnHXgaQkaUAHB+EJTJM4zRYbeOZVdff nMnp3IdFYmyKpk3wS8yQP5UXfcMRpzFZUmxM7wRElKNtAu7XWjRrLZKSrc+vUQec/i1E 47mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=r6X0YIiQHa1XDmrPCYroTBi7DELM5FlTliZagIpb4Jk=; b=ua3algCXWpFqL/4d3q66L2lB+ErBp71W3L467iBsMYVXYuUc0ydyqcDk9pSeAL1CbA 4N0KKKBUJSQlOyHK4PXIPBreTulPq7RgQny71eVfcALFRKiGkvxdQJKLWlVcMfwIMids 2QaiD+CarPMlYmMKrBYQgr4LMGVlbI3cpeskaUSe6tEyCu/aa1oZjWMSZ6L0G/dPGCZ0 PV8qEa1lIgpdG3Fv1nxT+lIw7NEIAqP+ZzsdFsrqdrteOho6OoeO5jjggB/ZBfIBS5ms fe6HKo1yxazwc+XlZPAyr0+AVKZkll/1DB0wVt8nILJa1maly/8Ti9rg5XToHG3DDaK+ O6JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Klm5REes; 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 b6si3652923ile.102.2021.06.16.13.57.49; Wed, 16 Jun 2021 13:58:03 -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=Klm5REes; 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 S234594AbhFPPZw (ORCPT + 99 others); Wed, 16 Jun 2021 11:25:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:47342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234589AbhFPPZv (ORCPT ); Wed, 16 Jun 2021 11:25:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0E7196135C; Wed, 16 Jun 2021 15:23:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623857025; bh=P9kMQ2jD1IPtWm/U0GmUTuT+zZSu3WntBzFULA8XsKs=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Klm5REesq4KWd2XEmOVEITrGliAxe44pUkUfIKAC4nsSCFZ0ktmXvJtcDd2K5biyr cci0H4xIP403/1NFLY7WOnf2Civf62LtOb0zt1osOj22vWzZDKrFRRPgu/GjYD6s0s R0uAJR/2dWKVv6ENcztuZDPByuviPG+gS2Er9WlhOeL3zqPWnGX8dxm7shgXx0ZUEh uHyHNyevBsM681rYqUHX2rzFtYqTQ3K6WnkNvmvxjUH0yMHMdBFZQN1M3YGFrONv4K 6fqLXBFAJy+82iZfxJknssnMXDJ0GA+9u4zAdd6Si+yljlNzb7yq9Jjw1DkWF1Tm8a UUOIYjeeJoeWA== Date: Wed, 16 Jun 2021 10:23:43 -0500 From: Bjorn Helgaas To: "liuqi (BA)" Cc: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Linuxarm , will@kernel.org, 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: <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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Bjorn