Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1332306lqm; Thu, 2 May 2024 11:19:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWMZ2JwHllAH7nXjAi4AIP99ZiN+bBLO5JZtmuohI083q8+skZCuebr2VMFgB0A3263YJJ0UDZ50VY8O0Fj7RmoCpzJCYaheoL5Qz3xjQ== X-Google-Smtp-Source: AGHT+IFz/hIozmGy2WdpWLCravDj8okJjeilst2ClNq/N9eAU4A5AKX5zc6jV6+3xwGGZrDNZpTo X-Received: by 2002:a17:907:1047:b0:a4e:24e6:9880 with SMTP id oy7-20020a170907104700b00a4e24e69880mr2725266ejb.33.1714673990362; Thu, 02 May 2024 11:19:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714673990; cv=pass; d=google.com; s=arc-20160816; b=oBJ93HLEdmuXpUecuMAhwVcCgrJb/09cmBuz3XNIxZaXfiUaLFW2A7BLCG6P4ZmL/7 LHCjUqiybbBoL81URrpgaHEQbYz7qKTreaxtn9MgtnVib5FrSa6QFJGfKmY9K3HgUsLk Ukj15BsF7omKIUW8v/jYiFjHde/rucqM7BLb7aiif4giFX8yTP12pyZO6o5mG0krQt94 ZOHknd0NaVHBCyTMBdj22Ss7CyPnjULsRUkMBvunOAzm8JdiTTO4qhpOWn7wxGg+T/+L Uu0RJNoGrb8UgovF/bro6ol8kSx8USVNQAGkmr1HjVeHNctN+51XN9RKWQwki0apEbzT 6fHw== 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=Usd3Q8JoS3orjgW7FWjnn2VBZ/CfthnIjfJDew/zyxI=; fh=oGyitjAIMpZN8TO89N+F5EV1J/+EfTuwhGTeG74ljKw=; b=k6nDw8nl+i6WkIVPNE2EQqFqiuQn4pNO/LKpILOOGlwOtQHNX2phLHbop5wMJGoM7K c+RYnophoO7mIHsDJJ/Zn2l+2P3Omko5anRQSaj7B0X0dXXGGalbGDwDE0aFXygof6QG u3yUbIqyDw+40MNhUfs8fnKGIeGWa9EQzI9EmypDI0bGR3enxa/RFsjqjCl/utdOesTW H80CpD/1PU36FZU13ql9j8IqC06cU7e3RM2pQTH3zz1lfu3No7V1K24B5sL7TKR4O9XF rJYJt0A/pu9zeolOuKng0YXKH2j9dXXAhVG9GduLDI5lPJolPGkpBrzf+x3f2uZ0WDPN kdWg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ZAYFHYMy; 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-166832-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166832-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lx17-20020a170906af1100b00a58e9778bb9si690916ejb.386.2024.05.02.11.19.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 11:19:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166832-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ZAYFHYMy; 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-166832-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166832-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 am.mirrors.kernel.org (Postfix) with ESMTPS id DDDD61F24550 for ; Thu, 2 May 2024 18:19:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A886717335E; Thu, 2 May 2024 18:19:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ZAYFHYMy" Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 7AC52172BCC for ; Thu, 2 May 2024 18:19:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714673978; cv=none; b=gCmnleyDjRyyWK4+jOTe9MwqrcWdyKyHm5etuSd5ze8MQEZyFQaa8Xs44mgKciRAXE7vlmeLImU6jMyjtyRoqPnORS/VDI68fCbhgnwTfOLLZv+oJIXNqZznzwNvRenjTWhp3Rk6OfEzoRuyxto408MZq0J87KpAOaY2K5cFV3M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714673978; c=relaxed/simple; bh=SYlCpBOfXAeKSxneS/U6YkJ45rTbrFjuiWOa01qQagE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=R54IR8ZlkMGFJUMF6x9uOEwx75CRbe+KCqvvyuA7uh2qgerc03/6qt98KtacvNlla+cBB5cduSWH4M6fGEmxVEX+fNyNMEZXydoPXryUbjbzfJgZKbrcVhU6b6rc8manm0f5rLpQLMJrUGhI8GvmpkfTaypMlCxO/WzzSx5n/i8= 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=ZAYFHYMy; arc=none smtp.client-ip=209.85.214.175 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-pl1-f175.google.com with SMTP id d9443c01a7336-1ec182ab287so26535ad.1 for ; Thu, 02 May 2024 11:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714673977; x=1715278777; 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=Usd3Q8JoS3orjgW7FWjnn2VBZ/CfthnIjfJDew/zyxI=; b=ZAYFHYMyZKJb2u8rJMyX8V2ezv5oIkfQA57KwzOJ05MdVP8UgVsfnK8hKrWfwdKCsl bGjDqOlHfDL2kUkFudXouK1Im4mu4XVcPkkuHzdGTvdLCIwIEIOVcz710RE0hKCMWnoH AaaVt4m7K4dvmPn3urAAxu2XbBpo5UCAHc0vvGK8BA+/Plcvs+faEJvS6cgJiVCpyhvc ej3A3b+Zkc1ZtaFxY5M69Rpk5F47MT+rMrWJO4UYAUQoXJHCPbTTNp5DgnSkAu1knYuW xSRoyLi8ZreR5c6w/jnI3cy1F6VPTlWbWnFMOb9j4sEI4NQZ2VtDVV+ZUo4UMH7Z8Edn FQrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714673977; x=1715278777; 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=Usd3Q8JoS3orjgW7FWjnn2VBZ/CfthnIjfJDew/zyxI=; b=FoFHNH7FfylQlvJR+rCOSsWjyhsdkPqdTJdWtOLbLF1o9R8Bv2yyx4pRy0ONXxMsko k8ZgVmXiSODak69JCLLwz2ai/pHvFXAeKXbOjDRK8K9ZGjGDn8wmM58lhgjXK1OFUsLc qujrvi1yQQanNJ4I/DcG95EFF9dGZadnI/S/PRsTt8oVsxvM1uIqx+Vaqd8brUBOknbi zgyPRrqFsJwpI9QfwhDV+X7xnNvfrJNTZfEsutmaUeBBqwF0vjVARhdxvUaAWXdezI9z oeSkKVzMUpmQDX+hEdg1DHQSLk2UTiND1SM2xu30484NKgoB7SQ3vdzy4fp0Slden+ib v8Og== X-Forwarded-Encrypted: i=1; AJvYcCV/8/lyEdzFf9WlCk0gtTMV6k7ohyeskX7xdavrhcUlUZPJisx8i0Vav5aVXMZiG6nHDZzcRusz3cRpbERVXAKhCQeSxyudT4JXsZz/ X-Gm-Message-State: AOJu0YzdStsAr04pxYft6EpxC2rHuwqTSknpJ8+XnIjHM1FWwV8EFiX7 HrEB3qJhJ5SLP0xfmMOF8aGhfnbyq3HtIlQDF9aaGfTnMLRcaxpSLXSzS7cIfNsNrWFa8KvHmbK q9SCjlXMjsbcAlbi7+XrRiB74ru8WrjseZSxb X-Received: by 2002:a17:903:2286:b0:1e5:5c7a:6a4e with SMTP id d9443c01a7336-1ed2c6f6957mr231985ad.2.1714673976198; Thu, 02 May 2024 11:19:36 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240502040112.2111157-1-irogers@google.com> <78a63434-c7b8-4ada-b59f-b6dd547b5b63@linux.intel.com> In-Reply-To: <78a63434-c7b8-4ada-b59f-b6dd547b5b63@linux.intel.com> From: Ian Rogers Date: Thu, 2 May 2024 11:19:24 -0700 Message-ID: Subject: Re: [PATCH v4 0/6] Assume sysfs event names are always the same case To: "Liang, Kan" Cc: Thomas Richter , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Bjorn Helgaas , Jonathan Corbet , Randy Dunlap , 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 Thu, May 2, 2024 at 11:15=E2=80=AFAM Liang, Kan wrote: > > > > On 2024-05-02 12:01 a.m., Ian Rogers wrote: > > By assuming sysfs events are either upper or lower case, the case > > insensitive event parsing can probe for the existence of files rather > > then loading all events in a directory. When the event is a json event > > like inst_retired.any on Intel, this reduces the number of openat > > calls on a Tigerlake laptop from 325 down to 255. > > > > v1 sent as an RFC: > > https://lore.kernel.org/lkml/20240413040812.4042051-1-irogers@googl= e.com/ > > > > v2: addresses review feedback from Kan Liang, by updating > > documentation and adding tests. > > > > v3: incorporate feedback from Thomas Richter > > that s390 event names are all upper case. Do a lower case probe > > then an upper case probe, make documentation and tests also agree. > > > > v4: add checks to write (kernel test robot) and fix a typo. > > > > Ian Rogers (6): > > perf test pmu-events: Make it clearer that pmu-events tests json > > events > > perf Document: Sysfs event names must be lower or upper case > > perf test pmu: Refactor format test and exposed test APIs > > perf test pmu: Add an eagerly loaded event test > > perf test pmu: Test all sysfs PMU event names are the same case > > perf pmu: Assume sysfs events are always the same case > > > > .../sysfs-bus-event_source-devices-events | 6 + > > tools/perf/tests/pmu-events.c | 2 +- > > tools/perf/tests/pmu.c | 468 ++++++++++++------ > > tools/perf/util/parse-events.c | 2 +- > > tools/perf/util/parse-events.h | 2 +- > > tools/perf/util/pmu.c | 111 +++-- > > tools/perf/util/pmu.h | 4 +- > > tools/perf/util/pmus.c | 16 +- > > tools/perf/util/pmus.h | 2 + > > 9 files changed, 416 insertions(+), 197 deletions(-) > > > > Except the warning for the uninitialized 'ret', the rest looks good to me= . Thanks Kan, I'll hunt that down to fix in v5 and add your reviewed-by. Would be awesome to get Thomas or someone else's s390 thumbs up. The differences between v3 to v5 should be very minor, so I'd accept a check on any of them :-) Ian > Reviewed-by: Kan Liang > > Thanks, > Kan