1 // SPDX-License-Identifier: GPL-2.0
15 * rtla_usage - print rtla usage
17 static void rtla_usage(void)
21 static const char *msg[] = {
23 "rtla version " VERSION,
25 " usage: rtla COMMAND ...",
28 " osnoise - gives information about the operating system noise (osnoise)",
29 " timerlat - measures the timer irq and thread latency",
34 for (i = 0; msg[i]; i++)
35 fprintf(stderr, "%s\n", msg[i]);
40 * run_command - try to run a rtla tool command
42 * It returns 0 if it fails. The tool's main will generally not
43 * return as they should call exit().
45 int run_command(int argc, char **argv, int start_position)
47 if (strcmp(argv[start_position], "osnoise") == 0) {
48 osnoise_main(argc-start_position, &argv[start_position]);
50 } else if (strcmp(argv[start_position], "timerlat") == 0) {
51 timerlat_main(argc-start_position, &argv[start_position]);
60 int main(int argc, char *argv[])
65 retval = run_command(argc, argv, 0);
72 if (strcmp(argv[1], "-h") == 0) {
75 } else if (strcmp(argv[1], "--help") == 0) {
80 retval = run_command(argc, argv, 1);