rtla: Fix -a overriding -t argument

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: 173a3b0148 ("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>
This commit is contained in:
Ivan Pravdin 2025-11-03 11:19:08 -05:00 committed by Tomas Glozar
parent 7b71f3a698
commit ddb6e42494
4 changed files with 8 additions and 4 deletions

View File

@ -534,6 +534,7 @@ static struct common_params
params->threshold = 1; params->threshold = 1;
/* set trace */ /* set trace */
if (!trace_output)
trace_output = "osnoise_trace.txt"; trace_output = "osnoise_trace.txt";
break; break;

View File

@ -386,6 +386,7 @@ struct common_params *osnoise_top_parse_args(int argc, char **argv)
params->threshold = 1; params->threshold = 1;
/* set trace */ /* set trace */
if (!trace_output)
trace_output = "osnoise_trace.txt"; trace_output = "osnoise_trace.txt";
break; break;

View File

@ -853,6 +853,7 @@ static struct common_params
params->print_stack = auto_thresh; params->print_stack = auto_thresh;
/* set trace */ /* set trace */
if (!trace_output)
trace_output = "timerlat_trace.txt"; trace_output = "timerlat_trace.txt";
break; break;

View File

@ -617,6 +617,7 @@ static struct common_params
params->print_stack = auto_thresh; params->print_stack = auto_thresh;
/* set trace */ /* set trace */
if (!trace_output)
trace_output = "timerlat_trace.txt"; trace_output = "timerlat_trace.txt";
break; break;