Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2160150lqo; Mon, 13 May 2024 09:24:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVSZXHjkY88ebg0gnS2Bk7GYnGMxTx5rorEl4Fq0w6sj+TOax16pf9yRh/zI06gj5XrfOjyKky/S3PD364/9LXXTDai6DwqZ5VmWmmIYA== X-Google-Smtp-Source: AGHT+IH9JzEqC/eWRxgnbNkJdkKwIV/tJPHI6gsQfUxcYb6+sCTens0mvKJfOkBomo5sFNkeqDyN X-Received: by 2002:a17:902:ea0a:b0:1eb:d72e:8296 with SMTP id d9443c01a7336-1ef42e6e5e1mr156124405ad.10.1715617443810; Mon, 13 May 2024 09:24:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715617443; cv=pass; d=google.com; s=arc-20160816; b=cRHEuNu6u/qi2PqIqEgegK2i06E1fRuwJSsUpPbyAFO2cVY38nt80zH/FtuLia5Dh1 Bqm7FNGg5Pkev7T3NKjSHwnV1vfSDp9PBXtBAj+WBn6WEB1AIkjqNeVPnd3ceClatUiK q1tmVkw3GjBlko9gABaWn7xiLzXgeBwiu4wXnlBHkZZ/+l9gYAP800BO5gk9egHoIe44 jLnZpgITQ7xtp/QAiHycgHm+TZHFUaUfWf9HcF13IknYeMFj0JGe2ec/Zn7oloVCpTVI ark/2dtTbNvX2uxKl9f+NxvFMmFbd/JrFiN4PSYF7q/x2xbSnpavZRgjhiiTMV8iysqR rY0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=/fwn6UKi/1K0IWQMLBiFsBG9j5cvRpV6hNPVdi/9PdU=; fh=+sX0tKLfxse6kS1RjMFpMgTKsgld9ZQQrOrGXJT/Mfo=; b=jzovoPRhE0jdDIrGT83RfVLqe7+JIkngjN0DcrGXRXmpg+6tNrd0Q9RdBYg7n6olaB eVwqF3Q2yBKqQWeXeKazjTpNG0HGy/qb/h7ekDtKVGQZXjLEdFje5mPs25JmpGJsFVBV gLQexjPZYSP2uu/Q+XCVDBNt3inFPcQnBAuw9HO9RNG5Kd/znCeUycT+wc9mLAIKczkF WJM53lYbgLmcGJzEDwiUg1e/FDthjCVEjBXSRjuruovX3iel+hccvMwN6UadY0YP+7RL jUP0GJuNFVDfzVSTuE1vzJvHkLh05AB35G46HlpqZalScC0zdMB8EYIgw/iLYMn9Ua3G 4aPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=OnqaZfKI; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-177824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c037cd6si93865075ad.372.2024.05.13.09.24.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 09:24:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=OnqaZfKI; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-177824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 596E4B2141A for ; Mon, 13 May 2024 16:23:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7AA3155388; Mon, 13 May 2024 16:23:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="OnqaZfKI" Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57821155353 for ; Mon, 13 May 2024 16:23:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715617391; cv=none; b=H5HI2EiaYaCCWk8ylLHYeUkDOGsnJvMbHmDN6JE5HysMbVHdYvzpIGyPsmF8A0ZM7BlgFAj2JkVL6VQESlona/C+qXk3i4caV84BBq+NY+6xcn75fwM+z0EcdKh7UKQcjZc1B6or1RVGFWuTT3GgmcjPDfBt/sGrjj5PYgxoB1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715617391; c=relaxed/simple; bh=1FpidKHpJ6tC6uWua0hdyTTUiPlb0a/PUWUSgSZ6jrA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Aef527b4OkaRYQOhlFvPGdTcW2GsgkjYUz/G6D6yKTaVlzSnwvw/hSUjxausBMPqe5yw8LWd0+tI1mD4KSeT37dizVwLBBgD4pAT97yw6/NpNiK9C8quchQNqwhJQWFAgTQsjLiFk/3uXt28tUbWib5tU48Q7o8tr2RZSfOGXVM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=OnqaZfKI; arc=none smtp.client-ip=209.85.160.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-qt1-f182.google.com with SMTP id d75a77b69052e-43dfe020675so830761cf.0 for ; Mon, 13 May 2024 09:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715617389; x=1716222189; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/fwn6UKi/1K0IWQMLBiFsBG9j5cvRpV6hNPVdi/9PdU=; b=OnqaZfKIANEkjcrAuRT54/MUPnM95qMIMwJ+WoSxjgZTtKGaS6ZUeMBWPKv8jnL6l6 ZpVpm8lrBieXii+xIHSk6heqpWkI987e8ycp2PkKe+KjUXdELcoZBSpL7PQDsNzeN9T9 88neQzSprnH4GsAVf6C+sxIqHTivj5NnLa7tGZZiHZm9ymlvYwGI4OmkF/uXWD1NWpeZ 0HrZjfpRgE4VpboLlDa+ffNvanSJ9PrkhG1zN95DGFvZVkWUyHZ7lJ2uIW9lP91lETqx gqYCLXRB3euuN+kcj6drVbcBI5y3Gnsj92fr8CDV6G8MQCSJj4siRJGNm9fvwVRYum+w pI+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715617389; x=1716222189; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/fwn6UKi/1K0IWQMLBiFsBG9j5cvRpV6hNPVdi/9PdU=; b=QYALseXK3x4y7804FAe9MToUmmsMU2bqKxZHx327nOYLP3+SNRm6WsXJvpO8A7KJKT JR+yAYaIg0aKT8+cYaKu9SatkTOLaTE2Dm8Wtk3mv7D34K5/CpYcBkADLdCkIo/ghfHZ 0SB3v5o7uAKWKvCRyNGTDAUiX/L/DjVNzkkbCKoALtLGochKXUflUYnBqWsw3HjJL7st 8SifzuXVrPumVwv2O/q+a6BnpfbH2W3SlxR/xYhr593X3jyLGd8DMnBkXv7xoHszG41f WeTUGOe3fRoH3Y7KvkvxaRIwu2J7jhzb+9djVZCn77oMN8W6bg+EKXeeYNJM0Q2QqKN/ mkaw== X-Forwarded-Encrypted: i=1; AJvYcCUZr9cmAdSbQpUKadTs72WMehp33ZK67pYoMkklqruhXatqhIYbbd+qHz4s4lQA5KoV51mpAsuntikoe+eKVPPDPUvICMHLN1biJC1T X-Gm-Message-State: AOJu0YwKaDmFPqmuAuAC4H6SYdNprQeuXEC8IAkcRfnD2VjXdjxvIA6K D89zqhHI0FSBUyZxJ/0EmgTiOvqdcFaQde+bMv5q4MU+ZVtOQ/1sBrNgih3/r/0HV4naYAACEXG KuGJYSyOhE+10zdepi+2Z0am4CKoscWe2klbs X-Received: by 2002:a05:622a:98f:b0:43c:554e:b81 with SMTP id d75a77b69052e-43e0a28c3c5mr5057731cf.23.1715617389221; Mon, 13 May 2024 09:23:09 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240502213507.2339733-1-irogers@google.com> <20240502213507.2339733-3-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Mon, 13 May 2024 09:22:57 -0700 Message-ID: Subject: Re: [PATCH v5 2/6] perf Document: Sysfs event names must be lower or upper case To: Randy Dunlap Cc: 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, May 12, 2024 at 3:08=E2=80=AFPM Randy Dunlap 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 > > 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-e= vents 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 ev= ents 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: > > > > [=3D][,[=3D]]... 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 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