Skip to content

Commit ddb6e42

Browse files
ivpravdinlenticularis39
authored andcommitted
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: 173a3b0 ("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>
1 parent 7b71f3a commit ddb6e42

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

tools/tracing/rtla/src/osnoise_hist.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ static struct common_params
534534
params->threshold = 1;
535535

536536
/* set trace */
537-
trace_output = "osnoise_trace.txt";
537+
if (!trace_output)
538+
trace_output = "osnoise_trace.txt";
538539

539540
break;
540541
case 'b':

tools/tracing/rtla/src/osnoise_top.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@ struct common_params *osnoise_top_parse_args(int argc, char **argv)
386386
params->threshold = 1;
387387

388388
/* set trace */
389-
trace_output = "osnoise_trace.txt";
389+
if (!trace_output)
390+
trace_output = "osnoise_trace.txt";
390391

391392
break;
392393
case 'c':

tools/tracing/rtla/src/timerlat_hist.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,8 @@ static struct common_params
853853
params->print_stack = auto_thresh;
854854

855855
/* set trace */
856-
trace_output = "timerlat_trace.txt";
856+
if (!trace_output)
857+
trace_output = "timerlat_trace.txt";
857858

858859
break;
859860
case 'c':

tools/tracing/rtla/src/timerlat_top.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,8 @@ static struct common_params
617617
params->print_stack = auto_thresh;
618618

619619
/* set trace */
620-
trace_output = "timerlat_trace.txt";
620+
if (!trace_output)
621+
trace_output = "timerlat_trace.txt";
621622

622623
break;
623624
case '5':

0 commit comments

Comments
 (0)