1 // SPDX-License-Identifier: GPL-2.0
17 static void timerlat_usage(int err)
21 static const char * const msg[] = {
23 "timerlat version " VERSION,
25 " usage: [rtla] timerlat [MODE] ...",
28 " top - prints the summary from timerlat tracer",
29 " hist - prints a histogram of timer latencies",
31 "if no MODE is given, the top mode is called, passing the arguments",
35 for (i = 0; msg[i]; i++)
36 fprintf(stderr, "%s\n", msg[i]);
40 int timerlat_main(int argc, char *argv[])
46 * if timerlat was called without any argument, run the
50 timerlat_top_main(argc, argv);
54 if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0)) {
56 } else if (strncmp(argv[1], "-", 1) == 0) {
57 /* the user skipped the tool, call the default one */
58 timerlat_top_main(argc, argv);
60 } else if (strcmp(argv[1], "top") == 0) {
61 timerlat_top_main(argc-1, &argv[1]);
63 } else if (strcmp(argv[1], "hist") == 0) {
64 timerlat_hist_main(argc-1, &argv[1]);