Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1408798rdb; Mon, 4 Sep 2023 12:59:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7kDnMR9gLfZWejMqpeY8Zq+n7NmTnhurdJOoX6wKuE6yn7kwnrDmZzdlPIWhYCxBRzlDn X-Received: by 2002:a5d:4b87:0:b0:319:5e0d:9b0f with SMTP id b7-20020a5d4b87000000b003195e0d9b0fmr7914922wrt.33.1693857558153; Mon, 04 Sep 2023 12:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693857558; cv=none; d=google.com; s=arc-20160816; b=QUUIfjdggObwGIo6RTxXkI/PR7p6ux/NXdSOYZ5VI50UuKmoORk2zQblQLvuYngfkC NQWEVknOis4YMapdryCTtBd7mJh/Sc+iQpQAX2kn9hRxcoM6YsUxx5ODFPLoHqZiqWrW bqicNcuzfQw+CxpbsjAIlyWTjQmBBmYsamG+KmjVkCkjhL/uRiPUAdUZH6rMiHO+pb5Q /b1B8InKiYPflzJ2Tjnj4vqewPb7pHPnwpRs/+zhiEjyFHw2aTIw1kfPhUBl9dK3KKwB kN+bc3sz+/ymUQN4pYEH+xvgE+kZKEkH1IzlQkQNnizZpnQM42QZnQiFv2M2WNc++CK8 /TvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ZWYs9YAzry14VAg9KF91INGeqen8xkKF1/QOOQJoH+E=; fh=nKKq+p1eQBFW1Ya+8h1wiItyvzZTGBeWUsSDpHFiWhY=; b=vkSwlwqthwyu4JhgBGZKhu1CMWac/Jwy4V3d0FGrDk/d8vn+UclxXxHHsqITTFdwHp ZsUeWxUtR+OLx0p3s/q8Wd+bAfJvv32Xa1xN1UUcpBdXpTAEfKzUXV04BXWIOOBUgyUP AeDA9wP1cSWLcxHzPz36YQ7D1+UnnsEzd9X5IdSqoSWSjNtLbd7quLbd7uyy7b/ToV+Q qWpZFp5Otxvwi9ZEg649A+04D0Tk51tHMiAx+5pSq73DTV+0DLkUgxz25g4P/OxEfA9R yFobwV6YRfs6THAigbGDWByGlE1NF1/EX841Awy3UeDL4knS+n635/i8MieSENdCYID3 Kkmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020aa7d88c000000b0052563bff339si6266586edq.286.2023.09.04.12.58.52; Mon, 04 Sep 2023 12:59:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352671AbjIDJwB (ORCPT + 99 others); Mon, 4 Sep 2023 05:52:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231742AbjIDJv7 (ORCPT ); Mon, 4 Sep 2023 05:51:59 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 01BF111D; Mon, 4 Sep 2023 02:51:55 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 -- 2.34.1