I'm working in a project which has many bitbake recipes and takes a lot of time - up to 13 hours in some cases. I am new to bitbake and I'm asking for some way to:
or any suggestions for using any tools for better managing and understanding recipes.
Or any methods/ways for speeding up the build process in general.
Both suggestions and exact techniques are welcomed.
EDIT date 07/08/2013:
Found this useful tool for tracking dependencies
https://github.com/scottellis/oe-deptools
Description:
./oey.py -h
Usage: ./oey.py [options] [package]
Displays OE build dependencies for a given package or recipe.
Uses the pn-depends.dot file for its raw data.
Generate a pn-depends.dot file by running bitbake -g <recipe>.
Options:
-h Show this help message and exit
-v Show error messages such as recursive dependencies
-r Show reverse dependencies, i.e. packages dependent on package
-f Flat output instead of default tree output
-d <depth> Maximum depth to follow dependencies, default and max is 10
-s Show child package dependencies that are already listed
as direct parent dependencies.
Provide a package name from the generated pn-depends.dot file.
Run the program without a package name to get a list of
available package names.
This is a very broad question!
First, here is a summary on how to inspect your build performance and dependencies when using the openembedded/yocto project. This answers the first part of the question.
Use the buildstats with the pybootchartgui tool produce a build chart.
Details:
Set USER_CLASSES += "buildstats"
in your $BUILDIR/conf/local.conf
file. This will dump detailed performance data in
$BUILDDIR/tmp/buildstats/<DATE>
. Next use the pybootchartgui.py
script (in
poky/scripts/pybootchartgui
) to generate the chart. This will help you
localize possible bottlenecks in the build. Of course, if you have a
lot of recipes to bake, your chart will be huge. To remove some noise
use the -m MINTIME
command line option.
For example:
poky/scripts/pybootchartgui/pybootchartgui.py -m 600 $BUILDDIR/tmp/buildstats/201312310904
will only display tasks (do_compile, do_fetch, etc.) that take longer than 10 minutes (600 seconds) to run.
To explore the dependencies of a particular package use the depexp utility. For example, to explore the dependencies of eglibc use:
bitbake -g -u depexp eglibc
This will give a better understanding of what each recipe depends on at both run and compile time.
bitbake automatically detects circular dependencies and prints an error message when such a thing happens. The error message contains the name of the packages causing this circular dependency.
bitbake calculates dependencies automatically and won't build packages which aren't needed by your target. If you find some unwanted packages in your image and you wish to remove them:
bitbake -g -u depexp <TARGET>
to inspect how the package gets pulled inFinally, some tips on how to improve the overall build performance. This answers the second part of the question.
bitbake -g -u depexp <TARGET>
is your friend). Building less stuff takes less time.SSTATE_DIR
variable in your local.conf
.BB_NUMBER_THREADS
and PARALLEL_MAKE
variables in your local.conf
to match your
machine's resources. These variables control how many tasks are run
in parallel and how many processes 'make' should run in parallel (-j
option) respectively.noatime,barrier=0,commit=6000
. WARNING: This makes your
hdd unreliable in case of power losses. Do not store anything of
value on this hdd.-dev
and/or -dbg
packages increases the
do_rootfs task time considerably. Make sure you enable them (see
EXTRA_IMAGE_FEATURES
in your local.conf
) only when needed.References: