Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2240139lqo; Mon, 13 May 2024 11:54:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUz1WSAYmM5qZR59OzZEu9g2wrp17Kqi+RGf06BvxHGKclkSObVxqutYgir+0csr9OU1BKDVETcj1fPTOHTMzXN8WtSvw5GKu83I7FKrQ== X-Google-Smtp-Source: AGHT+IEdxrjjcSYwjsBcXUv9m1DfEk5krSssGFOAJxFvSWR5vuxQubTGN8GINiwP3790nWl+VVee X-Received: by 2002:a05:6808:358:b0:3c9:66dc:1a7a with SMTP id 5614622812f47-3c99707247emr11091142b6e.32.1715626491484; Mon, 13 May 2024 11:54:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715626491; cv=pass; d=google.com; s=arc-20160816; b=SH5A64Dz9hesthZTy/fLyDXD1WR0wfsC4vUg3zUy2VOqVpv2h2GAPG1qUZlYAglM3n ah7n8kZR6/SfRmGAqVcufsWe38uVHn2MFchQRc+yn+xMmT+hwqPf1IFs72xoYRHOfYvN tcwBGOwb72AXh96qP7if0A+5DwBTopI+X+WCADzWM8XipdTpgpy/+6aRRcdRD70nbHEw kcn2aj75tx1y/MzKjQuvpR4/LU1F+DlHXf9SSDerK0Qqv8JZ2FmK8tVdd2+leafvM3Sb KM5qWjxOUX3ZOoytWfd96zuOOxxNpjYtXWNE/zYMAVbgtn5nYZKluHIs/baPkqelysah f3QQ== 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:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=vGf/jTtuUwk/HfEDJqDmtiYZAy8X+Zz7Hwm9/iogRd8=; fh=dClWeevS+ssF6QBFtmqXv0FQcAtUpiKSCpidmqQ1b6s=; b=fA7Ayxo3TFtzyQ88an3xji88PXxBH8lLSAohreXm3umNCvWZOSn8rTZSgUEyYsE0VS IBabUNAfe6sgcGW3WLEaY9EsgBC0nG1FGKXcotOsCogqNZnz1ZEoXQxPOAdmHYTPQo0m lxhmS73pqjiolDsHtWWh16cWSXzuFAooHtB9nugkrgOdh3pP9I0E67jYuIcHtvs4TWJ0 2X4IjvpMKBUzA+qEteowSpRFyQxVF1czs8EYE8bidD5C7OqcAab8xzS6fWNQehljUe0c RbDfUyhTigh9WozOWw3sOgnWlOWcqrsBlkdhGsduErlkjsqoJj2hF3WQ0Fd+AAQB+cJz eEtw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=KMTqIsdK; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-177994-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177994-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f30710fsi106396186d6.591.2024.05.13.11.54.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 11:54:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177994-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=KMTqIsdK; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-177994-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177994-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 378EE1C20CAA for ; Mon, 13 May 2024 18:54:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDBD84206A; Mon, 13 May 2024 18:54:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="KMTqIsdK" 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 4A63F3BBE9; Mon, 13 May 2024 18:54:42 +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=1715626484; cv=none; b=k/vfCNZcdIw/UlbsU4kyTB6ZHH1WsmGrITOKkbjNyZWlVF3we9I/NNKrs0SUDfaQW3FXKXVfjt1ezTxmUEwcsUSqMeQ+t1Mz2QyJ16YX8MwG3ypVZyos3V6/XDnRsiDwlH/lfcLtamo66lHfvCh6E7JVkmVkMRp5mLsrY20iSME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715626484; c=relaxed/simple; bh=d2jgkbkMoV3Siq9CkSyxiqhZl+sMSfVZF3OGa6qLXek=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FpqEB4RRgQam8HAWriblp61pDShySOx8IylVix9pP78v1cWS5+cH1v18+jK1OGDxesdtGQAnTQOEXHJZkseJLW/HJKEV17xCFgXN0qWVNbao0T49LNLeFB6dGmf4Z+NH9ZPU1r7F49xYz2N1+9cbWQc2u5dAvnaP6pDTP//ETYw= 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=KMTqIsdK; 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:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=vGf/jTtuUwk/HfEDJqDmtiYZAy8X+Zz7Hwm9/iogRd8=; b=KMTqIsdKZZtq0XAnw1JFppwfJB drxZVDMm8YEO6YQTHtlUaMNrpuWBLQ/dijcZB4JpgDFvxlY/UJvKtCTPJXYmGG+GwCcaTw2nTywpm hlxoOFUE3Ck6baAyVfJSqz2RB+xrUCOl0dR0L+VYWEZTB0II2qLKTBu3HnMOT3pfyx9VLpv1QoWxz 7HfOINW9c2M0V2BJducBB4d+oEOfKtQ6ujoyCHvpJxu4VqYsbBNp7SH53tuR9f4p8sSOnqIFCYrls FMCfqIvD10B6rwSSTF7BH3WlvTm1PJjUOchwtjIay7lq9YXoTrc0Ku4FkQHMIU9+3g5mjOHPMY3xK yFqDsz+A==; 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 1s6aoi-0000000Dvoe-2NFs; Mon, 13 May 2024 18:54:32 +0000 Message-ID: Date: Mon, 13 May 2024 11:54:29 -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 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 References: <20240502213507.2339733-1-irogers@google.com> <20240502213507.2339733-3-irogers@google.com> Content-Language: en-US From: Randy Dunlap In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 5/13/24 9:22 AM, Ian Rogers wrote: > On Sun, May 12, 2024 at 3:08 PM 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-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: >>> >>> [=][,[=]]... > > 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