TipsAndTricks/InvestigatingBuildTime: Difference between revisions
No edit summary |
No edit summary |
||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Investigating Build Time == | == Draft: Investigating Build Time == | ||
(Placeholder. | (Placeholder. Demonstrate use of buildstats and pybootchartgui) | ||
The <tt>buildstats</tt> data | '''Current status''': The intention is to use the scripts under scripts/contrib/bb-perf to parse | ||
provides '''process statistics''' for every task. This data can offer insight of the time spent by the builder (<tt>bitbake</tt>) when | buildstat data and produce useful plots. | ||
The <tt>buildstats</tt> data produced by the class with the same name provides '''process statistics''' for every recipe task. | |||
This data can offer insight of the time spent by the builder (<tt>bitbake</tt>) when | |||
constructing a particular target at process level. This article focus more on profiling than optimization, the former being | constructing a particular target at process level. This article focus more on profiling than optimization, the former being | ||
the base for the latter. | the base for the latter. | ||
Line 14: | Line 18: | ||
$ . oe-init-build-env | $ . oe-init-build-env | ||
$ bitbake world | $ bitbake world | ||
=== Buildstats === | === Buildstats === | ||
buildstats.bbclass stores mainly two set of process' stats: time and IO stats. For the moment, we are currently focusing on the following | |||
time data: | |||
* /proc/[pid]/stat: utime, stime | * /proc/[pid]/stat: utime, stime | ||
Line 30: | Line 29: | ||
* python resource module: Child rusage ru_utime, Child rusage ru_stime | * python resource module: Child rusage ru_utime, Child rusage ru_stime | ||
and the | and the IO stats: | ||
* /proc/[pid]/io: IO rchar, IO wchar | * /proc/[pid]/io: IO rchar, IO wchar | ||
* /proc/[pid]/io: IO read_bytes, IO write_bytes | * /proc/[pid]/io: IO read_bytes, IO write_bytes | ||
With this | With this data, the following script (once the <code>bitbake world</code> command has finished) is used | ||
to plot the top N stat | to either plot the top N recipes-task stat values | ||
$ ../scripts/contrib/bb-perf/buildstats-plot.sh -s <BUILDSTATS> - | $ ../scripts/contrib/bb-perf/buildstats-plot.sh -s <BUILDSTATS> -n $N | gnuplot -p | ||
or sum stats values per task for all (world) recipes | |||
$ ../scripts/contrib/bb-perf/buildstats-plot.sh -s <BUILDSTATS> -S | gnuplot -p | $ ../scripts/contrib/bb-perf/buildstats-plot.sh -s <BUILDSTATS> -S | gnuplot -p | ||
The former produces a more granular plot and second a more general idea where the type is spent per task set. | |||
=== Results === | === Results === | ||
Preliminar results can be found [[MortyBuildstats|here]] | |||
Latest revision as of 21:12, 28 February 2017
Draft: Investigating Build Time
(Placeholder. Demonstrate use of buildstats and pybootchartgui)
Current status: The intention is to use the scripts under scripts/contrib/bb-perf to parse buildstat data and produce useful plots.
The buildstats data produced by the class with the same name provides process statistics for every recipe task.
This data can offer insight of the time spent by the builder (bitbake) when
constructing a particular target at process level. This article focus more on profiling than optimization, the former being
the base for the latter.
Setup
$ cd poky $ git checkout -b morty origin/morty $ . oe-init-build-env $ bitbake world
Buildstats
buildstats.bbclass stores mainly two set of process' stats: time and IO stats. For the moment, we are currently focusing on the following time data:
- /proc/[pid]/stat: utime, stime
- /proc/[pid]/stat: cutime, cstime
- python resource module: rusage ru_utime, rusage ru_stime
- python resource module: Child rusage ru_utime, Child rusage ru_stime
and the IO stats:
- /proc/[pid]/io: IO rchar, IO wchar
- /proc/[pid]/io: IO read_bytes, IO write_bytes
With this data, the following script (once the bitbake world
command has finished) is used
to either plot the top N recipes-task stat values
$ ../scripts/contrib/bb-perf/buildstats-plot.sh -s <BUILDSTATS> -n $N | gnuplot -p
or sum stats values per task for all (world) recipes
$ ../scripts/contrib/bb-perf/buildstats-plot.sh -s <BUILDSTATS> -S | gnuplot -p
The former produces a more granular plot and second a more general idea where the type is spent per task set.
Results
Preliminar results can be found here