From nobody Wed Jun 17 06:11:26 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 323703EF64E for ; Thu, 23 Apr 2026 13:06:14 +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=1776949575; cv=none; b=R7vlTnZfPynEVEsM/krwef6iiTlSGmykTE+wFAStgvU+pBNd5B5TbS3+lTHri1zLh7BfUddNTdvxoACMhHfhvhqkSNITlLmW+UwTzkyFSBXPGOVsrglXo6f0ghNXAdd79QW4RdaiLiki/QjLHQWL/D2SgSnKFUesx/6oEGXLPTs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949575; c=relaxed/simple; bh=0vtLZmqJ9+Z43kFh9gXZxnBWxliSwl4qmbK463/AatQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=boGmqNn8qbiEx/tyNrBjqf4/U0y7BNK3gMM8HwfjVFGr8XFSQf0P6Jg0iV2e7dcGxHqvxbV/patOq/IaptQer7hgdlcsjYzWqy89rB7/sEEH+lg//Gi2GsEm6dFBvHH3pRxnzIzuvmCrWrnL61ApR7pZ9tmbJLftGJlkPf/l5bo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=FLxnY+o4; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="FLxnY+o4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776949573; 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: in-reply-to:in-reply-to:references:references; bh=ISIlbm7FM42+QOYm/52hF3mwhKKiVuHDOEi8RJI68Ks=; b=FLxnY+o4Vzs+rjN22lE7G3uZzIA3h3+QSkyrQfWpahjrMJ+2V3b5ee3IQQqKDTMieM3exj hvmh5aQpg/D1auhRvOGIjTtFpiqdlbg+qNeRvGxdf2eATjifJPr2wN4+zNnCo8qINBeLHd mte8slzgMDNDpvc2UHi0lvCxezhAKtQ= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-146-frvYNX9LP6idmrPoSLBa4g-1; Thu, 23 Apr 2026 09:06:08 -0400 X-MC-Unique: frvYNX9LP6idmrPoSLBa4g-1 X-Mimecast-MFC-AGG-ID: frvYNX9LP6idmrPoSLBa4g_1776949568 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C9A56180064B; Thu, 23 Apr 2026 13:06:07 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.17.109]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 98EBF1800348; Thu, 23 Apr 2026 13:06:05 +0000 (UTC) From: Tomas Glozar To: Steven Rostedt , Tomas Glozar Cc: John Kacur , Luis Goncalves , Crystal Wood , Costa Shulyupin , Wander Lairson Costa , LKML , linux-trace-kernel Subject: [PATCH 1/9] rtla/tests: Cover both top and hist tools where possible Date: Thu, 23 Apr 2026 15:05:50 +0200 Message-ID: <20260423130558.882022-2-tglozar@redhat.com> In-Reply-To: <20260423130558.882022-1-tglozar@redhat.com> References: <20260423130558.882022-1-tglozar@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.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" RTLA runtime tests currently do not cover both tool variants for osnoise and timerlat properly. Many tests applicable to both tools are only tested for one tool, selected randomly. Introduce two new shell functions, check_top_hist() and check_top_q_hist(). The functions use the same syntax as check() and run check() on the arguments twice: once replacing the "TOOL" string in the command with "top" (or "top -q"), once replacing it with "hist". The top -q variant is used for tests relying on messages printed after aborting the RTLA main loop with a starting new line, which only happens for top tools in quiet mode; without -q, the top output is printed on the same line and the matches would fail. Tests that are applicable to both top and hist tools were modified to the run for both; additionally, tests that were already done for both tools were migrated to the new shell functions, unless the test command or matches differ between the tools. Additional tests were added to test tool-specific help messages. Signed-off-by: Tomas Glozar Reviewed-by: Wander Lairson Costa --- tools/tracing/rtla/tests/engine.sh | 15 ++++++ tools/tracing/rtla/tests/osnoise.t | 46 +++++++++-------- tools/tracing/rtla/tests/timerlat.t | 76 ++++++++++++++--------------- 3 files changed, 73 insertions(+), 64 deletions(-) diff --git a/tools/tracing/rtla/tests/engine.sh b/tools/tracing/rtla/tests/= engine.sh index ed261e07c6d9..27d92f19a322 100644 --- a/tools/tracing/rtla/tests/engine.sh +++ b/tools/tracing/rtla/tests/engine.sh @@ -112,6 +112,21 @@ check_with_osnoise_options() { NO_RESET_OSNOISE=3D1 check "$arg1" "$arg2" "$arg3" } =20 +check_top_hist() { + # Test one command with both "top" and "hist" tools, replacing "TOOL" in + # command with either "top" or "hist" respectively, and prefixing the test + # names with "top " and "hist ". + check "top $1" "$(echo "$2" | sed 's/TOOL/top/g')" "${@:3}" + check "hist $1" "$(echo "$2" | sed 's/TOOL/hist/g')" "${@:3}" +} + +check_top_q_hist() { + # Same as above, but pass "-q" to top so that strings printed in main + # loop are on their own line for top too, not only for hist. + check "top $1" "$(echo "$2" | sed 's/TOOL/top -q/g')" "${@:3}" + check "hist $1" "$(echo "$2" | sed 's/TOOL/hist/g')" "${@:3}" +} + set_timeout() { TIMEOUT=3D"timeout -v -k 15s $1" } diff --git a/tools/tracing/rtla/tests/osnoise.t b/tools/tracing/rtla/tests/= osnoise.t index 396334608920..ce3a448b1f87 100644 --- a/tools/tracing/rtla/tests/osnoise.t +++ b/tools/tracing/rtla/tests/osnoise.t @@ -7,13 +7,15 @@ set_timeout 2m =20 check "verify help page" \ "osnoise --help" 0 "osnoise version" -check "verify the --priority/-P param" \ - "osnoise top -P F:1 -c 0 -r 900000 -d 10s -q -S 1 --on-threshold shell,co= mmand=3D\"tests/scripts/check-priority.sh osnoise/ SCHED_FIFO 1\"" \ +check_top_hist "verify help page" \ + "osnoise TOOL --help" 0 "rtla osnoise" +check_top_q_hist "verify the --priority/-P param" \ + "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,comm= and=3D\"tests/scripts/check-priority.sh osnoise/ SCHED_FIFO 1\"" \ 2 "Priorities are set correctly" -check "verify the --stop/-s param" \ - "osnoise top -s 30 -T 1" 2 "osnoise hit stop tracing" -check "verify the --trace param" \ - "osnoise hist -s 30 -T 1 -t" 2 "Saving trace to osnoise_trace.txt" +check_top_q_hist "verify the --stop/-s param" \ + "osnoise TOOL -s 30 -T 1" 2 "osnoise hit stop tracing" +check_top_q_hist "verify the --trace param" \ + "osnoise TOOL -s 30 -T 1 -t" 2 "Saving trace to osnoise_trace.txt" check "verify the --entries/-E param" \ "osnoise hist -P F:1 -c 0 -r 900000 -d 10s -b 10 -E 25" =20 @@ -24,27 +26,23 @@ check_with_osnoise_options "apply default period" \ "osnoise hist -s 1" 2 period_us=3D600000000 =20 # Actions tests -check "trace output through -t with custom filename" \ - "osnoise hist -S 2 -t custom_filename.txt" 2 "^ Saving trace to custom_f= ilename.txt$" -check "trace output through --on-threshold trace" \ - "osnoise hist -S 2 --on-threshold trace" 2 "^ Saving trace to osnoise_tr= ace.txt$" -check "trace output through --on-threshold trace with custom filename" \ - "osnoise hist -S 2 --on-threshold trace,file=3Dcustom_filename.txt" 2 "^ = Saving trace to custom_filename.txt$" -check "exec command" \ - "osnoise hist -S 2 --on-threshold shell,command=3D'echo TestOutput'" 2 "^= TestOutput$" -check "multiple actions" \ - "osnoise hist -S 2 --on-threshold shell,command=3D'echo -n 1' --on-thresh= old shell,command=3D'echo 2'" 2 "^12$" +check_top_q_hist "trace output through -t with custom filename" \ + "osnoise TOOL -S 2 -t custom_filename.txt" 2 "^ Saving trace to custom_f= ilename.txt$" +check_top_q_hist "trace output through --on-threshold trace" \ + "osnoise TOOL -S 2 --on-threshold trace" 2 "^ Saving trace to osnoise_tr= ace.txt$" +check_top_q_hist "trace output through --on-threshold trace with custom fi= lename" \ + "osnoise TOOL -S 2 --on-threshold trace,file=3Dcustom_filename.txt" 2 "^ = Saving trace to custom_filename.txt$" +check_top_q_hist "exec command" \ + "osnoise TOOL -S 2 --on-threshold shell,command=3D'echo TestOutput'" 2 "^= TestOutput$" +check_top_q_hist "multiple actions" \ + "osnoise TOOL -S 2 --on-threshold shell,command=3D'echo -n 1' --on-thresh= old shell,command=3D'echo 2'" 2 "^12$" check "hist stop at failed action" \ "osnoise hist -S 2 --on-threshold shell,command=3D'echo -n 1; false' --on= -threshold shell,command=3D'echo -n 2'" 2 "^1# RTLA osnoise histogram$" check "top stop at failed action" \ "osnoise top -S 2 --on-threshold shell,command=3D'echo -n abc; false' --o= n-threshold shell,command=3D'echo -n defgh'" 2 "^abc" "defgh" -check "hist with continue" \ - "osnoise hist -S 2 -d 5s --on-threshold shell,command=3D'echo TestOutput'= --on-threshold continue" 0 "^TestOutput$" -check "top with continue" \ - "osnoise top -q -S 2 -d 5s --on-threshold shell,command=3D'echo TestOutpu= t' --on-threshold continue" 0 "^TestOutput$" -check "hist with trace output at end" \ - "osnoise hist -d 1s --on-end trace" 0 "^ Saving trace to osnoise_trace.t= xt$" -check "top with trace output at end" \ - "osnoise top -d 1s --on-end trace" 0 "^ Saving trace to osnoise_trace.tx= t$" +check_top_q_hist "with continue" \ + "osnoise TOOL -S 2 -d 5s --on-threshold shell,command=3D'echo TestOutput'= --on-threshold continue" 0 "^TestOutput$" +check_top_hist "with trace output at end" \ + "osnoise TOOL -d 1s --on-end trace" 0 "^ Saving trace to osnoise_trace.t= xt$" =20 test_end diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests= /timerlat.t index fd4935fd7b49..d7944710a859 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -22,64 +22,60 @@ export RTLA_NO_BPF=3D$option # Basic tests check "verify help page" \ "timerlat --help" 0 "timerlat version" -check "verify -s/--stack" \ - "timerlat top -s 3 -T 10 -t" 2 "Blocking thread stack trace" -check "verify -P/--priority" \ - "timerlat top -P F:1 -c 0 -d 10s -q -T 1 --on-threshold shell,command=3D\= "tests/scripts/check-priority.sh timerlatu/ SCHED_FIFO 1\"" \ +check_top_hist "verify help page" \ + "timerlat TOOL --help" 0 "rtla timerlat" +check_top_hist "verify -s/--stack" \ + "timerlat TOOL -s 3 -T 10 -t" 2 "Blocking thread stack trace" +check_top_hist "verify -P/--priority" \ + "timerlat TOOL -P F:1 -c 0 -d 10s -T 1 --on-threshold shell,command=3D\"t= ests/scripts/check-priority.sh timerlatu/ SCHED_FIFO 1\"" \ 2 "Priorities are set correctly" -check "test in nanoseconds" \ - "timerlat top -i 2 -c 0 -n -d 10s" 2 "ns" -check "set the automatic trace mode" \ - "timerlat top -a 5" 2 "analyzing it" -check "dump tasks" \ - "timerlat top -a 5 --dump-tasks" 2 "Printing CPU tasks" +check_top_hist "test in nanoseconds" \ + "timerlat TOOL -i 2 -c 0 -n -d 10s" 2 "ns" +check_top_hist "set the automatic trace mode" \ + "timerlat TOOL -a 5" 2 "analyzing it" +check_top_hist "dump tasks" \ + "timerlat TOOL -a 5 --dump-tasks" 2 "Printing CPU tasks" check "print the auto-analysis if hits the stop tracing condition" \ "timerlat top --aa-only 5" 2 -check "disable auto-analysis" \ - "timerlat top -s 3 -T 10 -t --no-aa" 2 -check "verify -c/--cpus" \ - "timerlat hist -c 0 -d 10s" -check "hist test in nanoseconds" \ - "timerlat hist -i 2 -c 0 -n -d 10s" 2 "ns" +check_top_hist "disable auto-analysis" \ + "timerlat TOOL -s 3 -T 10 -t --no-aa" 2 +check_top_hist "verify -c/--cpus" \ + "timerlat TOOL -c 0 -d 10s" =20 # Actions tests -check "trace output through -t" \ - "timerlat hist -T 2 -t" 2 "^ Saving trace to timerlat_trace.txt$" -check "trace output through -t with custom filename" \ - "timerlat hist -T 2 -t custom_filename.txt" 2 "^ Saving trace to custom_= filename.txt$" -check "trace output through --on-threshold trace" \ - "timerlat hist -T 2 --on-threshold trace" 2 "^ Saving trace to timerlat_= trace.txt$" -check "trace output through --on-threshold trace with custom filename" \ - "timerlat hist -T 2 --on-threshold trace,file=3Dcustom_filename.txt" 2 "^= Saving trace to custom_filename.txt$" -check "exec command" \ - "timerlat hist -T 2 --on-threshold shell,command=3D'echo TestOutput'" 2 "= ^TestOutput$" -check "multiple actions" \ - "timerlat hist -T 2 --on-threshold shell,command=3D'echo -n 1' --on-thres= hold shell,command=3D'echo 2'" 2 "^12$" +check_top_q_hist "trace output through -t" \ + "timerlat TOOL -T 2 -t" 2 "^ Saving trace to timerlat_trace.txt$" +check_top_q_hist "trace output through -t with custom filename" \ + "timerlat TOOL -T 2 -t custom_filename.txt" 2 "^ Saving trace to custom_= filename.txt$" +check_top_q_hist "trace output through --on-threshold trace" \ + "timerlat TOOL -T 2 --on-threshold trace" 2 "^ Saving trace to timerlat_= trace.txt$" +check_top_q_hist "trace output through --on-threshold trace with custom fi= lename" \ + "timerlat TOOL -T 2 --on-threshold trace,file=3Dcustom_filename.txt" 2 "^= Saving trace to custom_filename.txt$" +check_top_q_hist "exec command" \ + "timerlat TOOL -T 2 --on-threshold shell,command=3D'echo TestOutput'" 2 "= ^TestOutput$" +check_top_q_hist "multiple actions" \ + "timerlat TOOL -T 2 --on-threshold shell,command=3D'echo -n 1' --on-thres= hold shell,command=3D'echo 2'" 2 "^12$" check "hist stop at failed action" \ "timerlat hist -T 2 --on-threshold shell,command=3D'echo -n 1; false' --o= n-threshold shell,command=3D'echo -n 2'" 2 "^1# RTLA timerlat histogram$" check "top stop at failed action" \ "timerlat top -T 2 --on-threshold shell,command=3D'echo -n abc; false' --= on-threshold shell,command=3D'echo -n defgh'" 2 "^abc" "defgh" -check "hist with continue" \ - "timerlat hist -T 2 -d 5s --on-threshold shell,command=3D'echo TestOutput= ' --on-threshold continue" 0 "^TestOutput$" -check "top with continue" \ - "timerlat top -q -T 2 -d 5s --on-threshold shell,command=3D'echo TestOutp= ut' --on-threshold continue" 0 "^TestOutput$" -check "hist with trace output at end" \ - "timerlat hist -d 1s --on-end trace" 0 "^ Saving trace to timerlat_trace= .txt$" -check "top with trace output at end" \ - "timerlat top -d 1s --on-end trace" 0 "^ Saving trace to timerlat_trace.= txt$" +check_top_q_hist "with continue" \ + "timerlat TOOL -T 2 -d 5s --on-threshold shell,command=3D'echo TestOutput= ' --on-threshold continue" 0 "^TestOutput$" +check_top_hist "with trace output at end" \ + "timerlat TOOL -d 1s --on-end trace" 0 "^ Saving trace to timerlat_trace= .txt$" =20 # BPF action program tests if [ "$option" -eq 0 ] then # Test BPF action program properly in BPF mode [ -z "$BPFTOOL" ] && BPFTOOL=3Dbpftool - check "hist with BPF action program (BPF mode)" \ - "timerlat hist -T 2 --bpf-action tests/bpf/bpf_action_map.o --on-thresho= ld shell,command=3D'$BPFTOOL map dump name rtla_test_map'" \ + check_top_q_hist "with BPF action program (BPF mode)" \ + "timerlat TOOL -T 2 --bpf-action tests/bpf/bpf_action_map.o --on-thresho= ld shell,command=3D'$BPFTOOL map dump name rtla_test_map'" \ 2 '"value": 42' else # Test BPF action program failure in non-BPF mode - check "hist with BPF action program (non-BPF mode)" \ - "timerlat hist -T 2 --bpf-action tests/bpf/bpf_action_map.o" \ + check_top_q_hist "with BPF action program (non-BPF mode)" \ + "timerlat TOOL -T 2 --bpf-action tests/bpf/bpf_action_map.o" \ 1 "BPF actions are not supported in tracefs-only mode" fi done --=20 2.53.0 From nobody Wed Jun 17 06:11:26 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 9C98F3EF670 for ; Thu, 23 Apr 2026 13:06:20 +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=1776949582; cv=none; b=XB2tCXBnI2B4znrAX4JlNabyvzh8Ug7oeaIgISYPa9/4kXovu6K2mFhTHDM79vxd2AF8ex7YQUA9yvkdyJvcybsOqmBgtT/SOHvhSDxNLjWrmCheJdRH1xo9GokjjEZ4tcu1SF7sJ1Urt1cxI6H5tIdKCyxi/kchlGJiXysAu40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949582; c=relaxed/simple; bh=t2CoUz8Zj4/5puogtzhPfPYvc6U6e28Q4tNySmvmrlI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KMgvkDqJp644EE9PxwubOiSLHFR0T9xK5G5Hw83K7azthE3SS3N4CFkKE6BkPRwtL96nREhzuKcRzDA7jthO5OF84sEVaNJq65wnd/gQSCGGRpkTvtqR+BDOd6VkCLlFjqnjq2Hv/EdITi5I9P0lrVvw//SgOGtXH/dwN8febo8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=bwt3XCvz; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="bwt3XCvz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776949579; 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: in-reply-to:in-reply-to:references:references; bh=U4ni7A0WiskMOxT/PAVOvxVYyiE4lLnyN8Tiox4c2aY=; b=bwt3XCvz1kA1c7kFrdRMGipz87t0PlDVfnAqJ50D21PXt5MA1bOmaExTalU6OaCMTunnP2 gVymcpaxEmBERfU8rQ/Q+hlCFMGIDisR3epXOxUhdTOXtyntopQvRm+A3sh/wuzx82dUF5 7mM6mhpNrfkWfEblsKFHixzQv2E34Zc= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-134-pFXTO4eSOnmjp04CXv9ToQ-1; Thu, 23 Apr 2026 09:06:15 -0400 X-MC-Unique: pFXTO4eSOnmjp04CXv9ToQ-1 X-Mimecast-MFC-AGG-ID: pFXTO4eSOnmjp04CXv9ToQ_1776949570 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7808818005A9; Thu, 23 Apr 2026 13:06:10 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.17.109]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 317AE1800348; Thu, 23 Apr 2026 13:06:08 +0000 (UTC) From: Tomas Glozar To: Steven Rostedt , Tomas Glozar Cc: John Kacur , Luis Goncalves , Crystal Wood , Costa Shulyupin , Wander Lairson Costa , LKML , linux-trace-kernel Subject: [PATCH 2/9] rtla/tests: Add get_workload_pids() helper Date: Thu, 23 Apr 2026 15:05:51 +0200 Message-ID: <20260423130558.882022-3-tglozar@redhat.com> In-Reply-To: <20260423130558.882022-1-tglozar@redhat.com> References: <20260423130558.882022-1-tglozar@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.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" RTLA runtime tests that check workload processes (currently the test case "verify -P/--priority" of timerlat.t and "verify the --priority/-P param" of osnoise.t) use "pgrep timerlatu/" or "pgrep osnoise/" respectively to identify the workload. Make them more robust by adding a get_workload_pids() helper that finds the main rtla process and returns the PIDs of all siblings other than the test script itself, plus all child processes of kthreadd that have the osnoise/timerlat kthread pattern comm. This filters out any spurious processes not related to the running test that happen to have "timerlatu/" or "osnoise/" in their command, for example, a user grepping the same names at the time of the running of the test. Signed-off-by: Tomas Glozar Reviewed-by: Wander Lairson Costa --- tools/tracing/rtla/tests/osnoise.t | 2 +- tools/tracing/rtla/tests/scripts/check-priority.sh | 8 ++++---- .../rtla/tests/scripts/lib/get_workload_pids.sh | 11 +++++++++++ tools/tracing/rtla/tests/timerlat.t | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 tools/tracing/rtla/tests/scripts/lib/get_workload_pids.= sh diff --git a/tools/tracing/rtla/tests/osnoise.t b/tools/tracing/rtla/tests/= osnoise.t index ce3a448b1f87..ed6ff0cc3329 100644 --- a/tools/tracing/rtla/tests/osnoise.t +++ b/tools/tracing/rtla/tests/osnoise.t @@ -10,7 +10,7 @@ check "verify help page" \ check_top_hist "verify help page" \ "osnoise TOOL --help" 0 "rtla osnoise" check_top_q_hist "verify the --priority/-P param" \ - "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,comm= and=3D\"tests/scripts/check-priority.sh osnoise/ SCHED_FIFO 1\"" \ + "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,comm= and=3D\"tests/scripts/check-priority.sh SCHED_FIFO 1\"" \ 2 "Priorities are set correctly" check_top_q_hist "verify the --stop/-s param" \ "osnoise TOOL -s 30 -T 1" 2 "osnoise hit stop tracing" diff --git a/tools/tracing/rtla/tests/scripts/check-priority.sh b/tools/tra= cing/rtla/tests/scripts/check-priority.sh index 79b702a34a96..b51d5232a868 100755 --- a/tools/tracing/rtla/tests/scripts/check-priority.sh +++ b/tools/tracing/rtla/tests/scripts/check-priority.sh @@ -1,8 +1,8 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 -pids=3D"$(pgrep ^$1)" || exit 1 -for pid in $pids +. "$(dirname $0)/lib/get_workload_pids.sh" +for pid in $(get_workload_pids) do - chrt -p $pid | cut -d ':' -f 2 | head -n1 | grep "^ $2\$" >/dev/null - chrt -p $pid | cut -d ':' -f 2 | tail -n1 | grep "^ $3\$" >/dev/null + chrt -p $pid | cut -d ':' -f 2 | head -n1 | grep "^ $1\$" >/dev/null + chrt -p $pid | cut -d ':' -f 2 | tail -n1 | grep "^ $2\$" >/dev/null done && echo "Priorities are set correctly" diff --git a/tools/tracing/rtla/tests/scripts/lib/get_workload_pids.sh b/to= ols/tracing/rtla/tests/scripts/lib/get_workload_pids.sh new file mode 100644 index 000000000000..8aff98cd2c1f --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/lib/get_workload_pids.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +get_workload_pids() { + local shell_pid=3D$$ + local rtla_pid=3D$(ps -o ppid=3D $shell_pid) + + # kernel threads + pgrep -P $(pgrep ^kthreadd$) -f '^(osnoise|timerlat)/[0-9]+$' + # user threads + pgrep -P $rtla_pid | grep -v "^$shell_pid$" +} diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests= /timerlat.t index d7944710a859..765dffd9d42a 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -27,7 +27,7 @@ check_top_hist "verify help page" \ check_top_hist "verify -s/--stack" \ "timerlat TOOL -s 3 -T 10 -t" 2 "Blocking thread stack trace" check_top_hist "verify -P/--priority" \ - "timerlat TOOL -P F:1 -c 0 -d 10s -T 1 --on-threshold shell,command=3D\"t= ests/scripts/check-priority.sh timerlatu/ SCHED_FIFO 1\"" \ + "timerlat TOOL -P F:1 -c 0 -d 10s -T 1 --on-threshold shell,command=3D\"t= ests/scripts/check-priority.sh SCHED_FIFO 1\"" \ 2 "Priorities are set correctly" check_top_hist "test in nanoseconds" \ "timerlat TOOL -i 2 -c 0 -n -d 10s" 2 "ns" --=20 2.53.0 From nobody Wed Jun 17 06:11:26 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 52D023EF64C for ; Thu, 23 Apr 2026 13:06:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949579; cv=none; b=QLO8Vyw3kw3zrOV/wSjHrEl1Gfqve4C2nSpcM/vJLFMCPLoXfHGoe5fZo6m9jPAB8ftEKM7ENLTW0s5IWbrPu7rH5YClayDKbc62+23Fw+ywnQsa9kHMbIaBZrOmSzVLvvEmguonb1GG2CdwhG/JQzi/zWivmLMcdyuJ3suxPxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949579; c=relaxed/simple; bh=ZHbziZ7SSDDIyMa/qC2uNWQceQJRFa3sQdroVyxIa0I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gREINqOhdoJ8SQmyw9Z5I+U/sDqgSUyhQTvd9Kdmh56qnxGamnI6gw3e8t/e1OlMjKoRy+dW54iw/KlwQgwyldck5UxG74b1QpALhNvIyAcXDY4cJhuCFycOjLNigFzF8YZzPciiVht+DSNWVv1R5Y5bf6A7D7FhIBZpiLazIuA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=ZPI1T8zP; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="ZPI1T8zP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776949577; 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: in-reply-to:in-reply-to:references:references; bh=+bFT2UtsWbdy9IKHYDAuh6L9yXrT3X5aXupRblNPuj4=; b=ZPI1T8zPM5/EVMifX0TIGB8uf5JGsmWCH/ftryLLRcyJdnlT3c8BywNZYLhLmPVk39bJ/O jP99I0Hu/vPqKuRxCjnfhyDDEZVDBWBEbANB6+QRIuZ7Ld0vKL0GYugOvFprBhvmUcR1sO 8/kTW9iyktpDJfBmBaakGPNKLrLze74= Received: from mx-prod-mc-05.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-665-LZusY-t0PdCvTUoQP2Ph7w-1; Thu, 23 Apr 2026 09:06:14 -0400 X-MC-Unique: LZusY-t0PdCvTUoQP2Ph7w-1 X-Mimecast-MFC-AGG-ID: LZusY-t0PdCvTUoQP2Ph7w_1776949573 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2AC6019560BA; Thu, 23 Apr 2026 13:06:13 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.17.109]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DE6951800348; Thu, 23 Apr 2026 13:06:10 +0000 (UTC) From: Tomas Glozar To: Steven Rostedt , Tomas Glozar Cc: John Kacur , Luis Goncalves , Crystal Wood , Costa Shulyupin , Wander Lairson Costa , LKML , linux-trace-kernel Subject: [PATCH 3/9] rtla/tests: Check -c/--cpus thread affinity Date: Thu, 23 Apr 2026 15:05:52 +0200 Message-ID: <20260423130558.882022-4-tglozar@redhat.com> In-Reply-To: <20260423130558.882022-1-tglozar@redhat.com> References: <20260423130558.882022-1-tglozar@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.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" RTLA runtime tests verify the -c/--cpus options, but do not check whether the correct affinity is actually applied. Add a script named check-cpus.sh that retrieves the affinity of all workload threads and use it to check the -c/--cpus option for both osnoise and timerlat tools. Also add missing -c/--cpus test for osnoise. Signed-off-by: Tomas Glozar Reviewed-by: Wander Lairson Costa --- tools/tracing/rtla/tests/osnoise.t | 2 ++ tools/tracing/rtla/tests/scripts/check-cpus.sh | 9 +++++++++ tools/tracing/rtla/tests/timerlat.t | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100755 tools/tracing/rtla/tests/scripts/check-cpus.sh diff --git a/tools/tracing/rtla/tests/osnoise.t b/tools/tracing/rtla/tests/= osnoise.t index ed6ff0cc3329..5edffb23981b 100644 --- a/tools/tracing/rtla/tests/osnoise.t +++ b/tools/tracing/rtla/tests/osnoise.t @@ -18,6 +18,8 @@ check_top_q_hist "verify the --trace param" \ "osnoise TOOL -s 30 -T 1 -t" 2 "Saving trace to osnoise_trace.txt" check "verify the --entries/-E param" \ "osnoise hist -P F:1 -c 0 -r 900000 -d 10s -b 10 -E 25" +check_top_q_hist "verify the -c/--cpus param" \ + "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,comm= and=3Dtests/scripts/check-cpus.sh" 2 "^Affinity of threads: 0$" =20 # Test setting default period by putting an absurdly high period # and stopping on threshold. diff --git a/tools/tracing/rtla/tests/scripts/check-cpus.sh b/tools/tracing= /rtla/tests/scripts/check-cpus.sh new file mode 100755 index 000000000000..0b016d4a7945 --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-cpus.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +. "$(dirname $0)/lib/get_workload_pids.sh" +echo -n "Affinity of threads: " +for pid in $(get_workload_pids) +do + echo -n $(taskset -c -p $pid | cut -d ':' -f 2) +done +echo diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests= /timerlat.t index 765dffd9d42a..fb60022aaa64 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -39,8 +39,8 @@ check "print the auto-analysis if hits the stop tracing c= ondition" \ "timerlat top --aa-only 5" 2 check_top_hist "disable auto-analysis" \ "timerlat TOOL -s 3 -T 10 -t --no-aa" 2 -check_top_hist "verify -c/--cpus" \ - "timerlat TOOL -c 0 -d 10s" +check_top_q_hist "verify -c/--cpus" \ + "timerlat TOOL -c 0 -d 10s -T 1 --on-threshold shell,command=3Dtests/scri= pts/check-cpus.sh" 2 "^Affinity of threads: 0$" =20 # Actions tests check_top_q_hist "trace output through -t" \ --=20 2.53.0 From nobody Wed Jun 17 06:11:26 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 19BF13EF668 for ; Thu, 23 Apr 2026 13:06:22 +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=1776949583; cv=none; b=DAP4bX/r5vMUsJETyKfuAgHiFLerl3wQfSKifaXL6HiRGr3grU/nXBpqeNmDK3+tlTXKSUBDcY43TMWYFadZzwyKLKUn5hMu3PTzxbEPQsPtK1rlaNIn4t5w06/xyMcFcs0CE/T4ItWuFMJwY31jFh4Xz8UqKHbedVG/ut48fMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949583; c=relaxed/simple; bh=IVEoVJLaOW+OQ3xUR3Fk3fINw5X12rMVrCN7XEIr5nc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C4UqG9WfGOv2Mn58ML/4ZabP11bttfpbJHWZsYHacrmNEOrvj3oirx0Q2/BwhStQtHxe4Y8oVIW1xAA5euaXqDh82m3qATRSt2Bsul3teGSNB8GCW0SysF2M+mM4jjl7EyNtNGCRMBEyDd78QdLnonrHp1ffNJYgTyK0YIzxhl0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=BWc0zMbp; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="BWc0zMbp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776949581; 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: in-reply-to:in-reply-to:references:references; bh=dUPA16kyMcDrjTI7wxaAg2ovzTokNi1sNbJRhq/QcZI=; b=BWc0zMbpC8lo7gvpXGx4N9yJ1sb3BDa5W8dpVc1or4wXmFq19JT5tHyCIQelQJHnnSon// 5yfLw2/RX74AxKJYKoM1oRZBiYcJtG1DS8TFppUzm0lY/r9gaXJxzQrc9CkQHpR9ihYNzR QUIBL7Wie7VR6cBoeWrI9h1mir8eJRA= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-VHMa3HWfNF6Ve-mvAfIabQ-1; Thu, 23 Apr 2026 09:06:17 -0400 X-MC-Unique: VHMa3HWfNF6Ve-mvAfIabQ-1 X-Mimecast-MFC-AGG-ID: VHMa3HWfNF6Ve-mvAfIabQ_1776949576 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DBEE018001E1; Thu, 23 Apr 2026 13:06:15 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.17.109]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A18F01800347; Thu, 23 Apr 2026 13:06:13 +0000 (UTC) From: Tomas Glozar To: Steven Rostedt , Tomas Glozar Cc: John Kacur , Luis Goncalves , Crystal Wood , Costa Shulyupin , Wander Lairson Costa , LKML , linux-trace-kernel Subject: [PATCH 4/9] rtla/tests: Use negative match when testing --aa-only Date: Thu, 23 Apr 2026 15:05:53 +0200 Message-ID: <20260423130558.882022-5-tglozar@redhat.com> In-Reply-To: <20260423130558.882022-1-tglozar@redhat.com> References: <20260423130558.882022-1-tglozar@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.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" For testing the -a/--auto option in timerlat tool, the string "analyzing it" is matched against to make sure auto-analysis was triggered. Use the same string as a negative match for --aa-only option test. Signed-off-by: Tomas Glozar Reviewed-by: Wander Lairson Costa --- tools/tracing/rtla/tests/timerlat.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests= /timerlat.t index fb60022aaa64..f47a82c115c7 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -38,7 +38,7 @@ check_top_hist "dump tasks" \ check "print the auto-analysis if hits the stop tracing condition" \ "timerlat top --aa-only 5" 2 check_top_hist "disable auto-analysis" \ - "timerlat TOOL -s 3 -T 10 -t --no-aa" 2 + "timerlat TOOL -s 3 -T 10 -t --no-aa" 2 "" "analyzing it" check_top_q_hist "verify -c/--cpus" \ "timerlat TOOL -c 0 -d 10s -T 1 --on-threshold shell,command=3Dtests/scri= pts/check-cpus.sh" 2 "^Affinity of threads: 0$" =20 --=20 2.53.0 From nobody Wed Jun 17 06:11:26 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 800733EFD1A for ; Thu, 23 Apr 2026 13:06:24 +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=1776949586; cv=none; b=to16TPf7mtLdUSv4x071HOx0E5D0ileENN2Zc0FKWWDOCEAbPDQaoe7wdY+KGjCXYw0dZu9bR6pId1F7u82S0S0gwpDxCyqP+PNE+O8rBeCCqkMMZ1b5SqK1kBQqtN1qmRSBcDf+f6F169P3XL4XkIlbca0mksGu+Z55Idzl3Zc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949586; c=relaxed/simple; bh=jH6RG8YyZF+X4kBZk0o3xliGCRgpWGl4DM2ooSO07HY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZqyfuvGzaFj2B/CJz0yo76258FlDpjA9qPDn0MttYEysIyku0pw+uPGTVQaE2kWytCyCWk+A4yeBLQ+NE4MnnQ/LgWw4F9ARJfLXpYYIEzZf++0Qw7QaqQMsDMmfinNSavHuJkNia2TeAoetYgTrSnpTVMKlkteMhz7nZS3P/yQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=VcJj1Zfo; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="VcJj1Zfo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776949583; 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: in-reply-to:in-reply-to:references:references; bh=zHl+leK81oEVhfbrnLdSI2/cG4v6LOWTco08aMzksrE=; b=VcJj1ZfoAS7zFYWe5KYf0zyLa5rWpI+idxharTY1341INjUG6ypL7Myc/OkyX//9LtZK0e cuUJvhbokdfcBgJtlUVOjh392s7yVyzBcZQvWEEv9EVLIByxAMKdR9wTHgHhN/1tWK2Ro+ /ODYSqrTFKTx5eokCSoaVKX2CW7maOM= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-212-Qy2yHafEOyuXA_6oBgCr0g-1; Thu, 23 Apr 2026 09:06:19 -0400 X-MC-Unique: Qy2yHafEOyuXA_6oBgCr0g-1 X-Mimecast-MFC-AGG-ID: Qy2yHafEOyuXA_6oBgCr0g_1776949578 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 734381800451; Thu, 23 Apr 2026 13:06:18 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.17.109]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 440161800348; Thu, 23 Apr 2026 13:06:16 +0000 (UTC) From: Tomas Glozar To: Steven Rostedt , Tomas Glozar Cc: John Kacur , Luis Goncalves , Crystal Wood , Costa Shulyupin , Wander Lairson Costa , LKML , linux-trace-kernel Subject: [PATCH 5/9] rtla/tests: Extend timerlat top --aa-only coverage Date: Thu, 23 Apr 2026 15:05:54 +0200 Message-ID: <20260423130558.882022-6-tglozar@redhat.com> In-Reply-To: <20260423130558.882022-1-tglozar@redhat.com> References: <20260423130558.882022-1-tglozar@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.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" rtla-timerlat-top's --aa-only option is currently only tested for return value. Extend the tests to also check that only auto-analysis is being done via a negative match for the "Timer Latency" text in the top header, and further split the test case into two: - one test case for --aa-only stopping on threshold - one test case for --aa-only exiting without threshold being hit For both cases, the expected output ("analyzing it" or "Max latency was" respectively) is checked against in addition to the negative match. Signed-off-by: Tomas Glozar Reviewed-by: Wander Lairson Costa --- tools/tracing/rtla/tests/timerlat.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests= /timerlat.t index f47a82c115c7..28c01d8b299d 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -35,8 +35,10 @@ check_top_hist "set the automatic trace mode" \ "timerlat TOOL -a 5" 2 "analyzing it" check_top_hist "dump tasks" \ "timerlat TOOL -a 5 --dump-tasks" 2 "Printing CPU tasks" -check "print the auto-analysis if hits the stop tracing condition" \ - "timerlat top --aa-only 5" 2 +check "verify --aa-only stop on threshold" \ + "timerlat top --aa-only 5" 2 "analyzing it" "Timer Latency" +check "verify --aa-only max latency" \ + "timerlat top --aa-only 2000000 -d 1s" 0 "^ Max latency was" "Timer Late= ncy" check_top_hist "disable auto-analysis" \ "timerlat TOOL -s 3 -T 10 -t --no-aa" 2 "" "analyzing it" check_top_q_hist "verify -c/--cpus" \ --=20 2.53.0 From nobody Wed Jun 17 06:11:26 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 7382C3EF0DD for ; Thu, 23 Apr 2026 13:06:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949587; cv=none; b=FHjiA1k4qUIfEtuNKLm9DTMlwXjUgGsOMHPQ9q4fCWNYImSCUVvSaIYTStoadqkucC052b4YkZtyKzx0ibQ6/urEoxy0c/ubg3ceIW7cKLd97DKX0M+AjTY/4JOdhBgrjf8pubhIsZnoKd0o81Su29RByUL94lnGZw810c1p334= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949587; c=relaxed/simple; bh=SxArN/A+LL2HxmSUWWsovdyBrGQkQw88quXpj3pj5IQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CeL2BJMpeBwPOtG19XRAOxt0Q4poUgruiaRvhxZewv8Y4lfSXhmzksbtxJipBdvB9A5WON2putWkfNB+vRgAUUfsmBPMrbUCahOTDTuPsU39vYlLKPL+Jr+owTvLCy7VxGhVZR78bMkU9GQX1DHM49jIn/pPNQVt0W0qYx4xyBs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=dVO6XCl0; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="dVO6XCl0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776949585; 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: in-reply-to:in-reply-to:references:references; bh=pIDgNATN1Zc5xyhfvqALgA2L927VPRoKeBObj8l0vWA=; b=dVO6XCl0dO6h8QriBQAVqrNjWtBJkgFW85tnJiQVvacyLvsvXSS8+wFhCCeTbi+VkKFwR3 PbrEMli6rhDZBZ6wGkDxKVv0BSxkicnFnh7txaah36Gyyw5UvuNbgoPb2GflcE0eJRnXwW bpjhk/19CzBLib4b0cAlGR8bdt2pT5g= Received: from mx-prod-mc-03.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-81-Ww9VoVF_N8ynDbR5Km9JXA-1; Thu, 23 Apr 2026 09:06:22 -0400 X-MC-Unique: Ww9VoVF_N8ynDbR5Km9JXA-1 X-Mimecast-MFC-AGG-ID: Ww9VoVF_N8ynDbR5Km9JXA_1776949581 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7E52E193530B; Thu, 23 Apr 2026 13:06:21 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.17.109]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DB84E1800370; Thu, 23 Apr 2026 13:06:18 +0000 (UTC) From: Tomas Glozar To: Steven Rostedt , Tomas Glozar Cc: John Kacur , Luis Goncalves , Crystal Wood , Costa Shulyupin , Wander Lairson Costa , LKML , linux-trace-kernel Subject: [PATCH 6/9] rtla/tests: Cover all hist options in runtime tests Date: Thu, 23 Apr 2026 15:05:55 +0200 Message-ID: <20260423130558.882022-7-tglozar@redhat.com> In-Reply-To: <20260423130558.882022-1-tglozar@redhat.com> References: <20260423130558.882022-1-tglozar@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.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" Cover all options regarding histogram formatting for both rtla-osnoise-hist and rtla-timerlat-hist tools. All options also have output checking using positive or negative match, except for -b/--bucket-size and -E/--entries, which cannot be tested in isolated due to the output depending on the actual data collected. Old -E/--entries test for rtla-osnoise was replaced with a new one equivalent to the timerlat one. Signed-off-by: Tomas Glozar Reviewed-by: Wander Lairson Costa --- tools/tracing/rtla/tests/osnoise.t | 18 ++++++++++++++++-- tools/tracing/rtla/tests/timerlat.t | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/tools/tracing/rtla/tests/osnoise.t b/tools/tracing/rtla/tests/= osnoise.t index 5edffb23981b..773a46e2dc5f 100644 --- a/tools/tracing/rtla/tests/osnoise.t +++ b/tools/tracing/rtla/tests/osnoise.t @@ -16,11 +16,25 @@ check_top_q_hist "verify the --stop/-s param" \ "osnoise TOOL -s 30 -T 1" 2 "osnoise hit stop tracing" check_top_q_hist "verify the --trace param" \ "osnoise TOOL -s 30 -T 1 -t" 2 "Saving trace to osnoise_trace.txt" -check "verify the --entries/-E param" \ - "osnoise hist -P F:1 -c 0 -r 900000 -d 10s -b 10 -E 25" check_top_q_hist "verify the -c/--cpus param" \ "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,comm= and=3Dtests/scripts/check-cpus.sh" 2 "^Affinity of threads: 0$" =20 +# Histogram tests +check "hist with -b/--bucket-size" \ + "osnoise hist -b 1 -d 1s" +check "hist with -E/--entries" \ + "osnoise hist -E 10 -d 1s" +check "hist with -E/--entries out of range" \ + "osnoise hist -E 1 -d 1s" 1 "^Entries must be > 10 and < 9999999$" +check "hist with --no-header" \ + "osnoise hist --no-header -d 1s" 0 "" "RTLA osnoise histogram" +check "hist with --with-zeros" \ + "osnoise hist --with-zeros -b 100000 -E 21 -d 1s" 0 '^2000000\s+0\s+' +check "hist with --no-index" \ + "osnoise hist --no-index --with-zeros -d 1s" 0 "" "^count:" +check "hist with --no-summary" \ + "osnoise hist --no-summary -d 1s" 0 "" "^count:" + # Test setting default period by putting an absurdly high period # and stopping on threshold. # If default period is not set, this will time out. diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests= /timerlat.t index 28c01d8b299d..a14d9ec32ede 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -44,6 +44,26 @@ check_top_hist "disable auto-analysis" \ check_top_q_hist "verify -c/--cpus" \ "timerlat TOOL -c 0 -d 10s -T 1 --on-threshold shell,command=3Dtests/scri= pts/check-cpus.sh" 2 "^Affinity of threads: 0$" =20 +# Histogram tests +check "hist with -b/--bucket-size" \ + "timerlat hist -b 1 -d 1s" +check "hist with -E/--entries" \ + "timerlat hist -E 10 -d 1s" +check "hist with -E/--entries out of range" \ + "timerlat hist -E 1 -d 1s" 1 "^Entries must be > 10 and < 9999999$" +check "hist with --no-header" \ + "timerlat hist --no-header -d 1s" 0 "" "RTLA timerlat histogram" +check "hist with --with-zeros" \ + "timerlat hist --with-zeros -b 100000 -E 21 -d 1s" 0 '^2000000\s+0\s+' +check "hist with --no-index" \ + "timerlat hist --no-index --with-zeros -d 1s" 0 "" "^count:" +check "hist with --no-summary" \ + "timerlat hist --no-summary -d 1s" 0 "" "^ALL:" +check "hist with --no-irq" \ + "timerlat hist --no-irq -d 1s" 0 "" "IRQ-" +check "hist with --no-thread" \ + "timerlat hist --no-thread -d 1s" 0 "" "Thr-" + # Actions tests check_top_q_hist "trace output through -t" \ "timerlat TOOL -T 2 -t" 2 "^ Saving trace to timerlat_trace.txt$" --=20 2.53.0 From nobody Wed Jun 17 06:11:26 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 7D0E63EF653 for ; Thu, 23 Apr 2026 13:06:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949588; cv=none; b=qzyCY/wSTpInlX9NKSiKBc1u49pK+PWU9FaR+DQQLW2FYS1RveYZe7EtKoEWB9o9SlkPMyeygEFkOADQL/4i20aNRr82QV8jC/i7JcT+VyxVpI1vWf8XbNja7NCrS9aAhuyoXAUBKGDav3erixrVB/q6LAy1Qllc7tb3ZTLnjuI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949588; c=relaxed/simple; bh=1gc8Q3XzFD98HGFMK6tXi8hrGxSLnedCPsND7+/OfmQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LW4uUVHUv0K819j8uriJQiBQM/PP9iftZfpblJkv2b1yIBFe/V86ujA8qOMmcq5FWwAsUjI3p0R3PuIZuPQ3LUhmqawJ0eAR/osqKHBCQ9WBo0Pu+Jzd4OSYA0OYtSReGPGY/KxCxYRWdHgCpPzpp/sNJQt43o0mPLCXvSvh4zA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=OEPrHL/D; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="OEPrHL/D" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776949586; 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: in-reply-to:in-reply-to:references:references; bh=k2hCe3kUGUg2bWuwvB9gGrn8uK7vB4ERQxGlQOgtijM=; b=OEPrHL/DqP+uBBso4hi33xQH/X0UJlfVDRctHDfUcCCMxqZI40ZsIBpXiNuobWGNLO3Psu cre+9/qJ5onWNhBJB6y1+KdighZbqwnIm5vxFwx2P4FbmQF6oy2BQFVDs8RVxvNZSVq80d V/+ybqpsAUKVfH8828b1zkir7n7v/JE= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-371-FYZeh4mCPwCawyM5oRlolQ-1; Thu, 23 Apr 2026 09:06:25 -0400 X-MC-Unique: FYZeh4mCPwCawyM5oRlolQ-1 X-Mimecast-MFC-AGG-ID: FYZeh4mCPwCawyM5oRlolQ_1776949584 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 42051180034A; Thu, 23 Apr 2026 13:06:24 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.17.109]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DA4DE1800370; Thu, 23 Apr 2026 13:06:21 +0000 (UTC) From: Tomas Glozar To: Steven Rostedt , Tomas Glozar Cc: John Kacur , Luis Goncalves , Crystal Wood , Costa Shulyupin , Wander Lairson Costa , LKML , linux-trace-kernel Subject: [PATCH 7/9] rtla/tests: Add runtime test for -H/--house-keeping Date: Thu, 23 Apr 2026 15:05:56 +0200 Message-ID: <20260423130558.882022-8-tglozar@redhat.com> In-Reply-To: <20260423130558.882022-1-tglozar@redhat.com> References: <20260423130558.882022-1-tglozar@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.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" Add a runtime test for -H/--house-keeping option for both osnoise and timerlat tools, with affinity checking similar to what is done for -c/--cpus. Signed-off-by: Tomas Glozar Reviewed-by: Wander Lairson Costa --- tools/tracing/rtla/tests/osnoise.t | 2 ++ tools/tracing/rtla/tests/scripts/check-housekeeping-cpus.sh | 4 ++++ tools/tracing/rtla/tests/timerlat.t | 2 ++ 3 files changed, 8 insertions(+) create mode 100755 tools/tracing/rtla/tests/scripts/check-housekeeping-cpu= s.sh diff --git a/tools/tracing/rtla/tests/osnoise.t b/tools/tracing/rtla/tests/= osnoise.t index 773a46e2dc5f..cdea84914345 100644 --- a/tools/tracing/rtla/tests/osnoise.t +++ b/tools/tracing/rtla/tests/osnoise.t @@ -18,6 +18,8 @@ check_top_q_hist "verify the --trace param" \ "osnoise TOOL -s 30 -T 1 -t" 2 "Saving trace to osnoise_trace.txt" check_top_q_hist "verify the -c/--cpus param" \ "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,comm= and=3Dtests/scripts/check-cpus.sh" 2 "^Affinity of threads: 0$" +check_top_q_hist "verify the -H/--house-keeping param" \ + "osnoise TOOL -P F:1 -H 0 -r 900000 -d 10s -S 1 --on-threshold shell,comm= and=3Dtests/scripts/check-housekeeping-cpus.sh" 2 "^Affinity of threads: 0$" =20 # Histogram tests check "hist with -b/--bucket-size" \ diff --git a/tools/tracing/rtla/tests/scripts/check-housekeeping-cpus.sh b/= tools/tracing/rtla/tests/scripts/check-housekeeping-cpus.sh new file mode 100755 index 000000000000..4742f34efb49 --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-housekeeping-cpus.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +pid=3D$(ps -o ppid=3D $$) +echo "Affinity of threads:$(taskset -c -p $pid | cut -d ':' -f 2)" diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests= /timerlat.t index a14d9ec32ede..20f68bcbcb27 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -43,6 +43,8 @@ check_top_hist "disable auto-analysis" \ "timerlat TOOL -s 3 -T 10 -t --no-aa" 2 "" "analyzing it" check_top_q_hist "verify -c/--cpus" \ "timerlat TOOL -c 0 -d 10s -T 1 --on-threshold shell,command=3Dtests/scri= pts/check-cpus.sh" 2 "^Affinity of threads: 0$" +check_top_q_hist "verify -H/--house-keeping" \ + "timerlat TOOL -H 0 -d 10s -T 1 --on-threshold shell,command=3Dtests/scri= pts/check-housekeeping-cpus.sh" 2 "^Affinity of threads: 0$" =20 # Histogram tests check "hist with -b/--bucket-size" \ --=20 2.53.0 From nobody Wed Jun 17 06:11:26 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 B3E0F3EF642 for ; Thu, 23 Apr 2026 13:06:34 +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=1776949597; cv=none; b=UlGYILM41erxYZGszHjj2xXO7drU33MIjmNhVgo02gNQVGt/lgL09fyUHf5ZyWhQrf3rAENmPmAIVsxQ69YrFzR5jGwPi4hR2uqLuCpMGwFMLyQ8hXJYUOZTDvsRPrJudUemgv1Dstcc2kW4Q0sTmyHnuQ3CNWrV51mcX/SGyls= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949597; c=relaxed/simple; bh=fIRggRYjsYVwKIEFdZmfHHKTU0++5qUwzOsajykDlQo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZSsWHvbvdMUrFFktSoFX7kEATmz7n26rzecs3R8TbqQ5IYIfjEGvFWn33nmOEBqq8OlFy3g7KYI/lp55ivDhaJgw9v2oiyMMzBmnOMgK5Gp3PVYmcvg4NgtLwW2fYXNNAsRA9WlQqC+cVUYv6x6VhjnSPOVIUaai65l4XgEZ82g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=FJ7Z0vbJ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="FJ7Z0vbJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776949593; 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: in-reply-to:in-reply-to:references:references; bh=AQvgbGFGfpii8v/KdPeQXIxsFLMvdw8xYLo9b00Q32E=; b=FJ7Z0vbJuAvqd5QnJH3+VSRBw/mYkolTx4zk+wes55u0/j5htj/vetpGY/j0XbqMTUvyEp qCUd64gA9WDI2FV+gzCL18YcVm5IgHoy/ZMbXEijJggKyrt5mIAvEhQe9qWDbe1u+OaUxR en8HPNKizLa5WGwuyMvEfO9XlGvrKrU= 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-578-t0KX1iQ1Mq29DlIV4EuAjw-1; Thu, 23 Apr 2026 09:06:29 -0400 X-MC-Unique: t0KX1iQ1Mq29DlIV4EuAjw-1 X-Mimecast-MFC-AGG-ID: t0KX1iQ1Mq29DlIV4EuAjw_1776949588 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 4C6BD1955BD0; Thu, 23 Apr 2026 13:06:28 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.17.109]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9F6D51800347; Thu, 23 Apr 2026 13:06:24 +0000 (UTC) From: Tomas Glozar To: Steven Rostedt , Tomas Glozar Cc: John Kacur , Luis Goncalves , Crystal Wood , Costa Shulyupin , Wander Lairson Costa , LKML , linux-trace-kernel Subject: [PATCH 8/9] rtla/tests: Add runtime test for -k and -u options Date: Thu, 23 Apr 2026 15:05:57 +0200 Message-ID: <20260423130558.882022-9-tglozar@redhat.com> In-Reply-To: <20260423130558.882022-1-tglozar@redhat.com> References: <20260423130558.882022-1-tglozar@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.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" Add runtime test for rtla-timerlat's -k/--kernel-threads and -u/--user-threads options using get_workload_pids.sh to check whether the appropriate threads are being created. The tests are implemented for both top and hist. Additionally, all tests related to timerlat threads are moved to a separate section in the test files. The latter is also done for rtla-osnoise tests. Signed-off-by: Tomas Glozar Reviewed-by: Wander Lairson Costa --- tools/tracing/rtla/tests/osnoise.t | 8 +++++--- .../tests/scripts/check-user-kernel-threads.sh | 16 ++++++++++++++++ tools/tracing/rtla/tests/timerlat.t | 12 +++++++++--- 3 files changed, 30 insertions(+), 6 deletions(-) create mode 100755 tools/tracing/rtla/tests/scripts/check-user-kernel-thre= ads.sh diff --git a/tools/tracing/rtla/tests/osnoise.t b/tools/tracing/rtla/tests/= osnoise.t index cdea84914345..d0b623233db5 100644 --- a/tools/tracing/rtla/tests/osnoise.t +++ b/tools/tracing/rtla/tests/osnoise.t @@ -9,13 +9,15 @@ check "verify help page" \ "osnoise --help" 0 "osnoise version" check_top_hist "verify help page" \ "osnoise TOOL --help" 0 "rtla osnoise" -check_top_q_hist "verify the --priority/-P param" \ - "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,comm= and=3D\"tests/scripts/check-priority.sh SCHED_FIFO 1\"" \ - 2 "Priorities are set correctly" check_top_q_hist "verify the --stop/-s param" \ "osnoise TOOL -s 30 -T 1" 2 "osnoise hit stop tracing" check_top_q_hist "verify the --trace param" \ "osnoise TOOL -s 30 -T 1 -t" 2 "Saving trace to osnoise_trace.txt" + +# Thread tests +check_top_q_hist "verify the --priority/-P param" \ + "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,comm= and=3D\"tests/scripts/check-priority.sh SCHED_FIFO 1\"" \ + 2 "Priorities are set correctly" check_top_q_hist "verify the -c/--cpus param" \ "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,comm= and=3Dtests/scripts/check-cpus.sh" 2 "^Affinity of threads: 0$" check_top_q_hist "verify the -H/--house-keeping param" \ diff --git a/tools/tracing/rtla/tests/scripts/check-user-kernel-threads.sh = b/tools/tracing/rtla/tests/scripts/check-user-kernel-threads.sh new file mode 100755 index 000000000000..bb7ac510a735 --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-user-kernel-threads.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +. "$(dirname $0)/lib/get_workload_pids.sh" +kthreadd_pid=3D$(pgrep ^kthreadd$) +cnt_kernel=3D0 +cnt_user=3D0 +for pid in $(get_workload_pids) +do + if [ "$(echo $(ps -o ppid=3D $pid))" =3D "$kthreadd_pid" ] + then + ((++cnt_kernel)) + else + ((++cnt_user)) + fi +done +echo "$cnt_kernel kernel threads, $cnt_user user threads" diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests= /timerlat.t index 20f68bcbcb27..3557adbdebae 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -26,9 +26,6 @@ check_top_hist "verify help page" \ "timerlat TOOL --help" 0 "rtla timerlat" check_top_hist "verify -s/--stack" \ "timerlat TOOL -s 3 -T 10 -t" 2 "Blocking thread stack trace" -check_top_hist "verify -P/--priority" \ - "timerlat TOOL -P F:1 -c 0 -d 10s -T 1 --on-threshold shell,command=3D\"t= ests/scripts/check-priority.sh SCHED_FIFO 1\"" \ - 2 "Priorities are set correctly" check_top_hist "test in nanoseconds" \ "timerlat TOOL -i 2 -c 0 -n -d 10s" 2 "ns" check_top_hist "set the automatic trace mode" \ @@ -41,10 +38,19 @@ check "verify --aa-only max latency" \ "timerlat top --aa-only 2000000 -d 1s" 0 "^ Max latency was" "Timer Late= ncy" check_top_hist "disable auto-analysis" \ "timerlat TOOL -s 3 -T 10 -t --no-aa" 2 "" "analyzing it" + +# Thread tests +check_top_hist "verify -P/--priority" \ + "timerlat TOOL -P F:1 -c 0 -d 10s -T 1 --on-threshold shell,command=3D\"t= ests/scripts/check-priority.sh SCHED_FIFO 1\"" \ + 2 "Priorities are set correctly" check_top_q_hist "verify -c/--cpus" \ "timerlat TOOL -c 0 -d 10s -T 1 --on-threshold shell,command=3Dtests/scri= pts/check-cpus.sh" 2 "^Affinity of threads: 0$" check_top_q_hist "verify -H/--house-keeping" \ "timerlat TOOL -H 0 -d 10s -T 1 --on-threshold shell,command=3Dtests/scri= pts/check-housekeeping-cpus.sh" 2 "^Affinity of threads: 0$" +check_top_q_hist "verify -k/--kernel-threads" \ + "timerlat TOOL -k -c 0 -d 10s -T 1 --on-threshold shell,command=3Dtests/s= cripts/check-user-kernel-threads.sh" 2 "1 kernel threads, 0 user threads" +check_top_q_hist "verify -u/--user-threads" \ + "timerlat TOOL -u -c 0 -d 10s -T 1 --on-threshold shell,command=3Dtests/s= cripts/check-user-kernel-threads.sh" 2 "0 kernel threads, 1 user threads" =20 # Histogram tests check "hist with -b/--bucket-size" \ --=20 2.53.0 From nobody Wed Jun 17 06:11:26 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 1C42D3EF646 for ; Thu, 23 Apr 2026 13:06:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949599; cv=none; b=RQ2ZdNeJmtbKrWB9YvADlI0OfH8tMYC1Ns6o8ijsKF/sjl9p+tkPClfS3giWb0dpQaLkhQtQ9dHaEZ8hihFVH8H90IgDLvJZemV6aK22zyzN6FY12BaA1QICZnk9rltTO1plDEEhaOx2kkj7h7hSeZ1dY/6OJ5H31hiPG7qvnDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776949599; c=relaxed/simple; bh=HlFuSJ4fhTIa0RGc2qOzwMZqFPgTieten6LtQBHdlvo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DL8KZcIZsDzja/YiuFAk7nY2L8/ju7qxt4nwP7umMWAJsO5y1U4fyESneG+hT1dYCozDUTuwRrg60+NghS9yXYpL+wN/7dljoE6QKUDedemS/cEm1dTRxNsHB3hngiK9SrLcvJRvRN00pku3paEjehHUEY6yBlNW66eXGS8jcNc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=jMAzt+H1; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="jMAzt+H1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776949597; 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: in-reply-to:in-reply-to:references:references; bh=kltkYTjIyWTmUYzKqWZ15Hc2o1gDOHMNhYh+zJ6DjrQ=; b=jMAzt+H17Wtca1buBvGLnywp9Qj4MrVU66WzgZ2XCXmQ21VxNEJNxvhROKK5/CJYNMmb3n pclmsd4CKEZKocipjzvaTrY+Z3HqS7p8DM5IDs29s6e0MtfFepYjrrAh2LODlxgxm/nxbi GxOAPKbBlzoY4uFffq5EDoGkOgO2VUc= 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-653-feQI92AbOIu98CLEIpVpMw-1; Thu, 23 Apr 2026 09:06:31 -0400 X-MC-Unique: feQI92AbOIu98CLEIpVpMw-1 X-Mimecast-MFC-AGG-ID: feQI92AbOIu98CLEIpVpMw_1776949591 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 D9AED1955BCE; Thu, 23 Apr 2026 13:06:30 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.17.109]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A7A9C1800357; Thu, 23 Apr 2026 13:06:28 +0000 (UTC) From: Tomas Glozar To: Steven Rostedt , Tomas Glozar Cc: John Kacur , Luis Goncalves , Crystal Wood , Costa Shulyupin , Wander Lairson Costa , LKML , linux-trace-kernel Subject: [PATCH 9/9] rtla/tests: Add runtime tests for -C/--cgroup Date: Thu, 23 Apr 2026 15:05:58 +0200 Message-ID: <20260423130558.882022-10-tglozar@redhat.com> In-Reply-To: <20260423130558.882022-1-tglozar@redhat.com> References: <20260423130558.882022-1-tglozar@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.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" Add a new script check-cgroup-match.sh that retrieves the cgroup of the main rtla process and compares it to the cgroup of the rtla workload threads. Add a new test based on this script, for both osnoise and timerlat tools, testing the variant of -C without argument (which sets the cgroup of the workload to the cgroup of the rtla main process). Note that this has to be tested in kernel mode to be significant for timerlat tool, as user workloads inherit the parent rtla process cgroup even without the option. Signed-off-by: Tomas Glozar Reviewed-by: Wander Lairson Costa --- tools/tracing/rtla/tests/osnoise.t | 3 +++ .../rtla/tests/scripts/check-cgroup-match.sh | 17 +++++++++++++++++ tools/tracing/rtla/tests/timerlat.t | 3 +++ 3 files changed, 23 insertions(+) create mode 100755 tools/tracing/rtla/tests/scripts/check-cgroup-match.sh diff --git a/tools/tracing/rtla/tests/osnoise.t b/tools/tracing/rtla/tests/= osnoise.t index d0b623233db5..06787471d0e8 100644 --- a/tools/tracing/rtla/tests/osnoise.t +++ b/tools/tracing/rtla/tests/osnoise.t @@ -18,6 +18,9 @@ check_top_q_hist "verify the --trace param" \ check_top_q_hist "verify the --priority/-P param" \ "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,comm= and=3D\"tests/scripts/check-priority.sh SCHED_FIFO 1\"" \ 2 "Priorities are set correctly" +check_top_q_hist "verify the -C/--cgroup param" \ + "osnoise TOOL -C -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,command= =3D\"tests/scripts/check-cgroup-match.sh\"" \ + 2 "cgroup matches for all workload PIDs" check_top_q_hist "verify the -c/--cpus param" \ "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,comm= and=3Dtests/scripts/check-cpus.sh" 2 "^Affinity of threads: 0$" check_top_q_hist "verify the -H/--house-keeping param" \ diff --git a/tools/tracing/rtla/tests/scripts/check-cgroup-match.sh b/tools= /tracing/rtla/tests/scripts/check-cgroup-match.sh new file mode 100755 index 000000000000..fdc2c68c5957 --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-cgroup-match.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +. "$(dirname $0)/lib/get_workload_pids.sh" +rtla_pid=3D$(echo $(ps -o ppid=3D $$)) +rtla_cgroup=3D$(