From patchwork Mon Sep 4 09:50:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13373666 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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.lore.kernel.org (Postfix) with ESMTPS id EF183C83F2C for ; Mon, 4 Sep 2023 09:52:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/YN+R4+Ugicek4tlK3pjVIJXUxMJblfjLgPhR0/5nFk=; b=SPhDjGEiRUUbd4 YNX22njMfInKPsBquoebwM4xR1/VwNxK9PRmkWeqxfv5ebvH6e3JlBCEUuj5sFp30NDaG9OtZl7Tw KlTCKGUUMBtFgW8sTBNGozIvOyWR4QiOs/r0QrpJp67SGrpuwBqCb7L+fqztOQPH4DiBe2FRFQl8r IvhBJgfLwXTfDW2wxsCM7CDwxgk7vzrjuhKnrQaXa33XKM9OvTqkB4kujaf7E0IEE2k0FHm7OBcP9 lrXry03GPGheCi/zn0L394/0+1Rll/gjlcJbEqEZ4k4XYZAzr7LBn2oMRZeroWF5zMJsPltEqGRtY lJanbgU9PjiDYeH3g4DA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qd6Fa-003iV6-12; Mon, 04 Sep 2023 09:52:06 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qd6FX-003iTG-1p for linux-arm-kernel@lists.infradead.org; Mon, 04 Sep 2023 09:52:05 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4C0251042; Mon, 4 Sep 2023 02:52:33 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 00E433F793; Mon, 4 Sep 2023 02:51:51 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org, irogers@google.com Cc: James Clark , John Garry , Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Kajol Jain , Haixin Yu , Jing Zhang , Ravi Bangoria , Kan Liang , Yang Jihong , Eduard Zingerman , Chen Zhongjin , Miguel Ojeda , Liam Howlett , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 0/7] perf: strcmp_cpuid_str() expression fixups Date: Mon, 4 Sep 2023 10:50:42 +0100 Message-Id: <20230904095104.1162928-1-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230904_025203_648929_0560813F X-CRM114-Status: GOOD ( 12.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Set of fixes related to the comments here [1]. Mainly cleanups, additional tests and refactoring since adding the new strcmp_cpuid_str() metric expression. I added the string replace function to the perf utils rather than tools/lib/string.c because it didn't seem easy to add tests for tools/lib. [1]: https://lore.kernel.org/linux-arm-kernel/CAP-5=fVnUx0BnJC7X1rrm42OD7Bk=ZsHWNwAZMBYyB7yWhBfhQ@mail.gmail.com/ --- Changes since v1: * s -> haystack * find -> needle James Clark (7): perf test: Check result of has_event(cycles) test perf jevents: Remove unused keyword perf util: Add a function for replacing characters in a string perf test: Add a test for strcmp_cpuid_str() expression perf pmu: Move pmu__find_core_pmu() to pmus.c perf pmus: Simplify perf_pmus__find_core_pmu() perf pmu: Remove unused function tools/perf/arch/arm64/util/pmu.c | 20 ++++++------- tools/perf/pmu-events/metric.py | 3 +- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 1 + tools/perf/tests/expr.c | 33 ++++++++++++++++++---- tools/perf/tests/tests.h | 1 + tools/perf/tests/util.c | 31 +++++++++++++++++++++ tools/perf/util/expr.c | 2 +- tools/perf/util/pmu.c | 22 --------------- tools/perf/util/pmu.h | 3 +- tools/perf/util/pmus.c | 6 ++++ tools/perf/util/string.c | 48 ++++++++++++++++++++++++++++++++ tools/perf/util/string2.h | 1 + 13 files changed, 128 insertions(+), 44 deletions(-) create mode 100644 tools/perf/tests/util.c