diff options
| -rw-r--r-- | bitbake/lib/bb/server/process.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index 6d77ce4786..1ca8e02ba0 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
| @@ -402,6 +402,22 @@ class ProcessServer(): | |||
| 402 | serverlog("".join(msg)) | 402 | serverlog("".join(msg)) |
| 403 | 403 | ||
| 404 | def idle_thread(self): | 404 | def idle_thread(self): |
| 405 | if self.cooker.configuration.profile: | ||
| 406 | try: | ||
| 407 | import cProfile as profile | ||
| 408 | except: | ||
| 409 | import profile | ||
| 410 | prof = profile.Profile() | ||
| 411 | |||
| 412 | ret = profile.Profile.runcall(prof, self.idle_thread_internal) | ||
| 413 | |||
| 414 | prof.dump_stats("profile-mainloop.log") | ||
| 415 | bb.utils.process_profilelog("profile-mainloop.log") | ||
| 416 | serverlog("Raw profiling information saved to profilemainloop.log and processed statistics to profilemainloop.log.processed") | ||
| 417 | else: | ||
| 418 | self.idle_thread_internal() | ||
| 419 | |||
| 420 | def idle_thread_internal(self): | ||
| 405 | def remove_idle_func(function): | 421 | def remove_idle_func(function): |
| 406 | with bb.utils.lock_timeout(self._idlefuncsLock): | 422 | with bb.utils.lock_timeout(self._idlefuncsLock): |
| 407 | del self._idlefuns[function] | 423 | del self._idlefuns[function] |
