<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.yoctoproject.org/wiki/index.php?action=history&amp;feed=atom&amp;title=TipsAndTricks%2FParsingProfiling</id>
	<title>TipsAndTricks/ParsingProfiling - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yoctoproject.org/wiki/index.php?action=history&amp;feed=atom&amp;title=TipsAndTricks%2FParsingProfiling"/>
	<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/ParsingProfiling&amp;action=history"/>
	<updated>2026-06-10T18:20:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/ParsingProfiling&amp;diff=19217&amp;oldid=prev</id>
		<title>Rpurdie: Created page with &quot;Ever wondered what bitbake does when parsing?  If you&#039;ve ever wondered where bitbake spends its time during parsing, its now quite easy to find out!  Start with a clean cache ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/ParsingProfiling&amp;diff=19217&amp;oldid=prev"/>
		<updated>2016-06-27T13:03:34Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Ever wondered what bitbake does when parsing?  If you&amp;#039;ve ever wondered where bitbake spends its time during parsing, its now quite easy to find out!  Start with a clean cache ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Ever wondered what bitbake does when parsing?&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;ve ever wondered where bitbake spends its time during parsing, its now quite easy to find out!&lt;br /&gt;
&lt;br /&gt;
Start with a clean cache by &amp;quot;rm tmp/cache -rf&amp;quot;. You can then trigger bitbake&amp;#039;s profiling mode with the &amp;quot;-P&amp;quot; option, so &amp;quot;bitbake -p -P&amp;quot;. Bitbake will parse the recipes, then print a message saying &amp;quot;Processed parsing statistics saved to profile-parse.log.processed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Internally, it enables profiling in each separate parsing thread, saving the data to files called profile-parse-Parser-1:X.log where X is the thread number. It then merges all the files together to form the processed output.&lt;br /&gt;
&lt;br /&gt;
There are four sections to profile-parse.log.processed, the first shows a list of functions, ordered by &amp;quot;internal time&amp;quot; which tells us which function consumed the most time. Underneath this is a callgraph section, which shows which functions called those functions. This is useful where you see a function called many times and want to know where it was called from.&lt;br /&gt;
&lt;br /&gt;
These two data items are then repeated but ordered by cumulative function time. This allows you to answer a different kind of question, where you&amp;#039;re interested to learn more about the critical path and which functions all the time is spent in.&lt;br /&gt;
&lt;br /&gt;
Interestingly, on my highly parallel machine I just tested this on, I see &amp;quot;389110629 function calls in 1334.486 seconds&amp;quot; and the top of the function time table reads:&lt;br /&gt;
&lt;br /&gt;
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)&lt;br /&gt;
     6415  450.867    0.070  450.867    0.070 {method &amp;#039;acquire&amp;#039; of &amp;#039;_multiprocessing.SemLock&amp;#039; objects}&lt;br /&gt;
  3403372   56.846    0.000  350.207    0.000 bitbake/lib/bb/data.py:332(build_dependencies)&lt;br /&gt;
&lt;br /&gt;
which suggests in machines with many cores, we start to need to look at optimising the parsing queue lock since we&amp;#039;re spending around a third of the overall time in there on this machine.&lt;/div&gt;</summary>
		<author><name>Rpurdie</name></author>
	</entry>
</feed>