SoW-2020-0002: Trace Hit Counters: trigger error reporting integration
[lttng-tools.git] / doc / examples / trigger-on-event / performance / generate-graph.sh
1 #!/bin/bash
2 #
3 # Copyright (C) 2020 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
4 #
5 # SPDX-License-Identifier: MIT
6
7 plugin_path=$(dirname "$0")
8
9 DATA1="[\"duration\", \"D1\", \"performance:hit\", [\"source\", \"iteration\"], \"performance:receive\", [\"source\", \"iteration\"]]"
10
11 while read -r load delay count; do
12 S=$(echo "scale=3; 1 / ( $delay / 1000 )" | bc | awk '{printf "%.3f", $0}' );
13 hz=${S/.000/}
14 hz_title=${hz/./-}
15
16 echo "Graphing Hz: ${hz} CPU: ${load}"
17
18 PLOT1="[\"Trigger latency, Freq:${hz}Hz, CPU load: ${load}%\", \"T (ms)\", \"count\", [$DATA1]]"
19
20 babeltrace2 --plugin-path="$plugin_path" --component sink.plot.PlotSink \
21 --params="histograms=[$PLOT1]" \
22 "./trace/${load}_cpuload_${delay}ms"
23 done << EOF
24 0 1 10000
25 25 1 10000
26 50 1 10000
27 75 1 10000
28 100 1 10000
29 0 10 5000
30 25 10 5000
31 50 10 5000
32 75 10 5000
33 100 10 5000
34 0 100 6000
35 25 100 6000
36 50 100 6000
37 75 100 6000
38 100 100 6000
39 0 1000 1500
40 25 1000 1500
41 50 1000 1500
42 75 1000 1500
43 100 1000 1500
44 0 10000 300
45 25 10000 300
46 50 10000 300
47 75 10000 300
48 100 10000 300
49 0 60000 50
50 25 60000 50
51 50 60000 50
52 75 60000 50
53 100 60000 50
54 EOF
55
56 pdf_unite=""
57 csvs=""
58 # Generate united graph and base pdf list to unite
59 while read -r delay ; do
60 S=$(echo "scale=3; 1 / ( $delay / 1000 )" | bc | awk '{printf "%.3f", $0}' );
61 hz=${S/.000/}
62 hz_title=${hz/./-}
63 local_pdf_unite=""
64 echo "Combining graphs for Hz: ${hz} hz_title: $hz_title"
65
66 loggers=""
67 for load in 100 75 50 25 0; do
68 path=trigger-latency-freq-${hz_title}hz-cpu-load-${load}-.D1.csv
69 csvs="$csvs $path"
70 loggers="[\"duration-csv\", \"${load}% CPU\", \"${path}\"], $loggers"
71 local_pdf_unite="${local_pdf_unite} trigger-latency-freq-${hz_title}hz-cpu-load-${load}-.pdf"
72 done
73 pdf_unite="$pdf_unite $local_pdf_unite"
74
75 PLOT1="[\"Trigger latency, Freq:${hz}Hz\", \"T (ms)\", \"count\", [$loggers]]"
76 babeltrace2 --plugin-path="$plugin_path" --component sink.plot.PlotSink \
77 --params="histograms=[$PLOT1]" \
78 "./trace/0_cpuload_${delay}ms"
79 done << EOF
80 1
81 10
82 100
83 1000
84 10000
85 60000
86 EOF
87
88 # Add united graphs to the pdfunite cmd
89 while read -r delay ; do
90 S=$(echo "scale=3; 1 / ( $delay / 1000 )" | bc | awk '{printf "%.3f", $0}' );
91 hz=${S/.000/}
92 hz_title=${hz/./-}
93
94 pdf_unite="trigger-latency-freq-${hz_title}hz.pdf $pdf_unite"
95
96 done << EOF
97 60000
98 10000
99 1000
100 100
101 10
102 1
103 EOF
104
105 rm -rf $csvs
106
107 pdfunite $pdf_unite summary.pdf
108
This page took 0.04594 seconds and 5 git commands to generate.