Skip to content

Commit 75016ca

Browse files
Daniel Bristot de Oliveirarostedt
authored andcommitted
rtla: Tools main loop cleanup
I probably started using "do {} while();", but changed all but osnoise_top to "while(){};" leaving the ; behind. Cleanup the main loop code, making all tools use "while() {}" Changcheng Deng reported this problem, as reported by coccicheck: Fix the following coccicheck review: ./tools/tracing/rtla/src/timerlat_hist.c: 800: 2-3: Unneeded semicolon ./tools/tracing/rtla/src/osnoise_hist.c: 776: 2-3: Unneeded semicolon ./tools/tracing/rtla/src/timerlat_top.c: 596: 2-3: Unneeded semicolon Link: https://lkml.kernel.org/r/3c1642110aa87c396f5da4a037dabc72dbb9c601.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira <bristot@kernel.org> Cc: Clark Williams <williams@redhat.com> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Jonathan Corbet <corbet@lwn.net> Reported-by: Changcheng Deng <deng.changcheng@zte.com.cn> Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 7d0dc95 commit 75016ca

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

tools/tracing/rtla/src/osnoise_hist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ int osnoise_hist_main(int argc, char *argv[])
850850

851851
if (trace_is_off(&tool->trace, &record->trace))
852852
break;
853-
};
853+
}
854854

855855
osnoise_read_trace_hist(tool);
856856

tools/tracing/rtla/src/osnoise_top.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ int osnoise_top_main(int argc, char **argv)
612612
tool->start_time = time(NULL);
613613
osnoise_top_set_signals(params);
614614

615-
do {
615+
while (!stop_tracing) {
616616
sleep(params->sleep_time);
617617

618618
retval = tracefs_iterate_raw_events(trace->tep,
@@ -632,7 +632,7 @@ int osnoise_top_main(int argc, char **argv)
632632
if (trace_is_off(&tool->trace, &record->trace))
633633
break;
634634

635-
} while (!stop_tracing);
635+
}
636636

637637
osnoise_print_stats(params, tool);
638638

tools/tracing/rtla/src/timerlat_hist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ int timerlat_hist_main(int argc, char *argv[])
885885

886886
if (trace_is_off(&tool->trace, &record->trace))
887887
break;
888-
};
888+
}
889889

890890
timerlat_print_stats(params, tool);
891891

tools/tracing/rtla/src/timerlat_top.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ int timerlat_top_main(int argc, char *argv[])
680680
if (trace_is_off(&top->trace, &record->trace))
681681
break;
682682

683-
};
683+
}
684684

685685
timerlat_print_stats(params, top);
686686

0 commit comments

Comments
 (0)