aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/contrib/bb-perf/buildstats-plots.sh
blob: 04c1707dcc0c8d3b0ab97057bf02b6cd1fa454b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
#
# Copyright (c) 2011, Intel Corporation.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

set -o nounset
set -o errexit

OUTDIR="buildstats-plots"
CD=$(dirname $0)

function bsplots() {
    local STAT=$1

    NS_STAT=$(echo $STAT | sed -e 's/ /-/g')
    GPLIMAGE='set terminal png fontscale 1 size 1920,1080'

    # task-recipe plot
    OUTDATA="$OUTDIR/$NS_STAT.ts"
    OUTGPL="set output '$OUTDATA.png'"
    $CD/buildstats-plot.sh -o "$OUTDATA" -s "$STAT" > "$OUTDATA.gpl"
    gnuplot -e "$GPLIMAGE;$OUTGPL" "$OUTDATA.gpl"

    # task plot
    OUTDATA="$OUTDIR/$NS_STAT.t"
    OUTGPL="set output '$OUTDATA.png'"
    $CD/buildstats-plot.sh -o "$OUTDATA" -s "$STAT" -S > "$OUTDATA.gpl"
    gnuplot -e "$GPLIMAGE;$OUTGPL" "$OUTDATA.gpl"
}

if [ ! -d "$OUTDIR" ]; then
    mkdir -p $OUTDIR
fi

bsplots "utime"
bsplots "stime"
bsplots "cutime"
bsplots "cstime"
bsplots "IO wchar"
bsplots "IO write_bytes"
bsplots "IO syscr"
bsplots "IO read_bytes"
bsplots "IO rchar"
bsplots "IO syscw"
bsplots "IO cancelled_write_bytes"
bsplots "rusage ru_utime"
bsplots "rusage ru_stime"
bsplots "rusage ru_maxrss"
bsplots "rusage ru_minflt"
bsplots "rusage ru_majflt"
bsplots "rusage ru_inblock"
bsplots "rusage ru_oublock"
bsplots "rusage ru_nvcsw"
bsplots "rusage ru_nivcsw"
bsplots "Child rusage ru_utime"
bsplots "Child rusage ru_stime"
bsplots "Child rusage ru_maxrss"
bsplots "Child rusage ru_minflt"
bsplots "Child rusage ru_majflt"
bsplots "Child rusage ru_inblock"
bsplots "Child rusage ru_oublock"
bsplots "Child rusage ru_nvcsw"
bsplots "Child rusage ru_nivcsw"