From nobody Sat Feb 7 22:24:57 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 3244C1F2C23 for ; Tue, 7 Jan 2025 15:54:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736265266; cv=none; b=PIzRjXcgsXlbCImLl8Z90Dw1f8tgk+g3CI6IyabhH/HqwNaIYlXhwbUGtncGxnJ1GTmG2DnXHwp7hUKp/YettkDUzfeNgkWRnH4IpK2RZwPKf5ymDc/DhK16VQwbjfAWtjys4UliucpuMO+fxOJrJQNTLgiK96SywjEA2gwQTzc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736265266; c=relaxed/simple; bh=v27pi1/dC2322Q1ClIKl+JyxpRx+XEjNBGaYKD+O/8Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PxBR0m4cbepLd8cVGtTPqecaLe967FDgOVzG6osESksI/rwExhHZ9UacCKoIYY/IAp0QJbgqYaFkJjCaKpj70PBL4ZnWSrtBLxCATm9yRLPgPBOGcN5yCsGBOBZTepjCmUmgZ8SnM5/g34ltpZ8BhaHhISfbjHt+ooDeW99y+QI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=LH6DzDl2; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LH6DzDl2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736265262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=91lackm5hxoRjTCh0HtEa5etwu/km6EWDODTbGXsMWQ=; b=LH6DzDl2BBdgctnI974HTaToYgkTOkdeb2lHcNL7oe/GYfdEUuqodQx8YLE9OVUMaRMeDT LtQHB+6YOUpcXZuodDs9IMxE98/yoxVie5CDeNisCUbhSfa7Y3xbmGPLnTxsRHqJ0UVcIs Gi5ubUaRXqNV+XZYbA4VI3OnCxKXbmQ= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-614-oWbpAcXqNu6q_WIA5kGXwQ-1; Tue, 07 Jan 2025 10:54:21 -0500 X-MC-Unique: oWbpAcXqNu6q_WIA5kGXwQ-1 X-Mimecast-MFC-AGG-ID: oWbpAcXqNu6q_WIA5kGXwQ Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 15A50195608F; Tue, 7 Jan 2025 15:54:20 +0000 (UTC) Received: from loobloo.redhat.com (unknown [10.72.112.83]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9564E1955F43; Tue, 7 Jan 2025 15:54:17 +0000 (UTC) From: Shizhao Chen To: Tejun Heo , David Vernet Cc: linux-kernel@vger.kernel.org Subject: [PATCH] sched_ext: Add option -l in selftest runner to list all available tests Date: Tue, 7 Jan 2025 23:52:19 +0800 Message-ID: <20250107155411.153724-1-shichen@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" The selftest runner currently allows selecting tests via the -t option. This patch adds a new -l option that lists all available tests, providing users with an overview of the tests they can choose from. This enhancement is especially useful for scripting and automation purposes, making it easier to discover and run tests. Signed-off-by: Shizhao Chen --- tools/testing/selftests/sched_ext/runner.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/sched_ext/runner.c b/tools/testing/sel= ftests/sched_ext/runner.c index eab48c7ff309..aa2d7d32dda9 100644 --- a/tools/testing/selftests/sched_ext/runner.c +++ b/tools/testing/selftests/sched_ext/runner.c @@ -22,11 +22,12 @@ const char help_fmt[] =3D "\n" " -t TEST Only run tests whose name includes this string\n" " -s Include print output for skipped tests\n" +" -l List all available tests\n" " -q Don't print the test descriptions during run\n" " -h Display this help and exit\n"; =20 static volatile int exit_req; -static bool quiet, print_skipped; +static bool quiet, print_skipped, list; =20 #define MAX_SCX_TESTS 2048 =20 @@ -133,7 +134,7 @@ int main(int argc, char **argv) =20 libbpf_set_strict_mode(LIBBPF_STRICT_ALL); =20 - while ((opt =3D getopt(argc, argv, "qst:h")) !=3D -1) { + while ((opt =3D getopt(argc, argv, "qslt:h")) !=3D -1) { switch (opt) { case 'q': quiet =3D true; @@ -141,6 +142,9 @@ int main(int argc, char **argv) case 's': print_skipped =3D true; break; + case 'l': + list =3D true; + break; case 't': filter =3D optarg; break; @@ -154,6 +158,13 @@ int main(int argc, char **argv) enum scx_test_status status; struct scx_test *test =3D &__scx_tests[i]; =20 + if (list) { + printf("%s\n", test->name); + if (i =3D=3D (__scx_num_tests - 1)) + return 0; + continue; + } + if (filter && should_skip_test(test, filter)) { /* * Printing the skipped tests and their preambles can --=20 2.47.1