autotest: output timing in flamegraph format
Change-Id: I9f571ce635431613fc6a84e106e5052cce2dbf54 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
ae482f07c1
commit
84b8f0cc8b
21
autobuild.sh
21
autobuild.sh
@ -2,16 +2,20 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
src=$(readlink -f $(dirname $0))
|
rootdir=$(readlink -f $(dirname $0))
|
||||||
source "$src/scripts/autotest_common.sh"
|
source "$rootdir/scripts/autotest_common.sh"
|
||||||
|
|
||||||
out=$PWD
|
out=$PWD
|
||||||
|
|
||||||
umask 022
|
umask 022
|
||||||
|
|
||||||
cd $src
|
cd $rootdir
|
||||||
|
|
||||||
|
timing_enter autobuild
|
||||||
|
|
||||||
|
timing_enter check_format
|
||||||
./scripts/check_format.sh
|
./scripts/check_format.sh
|
||||||
|
timing_exit check_format
|
||||||
|
|
||||||
scanbuild=''
|
scanbuild=''
|
||||||
if hash scan-build; then
|
if hash scan-build; then
|
||||||
@ -19,8 +23,11 @@ if hash scan-build; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
$MAKE $MAKEFLAGS clean
|
$MAKE $MAKEFLAGS clean
|
||||||
|
|
||||||
|
timing_enter scanbuild_make
|
||||||
fail=0
|
fail=0
|
||||||
time $scanbuild $MAKE $MAKEFLAGS DPDK_DIR=$DPDK_DIR || fail=1
|
time $scanbuild $MAKE $MAKEFLAGS DPDK_DIR=$DPDK_DIR || fail=1
|
||||||
|
timing_exit scanbuild_make
|
||||||
|
|
||||||
# Check that header file dependencies are working correctly by
|
# Check that header file dependencies are working correctly by
|
||||||
# capturing a binary's stat data before and after touching a
|
# capturing a binary's stat data before and after touching a
|
||||||
@ -41,14 +48,18 @@ if [ -d $out/scan-build-tmp ]; then
|
|||||||
chmod -R a+rX $out/scan-build
|
chmod -R a+rX $out/scan-build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
timing_enter doxygen
|
||||||
if hash doxygen; then
|
if hash doxygen; then
|
||||||
(cd "$src"/doc; $MAKE $MAKEFLAGS)
|
(cd "$rootdir"/doc; $MAKE $MAKEFLAGS)
|
||||||
mkdir -p "$out"/doc
|
mkdir -p "$out"/doc
|
||||||
for d in "$src"/doc/output.*; do
|
for d in "$rootdir"/doc/output.*; do
|
||||||
component=$(basename "$d" | sed -e 's/^output.//')
|
component=$(basename "$d" | sed -e 's/^output.//')
|
||||||
mv "$d"/html "$out"/doc/$component
|
mv "$d"/html "$out"/doc/$component
|
||||||
rm -rf "$d"
|
rm -rf "$d"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
timing_exit doxygen
|
||||||
|
|
||||||
|
timing_exit autobuild
|
||||||
|
|
||||||
exit $fail
|
exit $fail
|
||||||
|
@ -2,13 +2,15 @@
|
|||||||
|
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
src=$(readlink -f $(dirname $0))
|
rootdir=$(readlink -f $(dirname $0))
|
||||||
source "$src/scripts/autotest_common.sh"
|
source "$rootdir/scripts/autotest_common.sh"
|
||||||
|
|
||||||
out=$PWD
|
out=$PWD
|
||||||
|
|
||||||
MAKEFLAGS=${MAKEFLAGS:--j16}
|
MAKEFLAGS=${MAKEFLAGS:--j16}
|
||||||
cd $src
|
cd $rootdir
|
||||||
|
|
||||||
|
timing_enter autopackage
|
||||||
|
|
||||||
$MAKE clean
|
$MAKE clean
|
||||||
|
|
||||||
@ -39,3 +41,7 @@ tar -C "$tmpdir" -xf $out/$tarball
|
|||||||
time $MAKE ${MAKEFLAGS} DPDK_DIR=$DPDK_DIR
|
time $MAKE ${MAKEFLAGS} DPDK_DIR=$DPDK_DIR
|
||||||
)
|
)
|
||||||
rm -rf "$tmpdir"
|
rm -rf "$tmpdir"
|
||||||
|
|
||||||
|
timing_exit autopackage
|
||||||
|
|
||||||
|
timing_finish
|
||||||
|
@ -38,16 +38,18 @@ function timing() {
|
|||||||
now=$(date +%s)
|
now=$(date +%s)
|
||||||
|
|
||||||
if [ "$direction" = "enter" ]; then
|
if [ "$direction" = "enter" ]; then
|
||||||
export timing_stack="${timing_stack}/${now}"
|
export timing_stack="${timing_stack};${now}"
|
||||||
export test_stack="${test_stack}/${testname}"
|
export test_stack="${test_stack};${testname}"
|
||||||
else
|
else
|
||||||
start_time=$(echo "$timing_stack" | sed -e 's@^.*/@@')
|
child_time=$(grep "^${test_stack:1};" $output_dir/timing.txt | awk '{s+=$2} END {print s}')
|
||||||
timing_stack=$(echo "$timing_stack" | sed -e 's@/[^/]*$@@')
|
|
||||||
|
|
||||||
elapsed=$((now - start_time))
|
start_time=$(echo "$timing_stack" | sed -e 's@^.*;@@')
|
||||||
echo "$elapsed $test_stack" >> $output_dir/timing.txt
|
timing_stack=$(echo "$timing_stack" | sed -e 's@;[^;]*$@@')
|
||||||
|
|
||||||
test_stack=$(echo "$test_stack" | sed -e 's@/[^/]*$@@')
|
elapsed=$((now - start_time - child_time))
|
||||||
|
echo "${test_stack:1} $elapsed" >> $output_dir/timing.txt
|
||||||
|
|
||||||
|
test_stack=$(echo "$test_stack" | sed -e 's@;[^;]*$@@')
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +61,18 @@ function timing_exit() {
|
|||||||
timing "exit" "$1"
|
timing "exit" "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function timing_finish() {
|
||||||
|
flamegraph='/usr/local/FlameGraph/flamegraph.pl'
|
||||||
|
if [ -x "$flamegraph" ]; then
|
||||||
|
"$flamegraph" \
|
||||||
|
--title 'Build Timing' \
|
||||||
|
--nametype 'Step:' \
|
||||||
|
--countname seconds \
|
||||||
|
$output_dir/timing.txt \
|
||||||
|
>$output_dir/timing.svg
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function process_core() {
|
function process_core() {
|
||||||
ret=0
|
ret=0
|
||||||
for core in $(find . -type f -name 'core*'); do
|
for core in $(find . -type f -name 'core*'); do
|
||||||
|
@ -4,5 +4,11 @@ testdir=$(readlink -f $(dirname $0))
|
|||||||
rootdir="$testdir/../../.."
|
rootdir="$testdir/../../.."
|
||||||
source $rootdir/scripts/autotest_common.sh
|
source $rootdir/scripts/autotest_common.sh
|
||||||
|
|
||||||
|
timing_enter memory
|
||||||
|
|
||||||
|
timing_enter vtophys
|
||||||
$testdir/vtophys
|
$testdir/vtophys
|
||||||
process_core
|
process_core
|
||||||
|
timing_exit vtophys
|
||||||
|
|
||||||
|
timing_exit memory
|
||||||
|
@ -4,17 +4,29 @@ testdir=$(readlink -f $(dirname $0))
|
|||||||
rootdir="$testdir/../../.."
|
rootdir="$testdir/../../.."
|
||||||
source $rootdir/scripts/autotest_common.sh
|
source $rootdir/scripts/autotest_common.sh
|
||||||
|
|
||||||
|
timing_enter nvme
|
||||||
|
|
||||||
|
timing_enter unit
|
||||||
$valgrind $testdir/unit/nvme_ns_cmd_c/nvme_ns_cmd_ut
|
$valgrind $testdir/unit/nvme_ns_cmd_c/nvme_ns_cmd_ut
|
||||||
$testdir/unit/nvme_c/nvme_ut
|
$testdir/unit/nvme_c/nvme_ut
|
||||||
$valgrind $testdir/unit/nvme_qpair_c/nvme_qpair_ut
|
$valgrind $testdir/unit/nvme_qpair_c/nvme_qpair_ut
|
||||||
$valgrind $testdir/unit/nvme_ctrlr_c/nvme_ctrlr_ut
|
$valgrind $testdir/unit/nvme_ctrlr_c/nvme_ctrlr_ut
|
||||||
$valgrind $testdir/unit/nvme_ctrlr_cmd_c/nvme_ctrlr_cmd_ut
|
$valgrind $testdir/unit/nvme_ctrlr_cmd_c/nvme_ctrlr_cmd_ut
|
||||||
|
timing_exit unit
|
||||||
|
|
||||||
|
timing_enter aer
|
||||||
$testdir/aer/aer
|
$testdir/aer/aer
|
||||||
process_core
|
process_core
|
||||||
|
timing_exit aer
|
||||||
|
|
||||||
|
timing_enter identify
|
||||||
$rootdir/examples/nvme/identify/identify
|
$rootdir/examples/nvme/identify/identify
|
||||||
process_core
|
process_core
|
||||||
|
timing_exit identify
|
||||||
|
|
||||||
|
timing_enter perf
|
||||||
$rootdir/examples/nvme/perf/perf -q 128 -w read -s 4096 -t 5
|
$rootdir/examples/nvme/perf/perf -q 128 -w read -s 4096 -t 5
|
||||||
process_core
|
process_core
|
||||||
|
timing_exit perf
|
||||||
|
|
||||||
|
timing_exit nvme
|
||||||
|
Loading…
Reference in New Issue
Block a user