diff options
| author | Luis Martins <luis.martins@criticaltechworks.com> | 2020-03-24 11:33:12 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-24 16:39:40 +0000 |
| commit | 41b145b2b10dc9eadebba0d2ea16cd6f21f8c12f (patch) | |
| tree | 64b7cf30bdb2973eb16e6419750ba3c4bc3d8264 /scripts/contrib | |
| parent | 3bd3e23304a41c2cabab4dd7994af2e2bfcc7dca (diff) | |
| download | poky-41b145b2b10dc9eadebba0d2ea16cd6f21f8c12f.tar.gz | |
buildstats*.sh: add recipe parameter to scripts
Add option to filter the stats results for a single recipe, allowing
to easilly visuality the task resource consumption per recipe.
This is specially useful when debugging the performance of
the overall bitbake build system.
(From OE-Core rev: b4bf898d53af60f5d69b50ec5cdd7f9b3870f2dd)
Signed-off-by: Luis Martins <luis.martins@criticaltechworks.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib')
| -rwxr-xr-x | scripts/contrib/bb-perf/buildstats-plot.sh | 9 | ||||
| -rwxr-xr-x | scripts/contrib/bb-perf/buildstats.sh | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/scripts/contrib/bb-perf/buildstats-plot.sh b/scripts/contrib/bb-perf/buildstats-plot.sh index f26312f355..320c4910a1 100755 --- a/scripts/contrib/bb-perf/buildstats-plot.sh +++ b/scripts/contrib/bb-perf/buildstats-plot.sh | |||
| @@ -39,6 +39,7 @@ set -o errexit | |||
| 39 | 39 | ||
| 40 | BS_DIR="tmp/buildstats" | 40 | BS_DIR="tmp/buildstats" |
| 41 | N=10 | 41 | N=10 |
| 42 | RECIPE="" | ||
| 42 | TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack" | 43 | TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack" |
| 43 | STATS="utime" | 44 | STATS="utime" |
| 44 | ACCUMULATE="" | 45 | ACCUMULATE="" |
| @@ -53,6 +54,7 @@ Usage: $CMD [-b buildstats_dir] [-t do_task] | |||
| 53 | (default: "$BS_DIR") | 54 | (default: "$BS_DIR") |
| 54 | -n N Top N recipes to display. Ignored if -S is present | 55 | -n N Top N recipes to display. Ignored if -S is present |
| 55 | (default: "$N") | 56 | (default: "$N") |
| 57 | -r recipe The recipe mask to be searched | ||
| 56 | -t tasks The tasks to be computed | 58 | -t tasks The tasks to be computed |
| 57 | (default: "$TASKS") | 59 | (default: "$TASKS") |
| 58 | -s stats The stats to be matched. If more that one stat, units | 60 | -s stats The stats to be matched. If more that one stat, units |
| @@ -69,7 +71,7 @@ EOM | |||
| 69 | } | 71 | } |
| 70 | 72 | ||
| 71 | # Parse and validate arguments | 73 | # Parse and validate arguments |
| 72 | while getopts "b:n:t:s:o:aSh" OPT; do | 74 | while getopts "b:n:r:t:s:o:aSh" OPT; do |
| 73 | case $OPT in | 75 | case $OPT in |
| 74 | b) | 76 | b) |
| 75 | BS_DIR="$OPTARG" | 77 | BS_DIR="$OPTARG" |
| @@ -77,6 +79,9 @@ while getopts "b:n:t:s:o:aSh" OPT; do | |||
| 77 | n) | 79 | n) |
| 78 | N="$OPTARG" | 80 | N="$OPTARG" |
| 79 | ;; | 81 | ;; |
| 82 | r) | ||
| 83 | RECIPE="-r $OPTARG" | ||
| 84 | ;; | ||
| 80 | t) | 85 | t) |
| 81 | TASKS="$OPTARG" | 86 | TASKS="$OPTARG" |
| 82 | ;; | 87 | ;; |
| @@ -112,7 +117,7 @@ CD=$(dirname $0) | |||
| 112 | 117 | ||
| 113 | # Parse buildstats recipes to produce a single table | 118 | # Parse buildstats recipes to produce a single table |
| 114 | OUTBUILDSTATS="$PWD/buildstats.log" | 119 | OUTBUILDSTATS="$PWD/buildstats.log" |
| 115 | $CD/buildstats.sh -b "$BS_DIR" -s "$STATS" -t "$TASKS" $ACCUMULATE -H > $OUTBUILDSTATS | 120 | $CD/buildstats.sh -b "$BS_DIR" -s "$STATS" -t "$TASKS" $RECIPE $ACCUMULATE -H > $OUTBUILDSTATS |
| 116 | 121 | ||
| 117 | # Get headers | 122 | # Get headers |
| 118 | HEADERS=$(cat $OUTBUILDSTATS | sed -n -e '1s/ /-/g' -e '1s/:/ /gp') | 123 | HEADERS=$(cat $OUTBUILDSTATS | sed -n -e '1s/ /-/g' -e '1s/:/ /gp') |
diff --git a/scripts/contrib/bb-perf/buildstats.sh b/scripts/contrib/bb-perf/buildstats.sh index 26bfaca86b..2f017efeb8 100755 --- a/scripts/contrib/bb-perf/buildstats.sh +++ b/scripts/contrib/bb-perf/buildstats.sh | |||
| @@ -36,6 +36,7 @@ Child rusage ru_majflt:Child rusage ru_inblock:Child rusage ru_oublock:Child rus | |||
| 36 | Child rusage ru_nivcsw" | 36 | Child rusage ru_nivcsw" |
| 37 | 37 | ||
| 38 | BS_DIR="tmp/buildstats" | 38 | BS_DIR="tmp/buildstats" |
| 39 | RECIPE="" | ||
| 39 | TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack" | 40 | TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack" |
| 40 | STATS="$TIME" | 41 | STATS="$TIME" |
| 41 | ACCUMULATE="" | 42 | ACCUMULATE="" |
| @@ -47,6 +48,7 @@ cat <<EOM | |||
| 47 | Usage: $CMD [-b buildstats_dir] [-t do_task] | 48 | Usage: $CMD [-b buildstats_dir] [-t do_task] |
| 48 | -b buildstats The path where the folder resides | 49 | -b buildstats The path where the folder resides |
| 49 | (default: "$BS_DIR") | 50 | (default: "$BS_DIR") |
| 51 | -r recipe The recipe to be computed | ||
| 50 | -t tasks The tasks to be computed | 52 | -t tasks The tasks to be computed |
| 51 | (default: "$TASKS") | 53 | (default: "$TASKS") |
| 52 | -s stats The stats to be matched. Options: TIME, IO, RUSAGE, CHILD_RUSAGE | 54 | -s stats The stats to be matched. Options: TIME, IO, RUSAGE, CHILD_RUSAGE |
| @@ -63,11 +65,14 @@ EOM | |||
| 63 | } | 65 | } |
| 64 | 66 | ||
| 65 | # Parse and validate arguments | 67 | # Parse and validate arguments |
| 66 | while getopts "b:t:s:aHh" OPT; do | 68 | while getopts "b:r:t:s:aHh" OPT; do |
| 67 | case $OPT in | 69 | case $OPT in |
| 68 | b) | 70 | b) |
| 69 | BS_DIR="$OPTARG" | 71 | BS_DIR="$OPTARG" |
| 70 | ;; | 72 | ;; |
| 73 | r) | ||
| 74 | RECIPE="$OPTARG" | ||
| 75 | ;; | ||
| 71 | t) | 76 | t) |
| 72 | TASKS="$OPTARG" | 77 | TASKS="$OPTARG" |
| 73 | ;; | 78 | ;; |
| @@ -133,7 +138,7 @@ fi | |||
| 133 | 138 | ||
| 134 | for task in ${TASKS}; do | 139 | for task in ${TASKS}; do |
| 135 | task="do_${task}" | 140 | task="do_${task}" |
| 136 | for file in $(find ${BS_DIR} -type f -name ${task} | awk 'BEGIN{ ORS=""; OFS=":" } { print $0,"" }'); do | 141 | for file in $(find ${BS_DIR} -type f -path *${RECIPE}*/${task} | awk 'BEGIN{ ORS=""; OFS=":" } { print $0,"" }'); do |
| 137 | recipe="$(basename $(dirname $file))" | 142 | recipe="$(basename $(dirname $file))" |
| 138 | times="" | 143 | times="" |
| 139 | for stat in ${stats}; do | 144 | for stat in ${stats}; do |
