]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rtla: Fix -a overriding -t argument
authorIvan Pravdin <ipravdin.official@gmail.com>
Mon, 3 Nov 2025 16:19:08 +0000 (11:19 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:10 +0000 (14:03 +0100)
[ Upstream commit ddb6e42494e5c48c17e64f29b7674b9add486a19 ]

When running rtla as

    `rtla <timerlat|osnoise> <top|hist> -t custom_file.txt -a 100`

-a options override trace output filename specified by -t option.
Running the command above will create <timerlat|osnoise>_trace.txt file
instead of custom_file.txt. Fix this by making sure that -a option does
not override trace output filename even if it's passed after trace
output filename is specified.

Fixes: 173a3b014827 ("rtla/timerlat: Add the automatic trace option")
Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com>
Reviewed-by: Tomas Glozar <tglozar@redhat.com>
Link: https://lore.kernel.org/r/b6ae60424050b2c1c8709e18759adead6012b971.1762186418.git.ipravdin.official@gmail.com
[ use capital letter in subject, as required by tracing subsystem ]
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/tracing/rtla/src/osnoise_hist.c
tools/tracing/rtla/src/osnoise_top.c
tools/tracing/rtla/src/timerlat_hist.c
tools/tracing/rtla/src/timerlat_top.c

index dffb6d0a98d7d95bc3d84d1755c20eb834d797c9..d22feb4d6cc9dc91d63eab4d8b2272f92e4603ea 100644 (file)
@@ -557,7 +557,8 @@ static struct common_params
                        params->threshold = 1;
 
                        /* set trace */
-                       trace_output = "osnoise_trace.txt";
+                       if (!trace_output)
+                               trace_output = "osnoise_trace.txt";
 
                        break;
                case 'b':
index 95418f7ecc9613f4fd416dc170c1f0ab0bb7576e..a8d31030c412292731e7e949e05f0936783d70af 100644 (file)
@@ -397,7 +397,8 @@ struct common_params *osnoise_top_parse_args(int argc, char **argv)
                        params->threshold = 1;
 
                        /* set trace */
-                       trace_output = "osnoise_trace.txt";
+                       if (!trace_output)
+                               trace_output = "osnoise_trace.txt";
 
                        break;
                case 'c':
index 606c1688057b2737e25613b0303a44fb4780d014..3d56df3d5fa0d41920cfbda2d31c48c150d35c42 100644 (file)
@@ -878,7 +878,8 @@ static struct common_params
                        params->print_stack = auto_thresh;
 
                        /* set trace */
-                       trace_output = "timerlat_trace.txt";
+                       if (!trace_output)
+                               trace_output = "timerlat_trace.txt";
 
                        break;
                case 'c':
index fc479a0dcb597a56abd3ba52aca574ed3a6ef534..6cc9a3607c6653e25a482a56e03059a82d26f8c5 100644 (file)
@@ -628,7 +628,8 @@ static struct common_params
                        params->print_stack = auto_thresh;
 
                        /* set trace */
-                       trace_output = "timerlat_trace.txt";
+                       if (!trace_output)
+                               trace_output = "timerlat_trace.txt";
 
                        break;
                case '5':