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/bb/server/process.py | |
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/bb/server/process.py')
-rw-r--r-- | bitbake/lib/bb/server/process.py | 8 |
1 files changed, 5 insertions, 3 deletions
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") |