rtla: Tools main loop cleanup
authorDaniel Bristot de Oliveira <bristot@kernel.org>
Wed, 2 Mar 2022 19:01:40 +0000 (20:01 +0100)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 15 Mar 2022 18:36:50 +0000 (14:36 -0400)
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>
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 c47780fedbaf8a0f4e3940f8d01f304384a88f83..b4380d45cacd4545754dd258581a70f976104c39 100644 (file)
@@ -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);
 
index fd29a4049322f930311b1b857a9289b006c0db9b..72c2fd6ce005d6c6d0a05eb960ea4d1ac60a62df 100644 (file)
@@ -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,
@@ -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);
 
index 0f6ce80a198a0e509ceb7c469632479fa00c1536..dc908126c610d1ef230a116ee425f8a596f78b0e 100644 (file)
@@ -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);
 
index 53f4cdfd395e260eba4652468c533d08851a9bd4..1f754c3df53f2a2083ed5205320c020f35c37bd0 100644 (file)
@@ -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);