Skip to content

Commit

Permalink
rtla: Tools main loop cleanup
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Clark Williams <[email protected]>
Cc: Juri Lelli <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Reported-by: Changcheng Deng <[email protected]>
Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Daniel Bristot de Oliveira <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>
  • Loading branch information
Daniel Bristot de Oliveira authored and rostedt committed Mar 15, 2022
1 parent 7d0dc95 commit 75016ca
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/tracing/rtla/src/osnoise_hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ int osnoise_hist_main(int argc, char *argv[])

if (trace_is_off(&tool->trace, &record->trace))
break;
};
}

osnoise_read_trace_hist(tool);

Expand Down
4 changes: 2 additions & 2 deletions tools/tracing/rtla/src/osnoise_top.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ int osnoise_top_main(int argc, char **argv)
tool->start_time = time(NULL);
osnoise_top_set_signals(params);

do {
while (!stop_tracing) {
sleep(params->sleep_time);

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

} while (!stop_tracing);
}

osnoise_print_stats(params, tool);

Expand Down
2 changes: 1 addition & 1 deletion tools/tracing/rtla/src/timerlat_hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ int timerlat_hist_main(int argc, char *argv[])

if (trace_is_off(&tool->trace, &record->trace))
break;
};
}

timerlat_print_stats(params, tool);

Expand Down
2 changes: 1 addition & 1 deletion tools/tracing/rtla/src/timerlat_top.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ int timerlat_top_main(int argc, char *argv[])
if (trace_is_off(&top->trace, &record->trace))
break;

};
}

timerlat_print_stats(params, top);

Expand Down

0 comments on commit 75016ca

Please sign in to comment.