From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f74.google.com (mail-dl1-f74.google.com [74.125.82.74]) (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 D682B3FF1C7 for ; Tue, 2 Jun 2026 17:42:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780422145; cv=none; b=nspbMZ0FVYDPQt/UbmY10H/xCTiPTvjw4weNvkv0QT8Ha3BEuuoibRqsom2sNB2tyWlPhDxSRXwpIJPkFLrUpOqEPGtMpgp2q72+ZkYXHQpb45jVu+06Zl2zDknYol10nnnI7bDtppwjStVG4tUTg9cjhpQiGZb1taT9KVlBZJQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780422145; c=relaxed/simple; bh=VCvZZOPl0PnHKw3y9FptUV/R1CXqUa0az01RQlDyamg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=sVzEdLXez76QBVl2vS37B/nILX2A9kDbVjTHj6juGvlwmN0J/zYMxtYQTMyKL7YTLsy7B645BRbD4OFH+8lWJ1AWGUZ8R2SVStLsK5xcJzNZqLFtYAafysyZThBjkD5nXPJM7gr1yLSJPNg6mhx8fqxEm+l07GA1PCNGBoULcEQ= 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=OggHudZm; arc=none smtp.client-ip=74.125.82.74 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="OggHudZm" Received: by mail-dl1-f74.google.com with SMTP id a92af1059eb24-137dd5100c7so4538492c88.1 for ; Tue, 02 Jun 2026 10:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780422143; x=1781026943; 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=g6/pn7OpFDoDOMJGR8y4harS+WqtNci/6qa5LqKicOU=; b=OggHudZmuMoG9CB8MC5j66S2DPFJ+OVRM3dCSwqsozd7uegmmFjsZ3sXsLbHRNZzKZ yPDqOvllpt48bvKxLzYhW3yRJnn8IDYTx7/gidiv8GRtrdwsPl/TlO9iq1pyefezPaWY uQb6DVRm07ydL9OfXJAX7iH6vu1sq9XMgGFKqUnWP/g2F+2Fz1QlpdX5FKJtMaPNIUGp q+eiGQ7qyI344/nynB7h+VROe/n1PqDZQ0K2XJ0k1ieQ+yjI/NjF28h3Xt5DAAVFEP0Z cBRBWJ3jhyoCGYNkwSPw1AVcjNUP/PvZ/EZr0nYvFf+0dVYYjhYoC5IzlEqaqyyiNrFC /SGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780422143; x=1781026943; 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=g6/pn7OpFDoDOMJGR8y4harS+WqtNci/6qa5LqKicOU=; b=kp1mG8QfshFpjeSJmAWvv/KKJKYA0YjKWj4Vd4O0oFmpd4rnEv0WEdzr4z/n/SIkQy 4O0F/QZthxnhc4EesYy6iD5Zwfbeen6mhaPC9BOrXmUEMmLp7G8jRcqyhyyNyx5Lk7iU BdkHdtK+UOpm9QfZXaBmBfj9vhET5G10CWsCckh4uNOajPEoShDOond91t1zE2I0ICvc LMA3hYWaYw1crCLzE5yrgbKIyR+vbo+cvHcgxIip4VOVxTLwbDVyQdTJBS12Ge6x8Mth YATq3dC3aM30C6FxVkKTrYdZ36tceEiNJx3k5GN4tOi6plFIOjWGjrB+aCrWxG/GmQIA Op2g== X-Forwarded-Encrypted: i=1; AFNElJ+qzXtQ6jo2VX28966WoGG+KsdFKcRvf9YtDH7CH9X0hThDFN+UY4KpJitT2qya//RccQFwjT8qN8ooJuM=@vger.kernel.org X-Gm-Message-State: AOJu0YxjOP2Zf0sp+GT1fzv/0TRY1/VwbVrX/TJTewgc1+RhwS1qCf4R RUiWAO5f6qhrhIRs96yXwhIeeG9A3YW/QxUF2CvgRQrbhBxfgGjgTj7Sc1zos6+H/NCO+3IfbeT dwdOojOsI1A== X-Received: from dlea3-n2.prod.google.com ([2002:a05:701b:4203:20b0:135:dd6a:be57]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:f305:b0:137:f10d:dfb8 with SMTP id a92af1059eb24-137f10de354mr673280c88.20.1780422142701; Tue, 02 Jun 2026 10:42:22 -0700 (PDT) Date: Tue, 2 Jun 2026 10:41:24 -0700 In-Reply-To: <20260602174129.3192312-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: <20260602073132.2653307-1-irogers@google.com> <20260602174129.3192312-1-irogers@google.com> X-Mailer: git-send-email 2.54.0.1013.g208068f2d8-goog Message-ID: <20260602174129.3192312-14-irogers@google.com> Subject: [PATCH v8 13/18] perf test: Split monolithic 'util' test suite into sub-tests From: Ian Rogers To: irogers@google.com, acme@kernel.org, namhyung@kernel.org Cc: adrian.hunter@intel.com, 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.1013.g208068f2d8-goog