From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (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 4039435CB60 for ; Mon, 1 Jun 2026 06:15:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780294516; cv=none; b=b1lImO0/GGKNjLI55fDWvDVmQYsr0YAZEeUFzTJZh8oPJ+GGZrZ/2cU/k4H3tSqYNb6v7VClTyEhVZSPuXrFTZe4JO44nIou2nz/1fv9aIYnFqSx+s0hyEFdEFchM+zmhdNmmWokL0Hab8AOdKD1EnRJfjmQVqcWRbCmpwEduDI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780294516; c=relaxed/simple; bh=kwIpUas8CmAyFq9rUING30MN44XBQkAG67T0YWFq4oc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Ntjd2Fb251XHpRMUZvnRoebJOauJtatPuCv8hC/FFlvldYa+4NwimCdaVG0NhF6tSOh6jIzfhFvQsWMWT+04a32ZQAK4eLN7jKPTrQ9xcD5AAQH29c0z7y4DqsIAynP1lR092RK5yXWYHjsg9SHO9z7WmKVAhcTfiY758iwVJ6M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=spXyPIUA; arc=none smtp.client-ip=209.85.210.201 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=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="spXyPIUA" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-8421f5d76aaso1413715b3a.2 for ; Sun, 31 May 2026 23:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780294513; x=1780899313; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=1IOal3hqFXb7r1up/rx+u30ZeQHjxIhWl995ZJvn/b8=; b=spXyPIUAAc3jKPnZUnYlPCv2E/i5fy0WJiM8JzL3n/fhsqd8O4HYkhACP8sGuT6bBw P7NshWtwdMY3136Fv4uhsmwF5VKydL2OT3JPLUffMGJ6llJGyxAxamK2ksOJR3r+WoZs gkdmxQ1Pf4BtQi0bHU8tZam+gI/PiQGTlA4uTKn7T58EooqrJ9WsvJRqfC+i0F2IWBbw zr4X0lEBBYVnx9RreCStRQNZmW3MmHGijWOt+2RdkDT17Ij2HatSFZsZSv5+x9aHVqbH OHsoAj97XmSw08mRkEducK5IcQQzYFZpdBbpdgNBbApdVn324Negxe6+ztQalDT0hmxs Klog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780294513; x=1780899313; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1IOal3hqFXb7r1up/rx+u30ZeQHjxIhWl995ZJvn/b8=; b=ec+ctmv6ZZ4smS0ofXEqg48AN0/LvI3CIUjooJvat+lchIt9+FB9V78oGWB8xk98IV uHl3rS6SgdNYpS+l9g7GwusPUuKTWKdAtn4pcotmGIFDHSVALgKCpxBDZmZyI88g6YAY bYBoE5nnP3UqMGKgN0YNEshoBnXUfptzFXH8kxRSGqWX029O9U6JgBQpka+1RYBK9HBi UDy74x/TComh7N2Cbg8EdYqc9DJI3Oh1ZMl5wijzdYgSf+raVfaJ/wwyNg+OFZExpBsk DlIbGgve4YmdH++Au9Y0QK4dgPLVu6t+NCpPzHzpBwO2e41FOyNNixgTBYqcgFR0RHyi UTGA== X-Forwarded-Encrypted: i=1; AFNElJ+Am9aR3IyfDzBR3uq40qdgPex0ueZD0T+VoN8cNDdCLumyg1X6Rcm4G9ZXkM7A74nge+oFzmHYalqJoMU=@vger.kernel.org X-Gm-Message-State: AOJu0Yxkr+tcBKhEbCE2+oolOIqb7kDJllYv00C+lREVofquBmCHxNt9 GDOQwp4KV1SWBRQRkV4T6Kfe8dr7yL+u7MtIJJ3pO2FSeafDGfmTCL1U5IaCE/mYduedkFN0aQ7 HnYZviny7ow== X-Received: from pfbki6.prod.google.com ([2002:a05:6a00:9486:b0:842:2121:d449]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:3317:b0:82a:1529:2b4f with SMTP id d2e1a72fcca58-842257a6f20mr8731962b3a.44.1780294513013; Sun, 31 May 2026 23:15:13 -0700 (PDT) Date: Sun, 31 May 2026 23:13:58 -0700 In-Reply-To: <20260601061401.1541457-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260601000548.1195604-1-irogers@google.com> <20260601061401.1541457-1-irogers@google.com> X-Mailer: git-send-email 2.54.0.823.g6e5bcc1fc9-goog Message-ID: <20260601061401.1541457-13-irogers@google.com> Subject: [PATCH 12/15] perf test: Split monolithic 'util' test suite into sub-tests From: Ian Rogers To: irogers@google.com, acme@kernel.org, adrian.hunter@intel.com, namhyung@kernel.org Cc: alexander.shishkin@linux.intel.com, james.clark@linaro.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, mingo@redhat.com, peterz@infradead.org Content-Type: text/plain; charset="UTF-8" Refactor the monolithic 'util' test suite into distinct 'String replacement' and 'BLAKE2s hash' sub-tests using the struct test_case framework. This improves test reporting granularity and is used in a subsequent perf test for JUnit XML test result reporting. Assisted-by: Gemini-CLI:Google Gemini 3 Signed-off-by: Ian Rogers --- tools/perf/tests/util.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/util.c b/tools/perf/tests/util.c index bf2c5b133884..f9abd9911e6c 100644 --- a/tools/perf/tests/util.c +++ b/tools/perf/tests/util.c @@ -86,7 +86,12 @@ static int test_blake2s(void) return 0; } -static int test__util(struct test_suite *t __maybe_unused, int subtest __maybe_unused) +static int test__blake2s_case(struct test_suite *t __maybe_unused, int subtest __maybe_unused) +{ + return test_blake2s(); +} + +static int test__strreplace(struct test_suite *t __maybe_unused, int subtest __maybe_unused) { TEST_ASSERT_VAL("empty string", test_strreplace(' ', "", "123", "")); TEST_ASSERT_VAL("no match", test_strreplace('5', "123", "4", "123")); @@ -95,7 +100,16 @@ static int test__util(struct test_suite *t __maybe_unused, int subtest __maybe_u TEST_ASSERT_VAL("replace long", test_strreplace('a', "abcabc", "longlong", "longlongbclonglongbc")); - return test_blake2s(); + return 0; } -DEFINE_SUITE("util", util); +static struct test_case tests__util[] = { + TEST_CASE("String replacement", strreplace), + TEST_CASE("BLAKE2s hash", blake2s_case), + { .name = NULL, } +}; + +struct test_suite suite__util = { + .desc = "util", + .test_cases = tests__util, +}; -- 2.54.0.823.g6e5bcc1fc9-goog