Linux-perf-users Archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Ian Rogers <irogers@google.com>
Cc: Kan Liang <kan.liang@linux.intel.com>,
	Thomas Richter <tmricht@linux.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Jing Zhang <renyu.zj@linux.alibaba.com>,
	James Clark <james.clark@arm.com>,
	Ravi Bangoria <ravi.bangoria@amd.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v5 2/6] perf Document: Sysfs event names must be lower or upper case
Date: Mon, 13 May 2024 11:54:29 -0700	[thread overview]
Message-ID: <f24eef54-e32f-41bc-b4cd-13ca83e1ea48@infradead.org> (raw)
In-Reply-To: <CAP-5=fWHrX5AgH8=62f3=a-SSqUACXX1rkDZJ-WV1RcNieeHFA@mail.gmail.com>



On 5/13/24 9:22 AM, Ian Rogers wrote:
> On Sun, May 12, 2024 at 3:08 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> Hi,
>>
>> On 5/2/24 2:35 PM, Ian Rogers wrote:
>>> To avoid directory scans in perf it is going to be assumed that sysfs
>>> event names are either lower or upper case.
>>>
>>> Signed-off-by: Ian Rogers <irogers@google.com>
>>> Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
>>> ---
>>>  .../ABI/testing/sysfs-bus-event_source-devices-events       | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/Documentation/ABI/testing/sysfs-bus-event_source-devices-events b/Documentation/ABI/testing/sysfs-bus-event_source-devices-events
>>> index 77de58d03822..e7efeab2ee83 100644
>>> --- a/Documentation/ABI/testing/sysfs-bus-event_source-devices-events
>>> +++ b/Documentation/ABI/testing/sysfs-bus-event_source-devices-events
>>> @@ -37,6 +37,12 @@ Description:       Per-pmu performance monitoring events specific to the running syste
>>>               performance monitoring event supported by the <pmu>. The name
>>>               of the file is the name of the event.
>>>
>>> +             As performance monitoring event names are case
>>> +             insensitive in the perf tool, the perf tool only looks
>>> +             for lower or upper case event names in sysfs to avoid
>>> +             scanning the directory. It is therefore required the
>>> +             name of the event here is either lower or upper case.
>>> +
>>
>> This is ambiguous to me. Is it clear to everyone else?
>>
>> "for lower or upper case event names":
>>
>> Is that a logical OR or an exclusive OR?
>> "AbC" contains lower case or upper case characters. :)
>>
>> I think the code [static bool permitted_event_name()]
>> implements an exclusive OR.
>> The code also allows event names to contain numbers AFAICT.
>> The documentation doesn't mention this.
>>
>> HTH.
>>
>>>               File contents:
>>>
>>>                       <term>[=<value>][,<term>[=<value>]]...
> 
> Sorry, this reads like a troll. Assuming good intentions, could you
> propose a fix in the form of a patch? When a word is made upper or

Sure, I'll send a patch.
No trolling here.

> lower case I believe it is generally assumed the operation applies to
> all characters within the word, but I'm happy to see ambiguity cleared
> up.
> 
> Thanks,
> Ian


-- 
#Randy
https://people.kernel.org/tglx/notes-about-netiquette
https://subspace.kernel.org/etiquette.html

  reply	other threads:[~2024-05-13 18:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 21:35 [PATCH v5 0/6] Assume sysfs event names are always the same case Ian Rogers
2024-05-02 21:35 ` [PATCH v5 1/6] perf test pmu-events: Make it clearer that pmu-events tests json events Ian Rogers
2024-05-02 21:35 ` [PATCH v5 2/6] perf Document: Sysfs event names must be lower or upper case Ian Rogers
2024-05-12 22:08   ` Randy Dunlap
2024-05-13 16:22     ` Ian Rogers
2024-05-13 18:54       ` Randy Dunlap [this message]
2024-05-02 21:35 ` [PATCH v5 3/6] perf test pmu: Refactor format test and exposed test APIs Ian Rogers
2024-05-02 21:35 ` [PATCH v5 4/6] perf test pmu: Add an eagerly loaded event test Ian Rogers
2024-05-02 21:35 ` [PATCH v5 5/6] perf test pmu: Test all sysfs PMU event names are the same case Ian Rogers
2024-05-02 21:35 ` [PATCH v5 6/6] perf pmu: Assume sysfs events are always " Ian Rogers
2024-05-03 20:09 ` [PATCH v5 0/6] Assume sysfs event names " Arnaldo Carvalho de Melo
2024-05-06 15:34 ` Thomas Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f24eef54-e32f-41bc-b4cd-13ca83e1ea48@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@amd.com \
    --cc=renyu.zj@linux.alibaba.com \
    --cc=tmricht@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).