Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1417794lqm; Thu, 2 May 2024 14:21:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCULwy5KWNz9iOFtCTdtolqSuG1MtWPm8aW4EH/mPMs0cy6doP8/Mu80CW8qy4nq5AaONItVgA/131n/wGVhv1/KYJiRT2cVCCQ651F+Nw== X-Google-Smtp-Source: AGHT+IEgGhS3c1elhLWhWX+I2osOQntUSxKR8gNTAIpEufpb1pdEvGQeIEzZkyvBXLQ1MdaaW3aq X-Received: by 2002:a05:6358:6f0c:b0:18e:a0ce:a35c with SMTP id r12-20020a0563586f0c00b0018ea0cea35cmr825438rwn.14.1714684899022; Thu, 02 May 2024 14:21:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714684898; cv=pass; d=google.com; s=arc-20160816; b=mNuru8yxAAmHFK1HHqO4xgaYyZb/N+xedSwhUn3pUQevk6jsFZPe/sln72iBwM0l4N 17PaSt0nQslvNUCeRIhxcf2v08X7ytIA+U8YP1fRfRhp8alOPZXf/QQVG0RjVrhoT+4Q Q4GuPotpAdUvejSDu9BtZ3Mp11QCh04CChdgHVLaqjORobPvtoZszMpeKxrEU/J3hmXR y5Bce99wa9AF1lxzfi9JV1JC8c0LGgsu42VxaZ0Z2oqXLxuFa+ONZirVZbXYWeBGV5Fi XiRq9uLUBfr/bCMaIq92QIZf4ZwaqjXaGUgQaF12xYNf7lcOvTk7E5nwPu4OBhJauQim PWUg== 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=r2oTibV1TREH66lM8s1x2U0bVqwtR4BeQbEnr+3xZs8=; fh=gTljQBjVnhVC+2UZCt4x3bIg6+WdKvLRh48hgnBqIkY=; b=D5f10I8rRDa8whmoeAexUAkFyy03olYdW2pJojo6HIqvwaF9HDsXfFbm23jpu+/2yl URbmb1p4ViwRHBE8C3ZKWRELN7Uwl3mF8vvwkEvvUix6gMvARBmPiWs1o543c9sISqV7 59PjRVs4KOdlDewOwmXd5soaOt76qJsyfMtyyXQBHJW2ZJ1NBXCvEEoMEx8J0kLb/37U qch4FMUj63zOlLvC0xRFYq0Z3o8R3dIZdZYoqdmOXirJreFbkwYW7Jb9isYHogCw4OQ1 /tmThy0h7oyHGhPDpiakW8Z3mfhsAlXrMn792pHSn2kj8hrAkC1k5P1w6E0Cb1xZnX+6 pbPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SiQqVago; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-166830-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166830-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x11-20020a656aab000000b0061a1bb517c6si1547233pgu.864.2024.05.02.14.21.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 14:21:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166830-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SiQqVago; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-166830-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166830-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 7E88EB21558 for ; Thu, 2 May 2024 18:16:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2B4E173334; Thu, 2 May 2024 18:16:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SiQqVago" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 6C884171E71; Thu, 2 May 2024 18:15:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714673759; cv=none; b=B4L3jGarmdYisr+GOnV1bH/KwL17dv2M61IkoQXgoo8NbgV7ncMVMsX3CN6yldvox7VeweLuGrwnuHJJqoX/xVKwaTcHb3LI8TJ6P6oAcwI4y1oL/PzSkUL8pqrQf3OSCUS2Am0rKSZJAWds5aaV0UwjGaLQCxS+twOrREJpi1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714673759; c=relaxed/simple; bh=X7DrFE5tkPNVeoKphzhmBGA84w2IH/LJ5mcMYnCjHuY=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=ImO4+xktGNgCTrxwexso/bPq1xz4LUJZuG1dyBilZds7E1wSqvW/trk8cCQrqCiQnlyTRS4LPxpPA4W+vz7EbCYJ+q3Qui4kM3koDT2svAlyxKA4avP1dnFyGBVPNieKhDJGFCfu8TUG+IStPjKrRr+aCDm3rZ0E6DIxLVf5VEs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=SiQqVago; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714673759; x=1746209759; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=X7DrFE5tkPNVeoKphzhmBGA84w2IH/LJ5mcMYnCjHuY=; b=SiQqVagoPHZWbgZkoPeZCvD89OkWQYxgzCgHwMpog0qAtvTwfo5N2Nwm Rd2kFQaR6W9EIF3i1rl/NwLRT7G32/ShOO0Ku5UqirRpuNseRmhdr738Y MoyoHTehBmpPZrElVYlCru5nOWmka/ZYtjOWF+ZZKYa5hjzVAlJ3B4544 MxGrG+qc9+SrDDZryxlNEGfUHyhzms1ib5LptfEQ8FytPzNl4AZ9tHsSc n7zCjk8NMCGusBzqAmUq/ZZD1NQrSAzfWEZLgcBEchENXrLwt06gVewrX 4Rc9dntXy5Apyrl4eVus0/N5TS7FX2h5mclFWrU/5W6IzoysLwWP/Dq9/ w==; X-CSE-ConnectionGUID: 1DDYHusATrSUZjVmMIDF1w== X-CSE-MsgGUID: 9kcPSfNCQeGbxzd8Gu3cBg== X-IronPort-AV: E=McAfee;i="6600,9927,11062"; a="21078434" X-IronPort-AV: E=Sophos;i="6.07,247,1708416000"; d="scan'208";a="21078434" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2024 11:15:58 -0700 X-CSE-ConnectionGUID: 6/TBRK5kSW6Z257tKIDi9g== X-CSE-MsgGUID: pMdGUqKIRe6ELbYWmn/Xew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,247,1708416000"; d="scan'208";a="27704908" Received: from linux.intel.com ([10.54.29.200]) by orviesa007.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2024 11:15:57 -0700 Received: from [10.213.161.211] (kliang2-mobl1.ccr.corp.intel.com [10.213.161.211]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 87B2D20B5739; Thu, 2 May 2024 11:15:55 -0700 (PDT) Message-ID: <78a63434-c7b8-4ada-b59f-b6dd547b5b63@linux.intel.com> Date: Thu, 2 May 2024 14:15:54 -0400 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 v4 0/6] Assume sysfs event names are always the same case To: Ian Rogers , 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 References: <20240502040112.2111157-1-irogers@google.com> Content-Language: en-US From: "Liang, Kan" In-Reply-To: <20240502040112.2111157-1-irogers@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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@google.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. Reviewed-by: Kan Liang Thanks, Kan