Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp54578lqh; Fri, 3 May 2024 13:09:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvUXGX9XP8EjBAxEGiO88i2BI1hGsw9glI0x6RXoqN7ftOOD5rWELm8ql0q5oqP4aC7W83xTBq+IB5mDNzKXY/AFSC+uIUQ4ynl61ERg== X-Google-Smtp-Source: AGHT+IGAJe0j0PeYKAhog/+2cYifb52pY0/RsipNVETetQafdkAH05f9HtoHdeSrEITIu5w9D879 X-Received: by 2002:a05:6214:cca:b0:6a0:c30f:317b with SMTP id 10-20020a0562140cca00b006a0c30f317bmr3621157qvx.12.1714766981993; Fri, 03 May 2024 13:09:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714766981; cv=pass; d=google.com; s=arc-20160816; b=tXZ2TXUkUc7/utNB6JvQgVmytXrnED+U5MbXXCc24WLgN9gc/1z8rryYRxvWXmURCZ rlSMkzEarxdL47MX9A5a3EonGfcKdkMLNeBse89fjJ5Pm9gt67zcDm03rduzVxtPlfPM /Kp+f+dUzPiIamlOykvsuOzsraj2ZBkNguo4JwyO3Tu+wExF2YVErSgPvfMJLkqaQzv9 yajTRZJJKqPpeOoSQpXNI/P8luzkQy29MYluIS51Q7EpUWjfsM2EzmbJxpettLJBOvle xZOnmpTgMcRxrhFHN1h7RMquY6qJ2nt0HFXxynrCNqidSYP7u9B+2TgODIytq/vn4L+w bONQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oX9jYW8rxm3qLzQsZJ6YV354Ylz0/0+P6aUZWE7Pa5Q=; fh=ubAP89JzsfxolU5i724ubrjN7QTS++9k2ws4FXGuQzI=; b=S0+g0RjVXzIF3d9bfWtWY3z3WpJUHaa7GrYZp/XJSfKwACjb8P+2mL302xsTqJwqNs ZRxXJ2pGch9F9yVGmMwg4ij5y7vtB5noOD93OpoQEvv7HKesOYlAWVVlr2IHKx/L06L0 mOgF451nyXFx+vYba13ggCWBQHJhZB6W4QYa3QeUEswtKIo48fS2N2pEjwqxmAfG6uK3 ZyfU/4zSHkpxPAe1CswEQONATBed2u4HsNx7i2e76OrdtoDY0SsA+7UMon8H0VKRNEzu UqXXuglnToW4zGjtSs2fLac+AviuS55AAIKs616byVkVXgCwWNT4iLU15IqAfWOI+I/y khBg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ob9kBIFC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168163-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168163-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id iy10-20020a0562140f6a00b006a0c5959e83si4186527qvb.208.2024.05.03.13.09.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 13:09:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168163-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ob9kBIFC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168163-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168163-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 B8A0C1C23B6F for ; Fri, 3 May 2024 20:09:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDE17158D7B; Fri, 3 May 2024 20:09:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ob9kBIFC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 04DB912EBFB; Fri, 3 May 2024 20:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714766974; cv=none; b=Fj4cS1gGGmxM2Ho9PoFw+bOItiJKU+5GRD21HFvv0k9p0/bsk4aykvKlP91rBOKxZMdxJRAnnWJ+GNOU1Q418vExdFA3vpaAnZ9mtj5yDPGoWwiF/WXN46wgUHN1RMHkNTcsau7UBIDL6zS4BpQ8fNVHnN2CNtIqdzg6sb8fjTU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714766974; c=relaxed/simple; bh=4oGY0Pg1PsM+ff50czZR/Fug2cqi9hrlFUkpP2wDbUY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NqcDmnqq2BN3z1/72E8BXeSH6BaHLf3VgSt15ZqsjTggqXkcLoWeLA3ZgLJxwcb/4de43sGpeLxPbuxVFhpsmn7mcRddWsI4TQRHc4iYahPBEJcFjNVbcHyhLgfLY9XhPNDqMQ7qY7JhZghFMDQulLdABD5QGi0VxD5TkOvX2b4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ob9kBIFC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FB4FC116B1; Fri, 3 May 2024 20:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714766973; bh=4oGY0Pg1PsM+ff50czZR/Fug2cqi9hrlFUkpP2wDbUY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ob9kBIFCI8VxMmGvTiKxqSdBhFOXY6940QkqfEjyLzi4ikHx//6iATKTnO1cXuGu1 7B23DF2catUkHTsfIitXeR1xYtUX5RrB6Pfl7MX/na5bLU/9cD/SHbcZDePxxWsUL3 Sq6ahpP1N2w3Vv3WwGSqGJpeqbs6uRz6EL2KoSpr9p2JZtEpDLwRZTx4+jSPqhxO/x esumHZVp1a8hgL5aiYL7A/k4WJ9mqMf/Hrs7qq06T9z/MG8s+qnnLdmnTpw+2lxJBR mZXEGTnSoQb3NtvA0maZHDMGmEVEzrs8BaujS7TyP95KZe0CBfDbOeOHCGHpyTzZBi wxQsprPrtAxBw== Date: Fri, 3 May 2024 17:09:30 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Kan Liang , Thomas Richter , Peter Zijlstra , Ingo Molnar , 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 Subject: Re: [PATCH v5 0/6] Assume sysfs event names are always the same case Message-ID: References: <20240502213507.2339733-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240502213507.2339733-1-irogers@google.com> On Thu, May 02, 2024 at 02:35:01PM -0700, 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. Thanks, applied to perf-tools-next, - Arnaldo > 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. > > v5: Add reviewed-by: Kan Liang and fix potential uninitialized use. > > 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 | 467 ++++++++++++------ > 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, 415 insertions(+), 197 deletions(-) > > -- > 2.45.0.rc1.225.g2a3ae87e7f-goog