Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lmp/build.sh: create bitbake_buildchart.svg with the buildstats collected data [V2] #296

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions lmp/bb-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,25 @@ if [ "$BUILD_SDK" == "1" ] && [ "${DISTRO}" != "lmp-mfgtool" ]; then
fi
bitbake -D ${BITBAKE_EXTRA_ARGS} ${IMAGE}

# write a summary of the buildstats to the terminal
BUILDSTATS_SUMMARY="../layers/openembedded-core/scripts/buildstats-summary"
if [ -f $BUILDSTATS_SUMMARY ]; then
# we need to check that because it is not available before kirkstone
if command -v bitbake-getvar >/dev/null 2>&1; then
# get buildstats path
BUILDSTATS_PATH="$(bitbake-getvar --value TMPDIR | tail -n 1)/buildstats"
if [ -d $BUILDSTATS_PATH ]; then
# get the most recent folder
BUILDSTATS_PATH="$(ls -td -- $BUILDSTATS_PATH/*/ | head -n 1)"
fi
# check if the buildstats was enabled
if [ -d "$BUILDSTATS_PATH" ]; then
# get the most recent folder
BUILDSTATS_PATH="$(ls -td -- $BUILDSTATS_PATH/*/ | head -n 1)"
# we need to check that because it can't be available in old containers
if command -v xvfb-run >/dev/null 2>&1 ; then
# producing bootchart.svg
run xvfb-run ../layers/openembedded-core/scripts/pybootchartgui/pybootchartgui.py \
--minutes --format=svg --output=${archive}/bitbake_buildchart $BUILDSTATS_PATH
fi
# write a summary of the buildstats to the terminal
BUILDSTATS_SUMMARY="../layers/openembedded-core/scripts/buildstats-summary"
# we need to check that because it is only available in the kirkstone branch
if [ -f $BUILDSTATS_SUMMARY ]; then
# common arguments with bold disabled
BUILDSTATS_SUMMARY="$BUILDSTATS_SUMMARY --sort duration --highlight 0"
# log all task
Expand Down
2 changes: 2 additions & 0 deletions lmp/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ chown -R builder .

su builder -c $HERE/bb-config.sh
touch ${archive}/customize-target.log && chown builder ${archive}/customize-target.log
touch ${archive}/bitbake_buildchart.svg && chown builder ${archive}/bitbake_buildchart.svg
touch ${archive}/bitbake_debug.log ${archive}/bitbake_warning.log ${archive}/bitbake_buildstats.log && chown builder ${archive}/bitbake_*.log
touch ${archive}/bitbake_global_env.txt ${archive}/bitbake_image_env.txt && chown builder ${archive}/bitbake_*_env.txt
touch ${archive}/app-preload.log && chown builder ${archive}/app-preload.log
Expand Down Expand Up @@ -134,6 +135,7 @@ if [ -d "${archive}" ] ; then
mv ${archive}/bitbake_debug.log.gz ${archive}/other/
mv ${archive}/bitbake_warning.log ${archive}/other/
mv ${archive}/bitbake_buildstats.log ${archive}/other/
mv ${archive}/bitbake_buildchart.svg ${archive}/other/

# Compress and publish source tarball (for *GPL* packages)
if [ -d ${DEPLOY_DIR_IMAGE}/source-release ]; then
Expand Down
Loading