diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-17 15:19:48 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-20 08:31:28 +0000 |
commit | 16bc168084cc7b9a092385dfb02d5efc012bed5b (patch) | |
tree | abd75154e3670b7536b7e7103854bbfbeb01e511 /bitbake/lib | |
parent | 82b5cdad0f8f5a511545b613410895e1a93840a1 (diff) | |
download | poky-16bc168084cc7b9a092385dfb02d5efc012bed5b.tar.gz |
bitbake: server: Ensure cooker profiling works
The previous cleanups meant that when the cooker was started, profiling
was always disabled as configuration was sent to the server later and this
was too late to profile the main loop.
Pass the "profile" option over the server commandline so that we can
profile cooker itself again, the setting can now take effect early enough.
(Bitbake rev: c97c1f1c127ef3f8fbbd1b4e187ab58bfb0a73e5)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rwxr-xr-x | bitbake/lib/bb/main.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/server/process.py | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py index 93eda3632e..f56c3d46a2 100755 --- a/bitbake/lib/bb/main.py +++ b/bitbake/lib/bb/main.py | |||
@@ -429,7 +429,7 @@ def setup_bitbake(configParams, extrafeatures=None): | |||
429 | logger.info("Starting bitbake server...") | 429 | logger.info("Starting bitbake server...") |
430 | # Clear the event queue since we already displayed messages | 430 | # Clear the event queue since we already displayed messages |
431 | bb.event.ui_queue = [] | 431 | bb.event.ui_queue = [] |
432 | server = bb.server.process.BitBakeServer(lock, sockname, featureset, configParams.server_timeout, configParams.xmlrpcinterface) | 432 | server = bb.server.process.BitBakeServer(lock, sockname, featureset, configParams.server_timeout, configParams.xmlrpcinterface, configParams.profile) |
433 | 433 | ||
434 | else: | 434 | else: |
435 | logger.info("Reconnecting to bitbake server...") | 435 | logger.info("Reconnecting to bitbake server...") |
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index 5d02c0b9f5..afd77ac0a5 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
@@ -448,13 +448,14 @@ start_log_datetime_format = '%Y-%m-%d %H:%M:%S.%f' | |||
448 | 448 | ||
449 | class BitBakeServer(object): | 449 | class BitBakeServer(object): |
450 | 450 | ||
451 | def __init__(self, lock, sockname, featureset, server_timeout, xmlrpcinterface): | 451 | def __init__(self, lock, sockname, featureset, server_timeout, xmlrpcinterface, profile): |
452 | 452 | ||
453 | self.server_timeout = server_timeout | 453 | self.server_timeout = server_timeout |
454 | self.xmlrpcinterface = xmlrpcinterface | 454 | self.xmlrpcinterface = xmlrpcinterface |
455 | self.featureset = featureset | 455 | self.featureset = featureset |
456 | self.sockname = sockname | 456 | self.sockname = sockname |
457 | self.bitbake_lock = lock | 457 | self.bitbake_lock = lock |
458 | self.profile = profile | ||
458 | self.readypipe, self.readypipein = os.pipe() | 459 | self.readypipe, self.readypipein = os.pipe() |
459 | 460 | ||
460 | # Place the log in the builddirectory alongside the lock file | 461 | # Place the log in the builddirectory alongside the lock file |
@@ -518,9 +519,9 @@ class BitBakeServer(object): | |||
518 | os.set_inheritable(self.bitbake_lock.fileno(), True) | 519 | os.set_inheritable(self.bitbake_lock.fileno(), True) |
519 | os.set_inheritable(self.readypipein, True) | 520 | os.set_inheritable(self.readypipein, True) |
520 | serverscript = os.path.realpath(os.path.dirname(__file__) + "/../../../bin/bitbake-server") | 521 | serverscript = os.path.realpath(os.path.dirname(__file__) + "/../../../bin/bitbake-server") |
521 | os.execl(sys.executable, "bitbake-server", serverscript, "decafbad", str(self.bitbake_lock.fileno()), str(self.readypipein), self.logfile, self.bitbake_lock.name, self.sockname, str(self.server_timeout or 0), str(self.xmlrpcinterface[0]), str(self.xmlrpcinterface[1])) | 522 | os.execl(sys.executable, "bitbake-server", serverscript, "decafbad", str(self.bitbake_lock.fileno()), str(self.readypipein), self.logfile, self.bitbake_lock.name, self.sockname, str(self.server_timeout or 0), str(int(self.profile)), str(self.xmlrpcinterface[0]), str(self.xmlrpcinterface[1])) |
522 | 523 | ||
523 | def execServer(lockfd, readypipeinfd, lockname, sockname, server_timeout, xmlrpcinterface): | 524 | def execServer(lockfd, readypipeinfd, lockname, sockname, server_timeout, xmlrpcinterface, profile): |
524 | 525 | ||
525 | import bb.cookerdata | 526 | import bb.cookerdata |
526 | import bb.cooker | 527 | import bb.cooker |
@@ -549,6 +550,7 @@ def execServer(lockfd, readypipeinfd, lockname, sockname, server_timeout, xmlrpc | |||
549 | try: | 550 | try: |
550 | featureset = [] | 551 | featureset = [] |
551 | cooker = bb.cooker.BBCooker(featureset, server.register_idle_function) | 552 | cooker = bb.cooker.BBCooker(featureset, server.register_idle_function) |
553 | cooker.configuration.profile = profile | ||
552 | except bb.BBHandledException: | 554 | except bb.BBHandledException: |
553 | return None | 555 | return None |
554 | writer.send("r") | 556 | writer.send("r") |