diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-24 11:45:36 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-06-06 06:53:49 -0700 |
commit | bb93b6d1fbe2565d54ca202d840e877fa3563943 (patch) | |
tree | ac27695f106381d884b4d9fe30bcbf7138ec2d38 /bitbake/lib/bb/runqueue.py | |
parent | ae6cebca5bac9521230c69fed23b375d0de7f5f6 (diff) | |
download | poky-bb93b6d1fbe2565d54ca202d840e877fa3563943.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: 9ee503c79936b13f1d45f9e43211f77a528cdbfa)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index bc7e18175d..beec1e0465 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() |
@@ -2556,6 +2567,9 @@ class RunQueueExecute: | |||
2556 | elif self.rqdata.runtaskentries[p].depends.isdisjoint(total): | 2567 | elif self.rqdata.runtaskentries[p].depends.isdisjoint(total): |
2557 | next.add(p) | 2568 | next.add(p) |
2558 | 2569 | ||
2570 | starttime = time.time() | ||
2571 | lasttime = starttime | ||
2572 | |||
2559 | # When an item doesn't have dependencies in total, we can process it. Drop items from total when handled | 2573 | # When an item doesn't have dependencies in total, we can process it. Drop items from total when handled |
2560 | while next: | 2574 | while next: |
2561 | current = next.copy() | 2575 | current = next.copy() |
@@ -2588,6 +2602,14 @@ class RunQueueExecute: | |||
2588 | total.remove(tid) | 2602 | total.remove(tid) |
2589 | next.intersection_update(total) | 2603 | next.intersection_update(total) |
2590 | 2604 | ||
2605 | if time.time() > (lasttime + 30): | ||
2606 | lasttime = time.time() | ||
2607 | hashequiv_logger.verbose("Rehash loop slow progress: %s in %s" % (len(total), lasttime - starttime)) | ||
2608 | |||
2609 | endtime = time.time() | ||
2610 | if (endtime-starttime > 60): | ||
2611 | hashequiv_logger.verbose("Rehash loop took more than 60s: %s" % (endtime-starttime)) | ||
2612 | |||
2591 | if changed: | 2613 | if changed: |
2592 | for mc in self.rq.worker: | 2614 | for mc in self.rq.worker: |
2593 | RunQueue.send_pickled_data(self.rq.worker[mc].process, bb.parse.siggen.get_taskhashes(), "newtaskhashes") | 2615 | RunQueue.send_pickled_data(self.rq.worker[mc].process, bb.parse.siggen.get_taskhashes(), "newtaskhashes") |