Skip to content

Commit 1eceb2f

Browse files
Daniel Bristot de Oliveirarostedt
Daniel Bristot de Oliveira
authored andcommitted
rtla/osnoise: Add osnoise top mode
The rtla osnoise tool is an interface for the osnoise tracer. The osnoise tracer dispatches a kernel thread per-cpu. These threads read the time in a loop while with preemption, softirqs and IRQs enabled, thus allowing all the sources of osnoise during its execution. The osnoise threads take note of the entry and exit point of any source of interferences, increasing a per-cpu interference counter. The osnoise tracer also saves an interference counter for each source of interference. The rtla osnoise top mode displays information about the periodic summary from the osnoise tracer. One example of rtla osnoise top output is: [root@alien ~]# rtla osnoise top -c 0-3 -d 1m -q -r 900000 -P F:1 Operating System Noise duration: 0 00:01:00 | time is in us CPU Period Runtime Noise % CPU Aval Max Noise Max Single HW NMI IRQ Softirq Thread 0 #58 52200000 1031 99.99802 91 60 0 0 52285 0 101 1 #59 53100000 5 99.99999 5 5 0 9 53122 0 18 2 #59 53100000 7 99.99998 7 7 0 8 53115 0 18 3 #59 53100000 8274 99.98441 277 23 0 9 53778 0 660 "rtla osnoise top --help" works and provide information about the available options. Link: https://lkml.kernel.org/r/0d796993abf587ae5a170bb8415c49368d4999e1.1639158831.git.bristot@kernel.org Cc: Tao Zhou <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Tom Zanussi <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Clark Williams <[email protected]> Cc: John Kacur <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Sebastian Andrzej Siewior <[email protected]> Cc: Daniel Bristot de Oliveira <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Bristot de Oliveira <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 0605bf0 commit 1eceb2f

File tree

3 files changed

+596
-0
lines changed

3 files changed

+596
-0
lines changed

tools/tracing/rtla/src/osnoise.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,9 +844,25 @@ int osnoise_main(int argc, char *argv[])
844844
if (argc == 0)
845845
goto usage;
846846

847+
/*
848+
* if osnoise was called without any argument, run the
849+
* default cmdline.
850+
*/
851+
if (argc == 1) {
852+
osnoise_top_main(argc, argv);
853+
exit(0);
854+
}
855+
847856
if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0)) {
848857
osnoise_usage();
849858
exit(0);
859+
} else if (strncmp(argv[1], "-", 1) == 0) {
860+
/* the user skipped the tool, call the default one */
861+
osnoise_top_main(argc, argv);
862+
exit(0);
863+
} else if (strcmp(argv[1], "top") == 0) {
864+
osnoise_top_main(argc-1, &argv[1]);
865+
exit(0);
850866
}
851867

852868
usage:

tools/tracing/rtla/src/osnoise.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,5 @@ void osnoise_destroy_tool(struct osnoise_tool *top);
8686
struct osnoise_tool *osnoise_init_tool(char *tool_name);
8787
struct osnoise_tool *osnoise_init_trace_tool(char *tracer);
8888

89+
int osnoise_top_main(int argc, char **argv);
8990
int osnoise_main(int argc, char **argv);

0 commit comments

Comments
 (0)