mirror of
https://git.yoctoproject.org/poky
synced 2026-06-04 14:09:47 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
3bd3e23304
commit
41b145b2b1
@@ -39,6 +39,7 @@ set -o errexit
|
|||||||
|
|
||||||
BS_DIR="tmp/buildstats"
|
BS_DIR="tmp/buildstats"
|
||||||
N=10
|
N=10
|
||||||
|
RECIPE=""
|
||||||
TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack"
|
TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack"
|
||||||
STATS="utime"
|
STATS="utime"
|
||||||
ACCUMULATE=""
|
ACCUMULATE=""
|
||||||
@@ -53,6 +54,7 @@ Usage: $CMD [-b buildstats_dir] [-t do_task]
|
|||||||
(default: "$BS_DIR")
|
(default: "$BS_DIR")
|
||||||
-n N Top N recipes to display. Ignored if -S is present
|
-n N Top N recipes to display. Ignored if -S is present
|
||||||
(default: "$N")
|
(default: "$N")
|
||||||
|
-r recipe The recipe mask to be searched
|
||||||
-t tasks The tasks to be computed
|
-t tasks The tasks to be computed
|
||||||
(default: "$TASKS")
|
(default: "$TASKS")
|
||||||
-s stats The stats to be matched. If more that one stat, units
|
-s stats The stats to be matched. If more that one stat, units
|
||||||
@@ -69,7 +71,7 @@ EOM
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Parse and validate arguments
|
# Parse and validate arguments
|
||||||
while getopts "b:n:t:s:o:aSh" OPT; do
|
while getopts "b:n:r:t:s:o:aSh" OPT; do
|
||||||
case $OPT in
|
case $OPT in
|
||||||
b)
|
b)
|
||||||
BS_DIR="$OPTARG"
|
BS_DIR="$OPTARG"
|
||||||
@@ -77,6 +79,9 @@ while getopts "b:n:t:s:o:aSh" OPT; do
|
|||||||
n)
|
n)
|
||||||
N="$OPTARG"
|
N="$OPTARG"
|
||||||
;;
|
;;
|
||||||
|
r)
|
||||||
|
RECIPE="-r $OPTARG"
|
||||||
|
;;
|
||||||
t)
|
t)
|
||||||
TASKS="$OPTARG"
|
TASKS="$OPTARG"
|
||||||
;;
|
;;
|
||||||
@@ -112,7 +117,7 @@ CD=$(dirname $0)
|
|||||||
|
|
||||||
# Parse buildstats recipes to produce a single table
|
# Parse buildstats recipes to produce a single table
|
||||||
OUTBUILDSTATS="$PWD/buildstats.log"
|
OUTBUILDSTATS="$PWD/buildstats.log"
|
||||||
$CD/buildstats.sh -b "$BS_DIR" -s "$STATS" -t "$TASKS" $ACCUMULATE -H > $OUTBUILDSTATS
|
$CD/buildstats.sh -b "$BS_DIR" -s "$STATS" -t "$TASKS" $RECIPE $ACCUMULATE -H > $OUTBUILDSTATS
|
||||||
|
|
||||||
# Get headers
|
# Get headers
|
||||||
HEADERS=$(cat $OUTBUILDSTATS | sed -n -e '1s/ /-/g' -e '1s/:/ /gp')
|
HEADERS=$(cat $OUTBUILDSTATS | sed -n -e '1s/ /-/g' -e '1s/:/ /gp')
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ Child rusage ru_majflt:Child rusage ru_inblock:Child rusage ru_oublock:Child rus
|
|||||||
Child rusage ru_nivcsw"
|
Child rusage ru_nivcsw"
|
||||||
|
|
||||||
BS_DIR="tmp/buildstats"
|
BS_DIR="tmp/buildstats"
|
||||||
|
RECIPE=""
|
||||||
TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack"
|
TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack"
|
||||||
STATS="$TIME"
|
STATS="$TIME"
|
||||||
ACCUMULATE=""
|
ACCUMULATE=""
|
||||||
@@ -47,6 +48,7 @@ cat <<EOM
|
|||||||
Usage: $CMD [-b buildstats_dir] [-t do_task]
|
Usage: $CMD [-b buildstats_dir] [-t do_task]
|
||||||
-b buildstats The path where the folder resides
|
-b buildstats The path where the folder resides
|
||||||
(default: "$BS_DIR")
|
(default: "$BS_DIR")
|
||||||
|
-r recipe The recipe to be computed
|
||||||
-t tasks The tasks to be computed
|
-t tasks The tasks to be computed
|
||||||
(default: "$TASKS")
|
(default: "$TASKS")
|
||||||
-s stats The stats to be matched. Options: TIME, IO, RUSAGE, CHILD_RUSAGE
|
-s stats The stats to be matched. Options: TIME, IO, RUSAGE, CHILD_RUSAGE
|
||||||
@@ -63,11 +65,14 @@ EOM
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Parse and validate arguments
|
# Parse and validate arguments
|
||||||
while getopts "b:t:s:aHh" OPT; do
|
while getopts "b:r:t:s:aHh" OPT; do
|
||||||
case $OPT in
|
case $OPT in
|
||||||
b)
|
b)
|
||||||
BS_DIR="$OPTARG"
|
BS_DIR="$OPTARG"
|
||||||
;;
|
;;
|
||||||
|
r)
|
||||||
|
RECIPE="$OPTARG"
|
||||||
|
;;
|
||||||
t)
|
t)
|
||||||
TASKS="$OPTARG"
|
TASKS="$OPTARG"
|
||||||
;;
|
;;
|
||||||
@@ -133,7 +138,7 @@ fi
|
|||||||
|
|
||||||
for task in ${TASKS}; do
|
for task in ${TASKS}; do
|
||||||
task="do_${task}"
|
task="do_${task}"
|
||||||
for file in $(find ${BS_DIR} -type f -name ${task} | awk 'BEGIN{ ORS=""; OFS=":" } { print $0,"" }'); do
|
for file in $(find ${BS_DIR} -type f -path *${RECIPE}*/${task} | awk 'BEGIN{ ORS=""; OFS=":" } { print $0,"" }'); do
|
||||||
recipe="$(basename $(dirname $file))"
|
recipe="$(basename $(dirname $file))"
|
||||||
times=""
|
times=""
|
||||||
for stat in ${stats}; do
|
for stat in ${stats}; do
|
||||||
|
|||||||
Reference in New Issue
Block a user