From nobody Sun Oct 5 20:15:24 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 03B44280CCE for ; Tue, 29 Jul 2025 23:11:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753830719; cv=none; b=NqDzH585wVgo9C6bQB7zNfMy699TAFh6NOnH12al8Nx7fcXxFFUORMmR6ixGHsIX+RgFmmIWeo2FLT2bt+H3hf6QoMcAyMADetCaLolxBOsVaGDgPXREoCR9Jl9aoEY9h6DfW82ABlUHktluwvTtrBwo7Yoyz0s75TNMRGo6MUI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753830719; c=relaxed/simple; bh=7yBjII2EI2XOmeKdK/UJCjNS0Mlw9nVTvAqVEvTZ4TM=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=h5plo1Za2pXleKfDi2kTShsVycST7MPUFT+LjvG6lM0OMIuz/cHja1p+uE0Jo6DwHHBhA3kP1mIlLXbxiy6tu9BbE0ti5luTqLx6Ih8x5oxEm706k/pg2aj2Z/TwH+v9dUCHJohmP5Mn82X+9zxJZ/mnX0xVz8OK6uhUhnunQPo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uCizDE+T; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uCizDE+T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CB03C4CEEF; Tue, 29 Jul 2025 23:11:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753830718; bh=7yBjII2EI2XOmeKdK/UJCjNS0Mlw9nVTvAqVEvTZ4TM=; h=Date:From:To:Cc:Subject:References:From; b=uCizDE+TO5An0GT4ZA+FAJYn5UmgKGHMkDQaIptDn0oeKcf0iSc9Fl+Rg0dNWShUI 0FyK8f3piNZbC87GqXypZIZAUz9cqvNDMfuKXc1CrfBroQqHHnK+9uWe/dH5ZvcGMt 7/C9mD9OWCKKEsK0faO/8LevOgQbJ6kW66HO28mghSS1EGh1vr2lO493wG1w+5HaF8 w/iTBGlwoj9rLZHTvaBSN2Se2q11iByaY894JP8SRH2zZ4DEU6s8aTeMFrZ6wbcpmw 1AJVCbAo8EdnFJRX7mmYt38JIbxoMxDzeBuHqcsD+5ZhWEVqk+1qX8YfFI7NU5ySrZ 42WrHzL6h1Lrw== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1ugtUT-00000005K9F-2eo7; Tue, 29 Jul 2025 19:12:13 -0400 Message-ID: <20250729231213.489236527@kernel.org> User-Agent: quilt/0.68 Date: Tue, 29 Jul 2025 19:11:58 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Luis Goncalves , Chang Yin , Costa Shulyupin Subject: [for-next][PATCH 1/2] rtla/tests: Add grep checks for base test cases References: <20250729231157.059587961@kernel.org> 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 Content-Type: text/plain; charset="utf-8" From: Tomas Glozar Checking for patterns in rtla output with grep was added to test rtla actions. Add grep checks also for base tests where applicable. Also fix trace event histogram trigger check to use the correct syntax for the command-line option so that the test passes with the grep check. Cc: John Kacur Cc: Luis Goncalves Cc: Chang Yin Cc: Costa Shulyupin Link: https://lore.kernel.org/20250725133817.59237-2-tglozar@redhat.com Signed-off-by: Tomas Glozar Signed-off-by: Steven Rostedt (Google) --- tools/tracing/rtla/tests/hwnoise.t | 11 ++++++----- tools/tracing/rtla/tests/osnoise.t | 6 +++--- tools/tracing/rtla/tests/timerlat.t | 12 +++++++----- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/tools/tracing/rtla/tests/hwnoise.t b/tools/tracing/rtla/tests/= hwnoise.t index 448877564b8d..23ce250a6852 100644 --- a/tools/tracing/rtla/tests/hwnoise.t +++ b/tools/tracing/rtla/tests/hwnoise.t @@ -6,16 +6,17 @@ test_begin set_timeout 2m =20 check "verify help page" \ - "hwnoise --help" + "hwnoise --help" 0 "summary of hardware-related noise" check "detect noise higher than one microsecond" \ - "hwnoise -c 0 -T 1 -d 5s -q" + "hwnoise -c 0 -T 1 -d 5s -q" 0 check "set the automatic trace mode" \ - "hwnoise -a 5 -d 10s" 2 + "hwnoise -a 5 -d 10s" 2 "osnoise hit stop tracing" check "set scheduling param to the osnoise tracer threads" \ "hwnoise -P F:1 -c 0 -r 900000 -d 10s -q" check "stop the trace if a single sample is higher than 1 us" \ - "hwnoise -s 1 -T 1 -t -d 10s" 2 + "hwnoise -s 1 -T 1 -t -d 10s" 2 "Saving trace to osnoise_trace.txt" check "enable a trace event trigger" \ - "hwnoise -t -e osnoise:irq_noise trigger=3D\"hist:key=3Ddesc,duration:sor= t=3Ddesc,duration:vals=3Dhitcount\" -d 10s" + "hwnoise -t -e osnoise:irq_noise --trigger=3D\"hist:key=3Ddesc,duration:s= ort=3Ddesc,duration:vals=3Dhitcount\" -d 10s" \ + 0 "Saving event osnoise:irq_noise hist to osnoise_irq_noise_hist.txt" =20 test_end diff --git a/tools/tracing/rtla/tests/osnoise.t b/tools/tracing/rtla/tests/= osnoise.t index 6a4dfa31dc55..7574ec6a5a53 100644 --- a/tools/tracing/rtla/tests/osnoise.t +++ b/tools/tracing/rtla/tests/osnoise.t @@ -6,13 +6,13 @@ test_begin set_timeout 2m =20 check "verify help page" \ - "osnoise --help" + "osnoise --help" 0 "osnoise version" check "verify the --priority/-P param" \ "osnoise top -P F:1 -c 0 -r 900000 -d 10s -q" check "verify the --stop/-s param" \ - "osnoise top -s 30 -T 1 -t" 2 + "osnoise top -s 30 -T 1" 2 "osnoise hit stop tracing" check "verify the --trace param" \ - "osnoise hist -s 30 -T 1 -t" 2 + "osnoise hist -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 diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests= /timerlat.t index 2d59ee199c4d..db263dc90a2d 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -21,15 +21,17 @@ export RTLA_NO_BPF=3D$option =20 # Basic tests check "verify help page" \ - "timerlat --help" + "timerlat --help" 0 "timerlat version" check "verify -s/--stack" \ - "timerlat top -s 3 -T 10 -t" 2 + "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" check "test in nanoseconds" \ - "timerlat top -i 2 -c 0 -n -d 10s" 2 + "timerlat top -i 2 -c 0 -n -d 10s" 2 "ns" check "set the automatic trace mode" \ - "timerlat top -a 5 --dump-tasks" 2 + "timerlat top -a 5" 2 "analyzing it" +check "dump tasks" \ + "timerlat top -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" \ @@ -37,7 +39,7 @@ check "disable auto-analysis" \ 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 + "timerlat hist -i 2 -c 0 -n -d 10s" 2 "ns" =20 # Actions tests check "trace output through -t" \ --=20 2.47.2 From nobody Sun Oct 5 20:15:24 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 03ADE27FD52 for ; Tue, 29 Jul 2025 23:11:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753830719; cv=none; b=MiM+1xOVkoog850YgmQkcEudDxLZ6hBrdIMkfunjvF54lGmE984efN3KAamgWn/rj5VEGY53n8hSbhg/TMsYg1MMjHKTHy3VQOakH+1X/XMzG5FJsZ2JLONGGHdxynXMQwFfATht2l67kpjhRaL2rF1Y3bZaJi5XgRmNnyUIKE0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753830719; c=relaxed/simple; bh=qeqWr+5CFM8kfIaWbcmNXhke27HYh1Kx9tPy5RgZ8qg=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=P5dLIji9gFP6BXuG1kxYpZ69ULmS0VRU3ytgx3hgq+TiLid6pqj153VQamqK8Pn9cZ18P3pMtO4h8vHqtsvBYlrTF8HOz6xEgI3uM89iit2QyD8XOYoorAVJ4esAPlU/7+xm2ViHiNL8b5SlxNGbjIX4NUmTN3WtvX4dCpNsty8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eIbhssgZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eIbhssgZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9567CC4CEF7; Tue, 29 Jul 2025 23:11:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753830718; bh=qeqWr+5CFM8kfIaWbcmNXhke27HYh1Kx9tPy5RgZ8qg=; h=Date:From:To:Cc:Subject:References:From; b=eIbhssgZJN5/TaQqQBdSKkKmLoufS05iHVZnMrtXLTWbDlyLlyRIt6u36r13niUQh 23MmPqVLE7TpxhpimrOg6YSb6yQXYUGw/K/aHNLuLAT6ABQzvbUJydhJccmpmIiBHs bsR4It2y5seLKODb22glxg2bKvT4AXCF2ICvWDPb2c7xviihR6hsuZkWhyBIR35KGC gYHk4H4sPxfzRuIZM7VCteTvi2J77lT0KPJA9k79vQf5/40Vl4lUOWWGiTDkIkoMg1 TuuulO/byDPeC6cS6SYPHPEnOBZmBA7ptT0Ql8OctsfjoPekEt2vsZfvHyh7QOtF5j rteZL+ULtObdA== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1ugtUT-00000005K9j-3LQH; Tue, 29 Jul 2025 19:12:13 -0400 Message-ID: <20250729231213.654134958@kernel.org> User-Agent: quilt/0.68 Date: Tue, 29 Jul 2025 19:11:59 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Luis Goncalves , Chang Yin , Costa Shulyupin Subject: [for-next][PATCH 2/2] rtla/tests: Test timerlat -P option using actions References: <20250729231157.059587961@kernel.org> 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 Content-Type: text/plain; charset="utf-8" From: Tomas Glozar The -P option is used to set priority of osnoise and timerlat threads. Extend the test for -P with --on-threshold calling a script that looks for running timerlat threads and checks if their priority is set correctly. As --on-threshold is only supported by timerlat at the moment, this is only implemented there so far. Cc: John Kacur Cc: Luis Goncalves Cc: Chang Yin Cc: Costa Shulyupin Link: https://lore.kernel.org/20250725133817.59237-3-tglozar@redhat.com Signed-off-by: Tomas Glozar Signed-off-by: Steven Rostedt (Google) --- tools/tracing/rtla/tests/engine.sh | 2 +- tools/tracing/rtla/tests/scripts/check-priority.sh | 8 ++++++++ tools/tracing/rtla/tests/timerlat.t | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100755 tools/tracing/rtla/tests/scripts/check-priority.sh diff --git a/tools/tracing/rtla/tests/engine.sh b/tools/tracing/rtla/tests/= engine.sh index 64c5be4313de..a97d644ead99 100644 --- a/tools/tracing/rtla/tests/engine.sh +++ b/tools/tracing/rtla/tests/engine.sh @@ -69,7 +69,7 @@ check() { # Add rtla output and exit code as comments in case of failure echo "$result" | col -b | while read line; do echo "# $line"; done printf "#\n# exit code %s\n" $exitcode - [ -n "$expected_output" ] && \ + [ -n "$expected_output" ] && [ $grep_result -ne 0 ] && \ printf "# Output match failed: \"%s\"\n" "$expected_output" fi fi diff --git a/tools/tracing/rtla/tests/scripts/check-priority.sh b/tools/tra= cing/rtla/tests/scripts/check-priority.sh new file mode 100755 index 000000000000..79b702a34a96 --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-priority.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +pids=3D"$(pgrep ^$1)" || exit 1 +for pid in $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 +done && echo "Priorities are set correctly" diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests= /timerlat.t index db263dc90a2d..c71aed5534bf 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -25,7 +25,8 @@ check "verify help page" \ 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" + "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\"" \ + 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" \ --=20 2.47.2