Skip to content

Commit 829a6c0

Browse files
Daniel Bristot de Oliveirarostedt
authored andcommitted
rtla/osnoise: Add the hist mode
The rtla osnoise hist tool collects all osnoise:sample_threshold occurrence in a histogram, displaying the results in a user-friendly way. The tool also allows many configurations of the osnoise tracer and the collection of the tracer output. Here is one example of the rtla osnoise hist tool output: ---------- %< ---------- [root@f34 ~]# rtla osnoise hist --bucket-size 10 --entries 100 -c 0-8 -d 1M -r 9000 -P F:1 # RTLA osnoise histogram # Time unit is microseconds (us) # Duration: 0 00:01:00 Index CPU-000 CPU-001 CPU-002 CPU-003 CPU-004 CPU-005 CPU-006 CPU-007 CPU-008 0 430 434 352 455 440 463 467 436 484 10 88 88 92 141 120 100 126 166 100 20 19 7 12 22 8 8 13 13 16 30 6 0 2 0 1 2 2 1 0 50 0 0 0 0 0 0 1 0 0 over: 0 0 0 0 0 0 0 0 0 count: 543 529 458 618 569 573 609 616 600 min: 0 0 0 0 0 0 0 0 0 avg: 0 0 0 0 0 0 0 0 0 max: 30 20 30 20 30 30 50 30 20 ---------- >% ---------- Running - rtla osnoise hist --help provides information about the available options. Link: https://lkml.kernel.org/r/c68060544de89b8b62510ed91c7369f162eb465b.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 1eceb2f commit 829a6c0

File tree

3 files changed

+807
-1
lines changed

3 files changed

+807
-1
lines changed

tools/tracing/rtla/src/osnoise.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,8 @@ static void osnoise_usage(void)
828828
" usage: [rtla] osnoise [MODE] ...",
829829
"",
830830
" modes:",
831-
" top - prints the summary from osnoise tracer",
831+
" top - prints the summary from osnoise tracer",
832+
" hist - prints a histogram of osnoise samples",
832833
"",
833834
"if no MODE is given, the top mode is called, passing the arguments",
834835
NULL,
@@ -863,6 +864,9 @@ int osnoise_main(int argc, char *argv[])
863864
} else if (strcmp(argv[1], "top") == 0) {
864865
osnoise_top_main(argc-1, &argv[1]);
865866
exit(0);
867+
} else if (strcmp(argv[1], "hist") == 0) {
868+
osnoise_hist_main(argc-1, &argv[1]);
869+
exit(0);
866870
}
867871

868872
usage:

tools/tracing/rtla/src/osnoise.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,6 @@ 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_hist_main(int argc, char *argv[]);
8990
int osnoise_top_main(int argc, char **argv);
9091
int osnoise_main(int argc, char **argv);

0 commit comments

Comments
 (0)