3 # Analyze a given results directory for rcuperf performance measurements,
4 # looking for ftrace data. Exits with 0 if data was found, analyzed, and
5 # printed. Intended to be invoked from kvm-recheck-rcuperf.sh after
8 # Usage: kvm-recheck-rcuperf-ftrace.sh resdir
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, you can access it online at
22 # http://www.gnu.org/licenses/gpl-2.0.html.
24 # Copyright (C) IBM Corporation, 2016
26 # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
31 if test "`grep -c 'rcu_exp_grace_period.*start' < $i/console.log`" -lt 100
36 sed -e 's/^\[[^]]*]//' < $i/console.log |
37 grep 'us : rcu_exp_grace_period' |
38 sed -e 's/us : / : /' |
47 seqtask[startseq] = starttask;
52 curgpdur = $3 - starttime;
53 gptimes[++n] = curgpdur;
54 gptaskcnt[starttask]++;
57 print "Long GP " starttime "us to " $3 "us (" curgpdur "us)";
60 # Lost a message or some such, reset.
66 $8 == "done" && seqtask[$7] != $1 {
71 newNR = asort(gptimes);
73 print "No ftrace records found???"
76 pct50 = int(newNR * 50 / 100);
79 pct90 = int(newNR * 90 / 100);
82 pct99 = int(newNR * 99 / 100);
85 div = 10 ** int(log(gptimes[pct90]) / log(10) + .5) / 100;
86 print "Histogram bucket size: " div;
87 last = gptimes[1] - 10;
89 for (i = 1; i <= newNR; i++) {
90 current = div * int(gptimes[i] / div);
91 if (last == current) {
102 print "Distribution of grace periods across tasks:";
103 for (i in gptaskcnt) {
104 print "\t" i, gptaskcnt[i];
105 nbatches += gptaskcnt[i];
108 print "Distribution of piggybacking across tasks:";
109 for (i in piggybackcnt) {
110 print "\t" i, piggybackcnt[i];
111 ngps += piggybackcnt[i];
113 print "Average grace-period duration: " sum / newNR " microseconds";
114 print "Minimum grace-period duration: " gptimes[1];
115 print "50th percentile grace-period duration: " gptimes[pct50];
116 print "90th percentile grace-period duration: " gptimes[pct90];
117 print "99th percentile grace-period duration: " gptimes[pct99];
118 print "Maximum grace-period duration: " gptimes[newNR];
119 print "Grace periods: " ngps + 0 " Batches: " nbatches + 0 " Ratio: " ngps / nbatches " Lost: " nlost + 0;
120 print "Computed from ftrace data.";