BS_DIR="tmp/buildstats"
N=10
+RECIPE=""
TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack"
STATS="utime"
ACCUMULATE=""
(default: "$BS_DIR")
-n N Top N recipes to display. Ignored if -S is present
(default: "$N")
+ -r recipe The recipe mask to be searched
-t tasks The tasks to be computed
(default: "$TASKS")
-s stats The stats to be matched. If more that one stat, units
}
# 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
b)
BS_DIR="$OPTARG"
n)
N="$OPTARG"
;;
+ r)
+ RECIPE="-r $OPTARG"
+ ;;
t)
TASKS="$OPTARG"
;;
# Parse buildstats recipes to produce a single table
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
HEADERS=$(cat $OUTBUILDSTATS | sed -n -e '1s/ /-/g' -e '1s/:/ /gp')
Child rusage ru_nivcsw"
BS_DIR="tmp/buildstats"
+RECIPE=""
TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack"
STATS="$TIME"
ACCUMULATE=""
Usage: $CMD [-b buildstats_dir] [-t do_task]
-b buildstats The path where the folder resides
(default: "$BS_DIR")
+ -r recipe The recipe to be computed
-t tasks The tasks to be computed
(default: "$TASKS")
-s stats The stats to be matched. Options: TIME, IO, RUSAGE, CHILD_RUSAGE
}
# Parse and validate arguments
-while getopts "b:t:s:aHh" OPT; do
+while getopts "b:r:t:s:aHh" OPT; do
case $OPT in
b)
BS_DIR="$OPTARG"
;;
+ r)
+ RECIPE="$OPTARG"
+ ;;
t)
TASKS="$OPTARG"
;;
for task in ${TASKS}; do
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))"
times=""
for stat in ${stats}; do