summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/runqueue.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-24 11:45:36 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-28 23:46:21 +0100
commit2824b5e6679a2d773164a302b2fe637de1c0908b (patch)
tree98ee8c9d50f9e7284991ab32c11118e61821b6c5 /bitbake/lib/bb/runqueue.py
parentc7a5673e2da5307beb3ec9c39d3141d500d98754 (diff)
downloadpoky-2824b5e6679a2d773164a302b2fe637de1c0908b.tar.gz
bitbake: runqueue: Add timing warnings around slow loops
With hashserve enabled, there are two slow paths/loops, one at initial runqueue generation and also during the rehash process when new outhashes are found. Add timing information at the hashserve log level for when these loops take longer than 30s or 60s overall. This will leave evidence in the logs when things are running particularly slowly. (Bitbake rev: 6c357ede08e0b2a93bdaad2c1d631994faf2b784) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r--bitbake/lib/bb/runqueue.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 6b43f303d5..83e5273449 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1273,6 +1273,9 @@ class RunQueueData:
1273 1273
1274 bb.parse.siggen.set_setscene_tasks(self.runq_setscene_tids) 1274 bb.parse.siggen.set_setscene_tasks(self.runq_setscene_tids)
1275 1275
1276 starttime = time.time()
1277 lasttime = starttime
1278
1276 # Iterate over the task list and call into the siggen code 1279 # Iterate over the task list and call into the siggen code
1277 dealtwith = set() 1280 dealtwith = set()
1278 todeal = set(self.runtaskentries) 1281 todeal = set(self.runtaskentries)
@@ -1284,6 +1287,14 @@ class RunQueueData:
1284 self.prepare_task_hash(tid) 1287 self.prepare_task_hash(tid)
1285 bb.event.check_for_interrupts(self.cooker.data) 1288 bb.event.check_for_interrupts(self.cooker.data)
1286 1289
1290 if time.time() > (lasttime + 30):
1291 lasttime = time.time()
1292 hashequiv_logger.verbose("Initial setup loop progress: %s of %s in %s" % (len(todeal), len(self.runtaskentries), lasttime - starttime))
1293
1294 endtime = time.time()
1295 if (endtime-starttime > 60):
1296 hashequiv_logger.verbose("Initial setup loop took: %s" % (endtime-starttime))
1297
1287 bb.parse.siggen.writeout_file_checksum_cache() 1298 bb.parse.siggen.writeout_file_checksum_cache()
1288 1299
1289 #self.dump_data() 1300 #self.dump_data()
@@ -2557,6 +2568,9 @@ class RunQueueExecute:
2557 elif self.rqdata.runtaskentries[p].depends.isdisjoint(total): 2568 elif self.rqdata.runtaskentries[p].depends.isdisjoint(total):
2558 next.add(p) 2569 next.add(p)
2559 2570
2571 starttime = time.time()
2572 lasttime = starttime
2573
2560 # When an item doesn't have dependencies in total, we can process it. Drop items from total when handled 2574 # When an item doesn't have dependencies in total, we can process it. Drop items from total when handled
2561 while next: 2575 while next:
2562 current = next.copy() 2576 current = next.copy()
@@ -2589,6 +2603,14 @@ class RunQueueExecute:
2589 total.remove(tid) 2603 total.remove(tid)
2590 next.intersection_update(total) 2604 next.intersection_update(total)
2591 2605
2606 if time.time() > (lasttime + 30):
2607 lasttime = time.time()
2608 hashequiv_logger.verbose("Rehash loop slow progress: %s in %s" % (len(total), lasttime - starttime))
2609
2610 endtime = time.time()
2611 if (endtime-starttime > 60):
2612 hashequiv_logger.verbose("Rehash loop took more than 60s: %s" % (endtime-starttime))
2613
2592 if changed: 2614 if changed:
2593 for mc in self.rq.worker: 2615 for mc in self.rq.worker:
2594 RunQueue.send_pickled_data(self.rq.worker[mc].process, bb.parse.siggen.get_taskhashes(), "newtaskhashes") 2616 RunQueue.send_pickled_data(self.rq.worker[mc].process, bb.parse.siggen.get_taskhashes(), "newtaskhashes")