From nobody Mon Oct 6 13:35:30 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 5E32024503B for ; Mon, 21 Jul 2025 23:11:52 +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=1753139512; cv=none; b=JcilrCt+Q6p/Knd5hWbpuZVm6Jhn5raPz4KeGMnQGkTJQh1ECYQg4AaBpdm8Z9UhlOpOSGqQXIHr1iEoCapWB5eDKOwKE32JSt5jC/G9QF5RwpgBcWYZIOh/Y5wItRlVH5inkty6R2F0/X0G/l+7KYnkW7jvJHCUkPwOLJUKe9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753139512; c=relaxed/simple; bh=+B1acoAMtoMh6OG0TOvC5cM0I8M+uPpq/hFcmBEth0k=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=rcE9N9T/Nyr7jW+HRT29089edC0KvQmM0DxcaBRzsOIBYgE9tkSfnvmjx9TblCy81Y/KQ6U6z8kHLkHQ3OlcznpwimL9jBuJOuVIcJpSlXOxyZ0JHHhPXHxO21DxfApV3OM4sEUWjPxUbqBQxBbvYt4aSwj/FvGQmupH3yzdCDw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AysuFOzT; 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="AysuFOzT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 217EAC4CEF7; Mon, 21 Jul 2025 23:11:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753139512; bh=+B1acoAMtoMh6OG0TOvC5cM0I8M+uPpq/hFcmBEth0k=; h=Date:From:To:Cc:Subject:References:From; b=AysuFOzTuCZXDS9lndU5GIxlW1sNTZL6gE7MeA6CMe6uN5JPOpwqK11v86YOJxh3F jkCPuYysIyWOfpDc7qhgWLaJXz/Kaqs2C5HomzUYYG40cVd/EckHAmdwzMyzCTYgm3 7Xcq6JwnZFf/R1AjlJbZ7wzeLAARVculNYpm3qwZbcL5VPivs7yd3a9YhxuX5MjPsJ WqIC7TwZXK0u8RO0vSt0mkoceGsxZvxD+203I8zlqYDB0XMIAXQk4g7Wt50iXKF3Og 2bDkFTLuF8TrB+nBdFie8fbFcw4d+DzUAKX5UCshbDdTuHFAQbli76dUcC7hapKBxr Tg/JdCcvVsKCw== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1udzgF-00000009vKL-1reB; Mon, 21 Jul 2025 19:12:23 -0400 Message-ID: <20250721231223.297069085@kernel.org> User-Agent: quilt/0.68 Date: Mon, 21 Jul 2025 19:12:11 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Luis Goncalves , Arnaldo Carvalho de Melo , Chang Yin , Costa Shulyupin , Crystal Wood , Gabriele Monaco Subject: [for-next][PATCH 7/9] rtla/tests: Add tests for actions References: <20250721231204.100737734@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 Add a bunch of tests covering most of both --on-threshold and --on-end. Parts sensitive to implementation of hist/top are tested for both. Cc: John Kacur Cc: Luis Goncalves Cc: Arnaldo Carvalho de Melo Cc: Chang Yin Cc: Costa Shulyupin Cc: Crystal Wood Cc: Gabriele Monaco Link: https://lore.kernel.org/20250626123405.1496931-8-tglozar@redhat.com Signed-off-by: Tomas Glozar Signed-off-by: Steven Rostedt (Google) --- tools/tracing/rtla/tests/timerlat.t | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests= /timerlat.t index 579c12a85e8f..b354bacd78f8 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -18,6 +18,8 @@ fi for option in $no_bpf_options do export RTLA_NO_BPF=3D$option + +# Basic tests check "verify help page" \ "timerlat --help" check "verify -s/--stack" \ @@ -36,6 +38,32 @@ check "verify -c/--cpus" \ "timerlat hist -c 0 -d 30s" check "hist test in nanoseconds" \ "timerlat hist -i 2 -c 0 -n -d 30s" 2 + +# 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 -A trace" \ + "timerlat hist -T 2 --on-threshold trace" 2 "^ Saving trace to timerlat_= trace.txt$" +check "trace output through -A 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 "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 1; false' --on= -threshold shell,command=3D'echo -n 2'" 2 "^1ALL" +check "hist with continue" \ + "timerlat hist -T 2 -d 1s --on-threshold shell,command=3D'echo TestOutput= ' --on-threshold continue" 0 "^TestOutput$" +check "top with continue" \ + "timerlat top -q -T 2 -d 1s --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$" done =20 test_end --=20 2.47.2