summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-13 23:45:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-14 17:28:23 +0100
commitde06716c76702e63bc807fa4d43fe3118611c872 (patch)
treeec8b49ef736709131ef6e15c77f31821e204989c /bitbake/lib/bb
parentd842d2507a7f74f2a4a711d293006b4ee03b10af (diff)
downloadpoky-de06716c76702e63bc807fa4d43fe3118611c872.tar.gz
bitbake: runqueue: Improve scenequeue debugging
Whilst we had good runqueue failure mode debug, it hadn't adapted to the scenequeue changes. Run the scenequeue sanity tests at the end of a build and output the results regardless of whether all setscene tasks completed or not. This *massively* improves the ability to debug runqueue problems. (Bitbake rev: b9b2177473c0b95a23bd519a201e1d2ba101c6c1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/runqueue.py61
1 files changed, 42 insertions, 19 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 3bcbaee12a..a1e3285821 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1746,9 +1746,9 @@ class RunQueueExecute:
1746 bb.fatal("Invalid scheduler '%s'. Available schedulers: %s" % 1746 bb.fatal("Invalid scheduler '%s'. Available schedulers: %s" %
1747 (self.scheduler, ", ".join(obj.name for obj in schedulers))) 1747 (self.scheduler, ", ".join(obj.name for obj in schedulers)))
1748 1748
1749 if len(self.rqdata.runq_setscene_tids) > 0: 1749 #if len(self.rqdata.runq_setscene_tids) > 0:
1750 self.sqdata = SQData() 1750 self.sqdata = SQData()
1751 build_scenequeue_data(self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self) 1751 build_scenequeue_data(self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self)
1752 1752
1753 def runqueue_process_waitpid(self, task, status): 1753 def runqueue_process_waitpid(self, task, status):
1754 1754
@@ -1901,6 +1901,35 @@ class RunQueueExecute:
1901 self.stats.taskSkipped() 1901 self.stats.taskSkipped()
1902 self.stats.taskCompleted() 1902 self.stats.taskCompleted()
1903 1903
1904 def summarise_scenequeue_errors(self):
1905 err = False
1906 if not self.sqdone:
1907 logger.debug(1, 'We could skip tasks %s', "\n".join(sorted(self.scenequeue_covered)))
1908 completeevent = sceneQueueComplete(self.sq_stats, self.rq)
1909 bb.event.fire(completeevent, self.cfgData)
1910 if self.sq_deferred:
1911 logger.error("Scenequeue had deferred entries: %s" % pprint.pformat(self.sq_deferred))
1912 err = True
1913 if self.changed_setscene:
1914 logger.error("Scenequeue had unprocessed changed entries: %s" % pprint.pformat(self.changed_setscene))
1915 err = True
1916 if self.holdoff_tasks:
1917 logger.error("Scenequeue had holdoff tasks: %s" % pprint.pformat(self.holdoff_tasks))
1918 err = True
1919
1920 for x in self.rqdata.runtaskentries:
1921 if x not in self.tasks_covered and x not in self.tasks_notcovered:
1922 logger.error("Task %s was never moved from the setscene queue" % x)
1923 err = True
1924 if x not in self.tasks_scenequeue_done:
1925 logger.error("Task %s was never processed by the setscene code" % x)
1926 err = True
1927 if len(self.rqdata.runtaskentries[x].depends) == 0 and x not in self.runq_buildable:
1928 logger.error("Task %s was never marked as buildable by the setscene code" % x)
1929 err = True
1930 return err
1931
1932
1904 def execute(self): 1933 def execute(self):
1905 """ 1934 """
1906 Run the tasks in a queue prepared by prepare_runqueue 1935 Run the tasks in a queue prepared by prepare_runqueue
@@ -1996,22 +2025,8 @@ class RunQueueExecute:
1996 2025
1997 if not self.sq_live and not self.sqdone and not self.sq_deferred and not self.changed_setscene and not self.holdoff_tasks: 2026 if not self.sq_live and not self.sqdone and not self.sq_deferred and not self.changed_setscene and not self.holdoff_tasks:
1998 logger.info("Setscene tasks completed") 2027 logger.info("Setscene tasks completed")
1999 logger.debug(1, 'We could skip tasks %s', "\n".join(sorted(self.scenequeue_covered)))
2000 2028
2001 completeevent = sceneQueueComplete(self.sq_stats, self.rq) 2029 err = self.summarise_scenequeue_errors()
2002 bb.event.fire(completeevent, self.cfgData)
2003
2004 err = False
2005 for x in self.rqdata.runtaskentries:
2006 if x not in self.tasks_covered and x not in self.tasks_notcovered:
2007 logger.error("Task %s was never moved from the setscene queue" % x)
2008 err = True
2009 if x not in self.tasks_scenequeue_done:
2010 logger.error("Task %s was never processed by the setscene code" % x)
2011 err = True
2012 if len(self.rqdata.runtaskentries[x].depends) == 0 and x not in self.runq_buildable:
2013 logger.error("Task %s was never marked as buildable by the setscene code" % x)
2014 err = True
2015 if err: 2030 if err:
2016 self.rq.state = runQueueFailed 2031 self.rq.state = runQueueFailed
2017 return True 2032 return True
@@ -2107,14 +2122,22 @@ class RunQueueExecute:
2107 return True 2122 return True
2108 2123
2109 # Sanity Checks 2124 # Sanity Checks
2125 err = self.summarise_scenequeue_errors()
2110 for task in self.rqdata.runtaskentries: 2126 for task in self.rqdata.runtaskentries:
2111 if task not in self.runq_buildable: 2127 if task not in self.runq_buildable:
2112 logger.error("Task %s never buildable!", task) 2128 logger.error("Task %s never buildable!", task)
2129 err = True
2113 elif task not in self.runq_running: 2130 elif task not in self.runq_running:
2114 logger.error("Task %s never ran!", task) 2131 logger.error("Task %s never ran!", task)
2132 err = True
2115 elif task not in self.runq_complete: 2133 elif task not in self.runq_complete:
2116 logger.error("Task %s never completed!", task) 2134 logger.error("Task %s never completed!", task)
2117 self.rq.state = runQueueComplete 2135 err = True
2136
2137 if err:
2138 self.rq.state = runQueueFailed
2139 else:
2140 self.rq.state = runQueueComplete
2118 2141
2119 return True 2142 return True
2120 2143