Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1709395lqo; Sun, 12 May 2024 15:08:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXfsAftV67KIio1uyu/RL89GebsKvJrQlHA2u2Qrr2shOKB+igzWsgiJSQ63+sRBtOo13MtdO4QdLMaTtKIluaeFnHK/WOHOcHLmigYNg== X-Google-Smtp-Source: AGHT+IFeK/VVEKQcjBZnYBg8AStljmTF5vHJjq+xOG7aoDQFy8QRbXZq3D64GTctwJKfqxTgK8k5 X-Received: by 2002:a17:903:32c4:b0:1e4:2879:3a38 with SMTP id d9443c01a7336-1ef43f51f37mr116544385ad.47.1715551728572; Sun, 12 May 2024 15:08:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715551728; cv=pass; d=google.com; s=arc-20160816; b=sSo+AD/DNa05IRVI0zUKuQU/GXV3v4d8uImw4DuJJ2/HAlT7d0On6zjDGZ5LbBKx0N s0FG+lVLF+Fh2H6tyACGsEYINL/Gjqyude4q2HSi8Z9qaXiveIgGUAvxE+IwsLxyNDKX 6WKB59x/P4eLDNpvXLwVfkQzl5p7HT8/kSl9gz7/DA6W2WuVGShdboItHnbfyDMbpfY9 WxD6zYcw1yhSt0uHsJ+5HYEQ646HfQY8Dah9XRWiONvVqwjqWKhCme+mtOCHa1FqpSgX vnW4Y9gmDRc09v9QAqbquKThN66B3M3+MHYhJBPiWfNROaUtJR8V/cViGLW8jiZYF1to SZ7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=yFDzHR2BS8U20l3vvwYMeNLYCXMXMPHJ0iTX2uhbBPc=; fh=9T5APAO2x1kAk0Ww1B6Xv79JmoZrpbB646MsYum/98E=; b=qKhTOysn6lqViDZYCn75/EjfFLDKWuvemfz100bAy6VZlbQWUlDvy8CBxSeJwxxPAu E/PZSVgJL0EvQ7lJSSBi4PuQB2xIHPxPqxbZO8/bbEZasm66v9wLTp7Yyehh0O0NlQGz HYvmCiizyqLDbZydXeLTlUsbOx7kE4PdOE5B9fWG+ePXvYLdIQ/FkqEt7mH4p1uHDJx4 7awefQXFrY+ihEax5kIV7gZygJirw2+7q4QHqOrb+skWfYITtH+7LSFbq9w1adznFale Me9GZy/pFZHz7SVpk19KS42KqLxY6lX6DlNciXVG8PwxwX7XLdYtS8tVgd9MdiJx+1Pb WRJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=k30hwl3R; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-177033-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177033-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b670e35751si7861299a91.25.2024.05.12.15.08.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 15:08:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177033-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=k30hwl3R; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-177033-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177033-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2935F281236 for ; Sun, 12 May 2024 22:08:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4AF9354FB8; Sun, 12 May 2024 22:08:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="k30hwl3R" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C3B542A8B; Sun, 12 May 2024 22:08:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715551721; cv=none; b=GASLGExKnVYpxOZjsOjN2UseDXQXzS9GdIS5EK4h8TEM1Id1xqnf7h8yOcp9oypTsrh3xwgVubg4oKUKLt+8cGGVWrKA2c4iJQXnnfgUGd51Z5AXUxmRig7BjOAxYDZlErgdsNmuM0ZLPvCtjznD1uHBXjeP+Hf+K3z27pmPVo4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715551721; c=relaxed/simple; bh=saSiuNCox8WE/j7MV0S3IglJSFOms36rEidWeYmFR6c=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=iXmyZaNx8DNCXUEZv0DNv8d40/9aaaqACxlU71vZ9ScZHs9v7ZyhorO3p8IDKRfhYQc8aKD35Hjwn5pQLJhQMpeVPclwyu3SFzrFIG6SYRSLuH2VmMvcDE8+OEb3jR+guBbaR39ej3J7xArE54o/7RRxQkAr27wlzkr63TPgIfk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=k30hwl3R; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Cc:Content-ID:Content-Description; bh=yFDzHR2BS8U20l3vvwYMeNLYCXMXMPHJ0iTX2uhbBPc=; b=k30hwl3R35fB6PdAne5xNyCYvD LKbNIihBVvAvkrMvCX6YcV1hFypEvOmwNXmtaN7Fdo5S5bo92ysfDcJEerHllDR5uId4nsmomJ9eW 865no5ALTtnmSw851AQMoQvM6e5BQAjRK19Ptmz6/vYheLXI+9Bzo/mUMPdmX5xiMEb7LU/SMBtAD XYhnlX+HbBNuYzaKXXRgrrQ3Ew5HIP0P8Q6q+K81vrm6ifviJcmv1RLhC0L6QpfgAKc1iP2wDgJ4H fhRvwblJSuJ7a/34+yyIpf0ytHAbF0MHw2JmZKDcw4CsGaHaRobzqYu6a4VA3zAMqhRd7mAi5PFj7 gxebKkug==; Received: from [50.53.4.147] (helo=[192.168.254.15]) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1s6HMs-0000000Av8y-2DOl; Sun, 12 May 2024 22:08:30 +0000 Message-ID: Date: Sun, 12 May 2024 15:08:27 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 2/6] perf Document: Sysfs event names must be lower or upper case To: Ian Rogers , Kan Liang , Thomas Richter , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Bjorn Helgaas , Jonathan Corbet , Jing Zhang , James Clark , Ravi Bangoria , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org References: <20240502213507.2339733-1-irogers@google.com> <20240502213507.2339733-3-irogers@google.com> Content-Language: en-US From: Randy Dunlap In-Reply-To: <20240502213507.2339733-3-irogers@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 > Reviewed-by: Kan Liang > --- > .../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 . 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: > > [=][,[=]]... -- #Randy https://people.kernel.org/tglx/notes-about-netiquette https://subspace.kernel.org/etiquette.html