]> Gentwo Git Trees - linux/.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)
committerTomas Glozar <tglozar@redhat.com>
Fri, 21 Nov 2025 09:30:27 +0000 (10:30 +0100)
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>
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 1d06ea47b663c5b9d9c7aaaea7215dd63293477b..ff8c231e47c475f2475c89573a076806ce9b3882 100644 (file)
@@ -534,7 +534,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 cac60e4c267e80b211c517beadb8e946e7263027..04c699bdd73638bf479c4319bb4ab6404e4c2900 100644 (file)
@@ -386,7 +386,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 961aa969c003524f041bb23a1a4a30e7fae649bd..1fb471a787b791e10647c50d39b185c0a00c1c12 100644 (file)
@@ -853,7 +853,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 213356a5be522c22e6f04969d2823c09e6633cd3..fec113ce370e9c7a0e3f4624a6eb13ade6c6f9a0 100644 (file)
@@ -617,7 +617,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':