summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server/process.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/server/process.py')
-rw-r--r--bitbake/lib/bb/server/process.py36
1 files changed, 2 insertions, 34 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index 4b35be62cd..2c5057bff1 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -80,9 +80,6 @@ class idleFinish():
80 self.msg = msg 80 self.msg = msg
81 81
82class ProcessServer(): 82class ProcessServer():
83 profile_filename = "profile.log"
84 profile_processed_filename = "profile.log.processed"
85
86 def __init__(self, lock, lockname, sock, sockname, server_timeout, xmlrpcinterface): 83 def __init__(self, lock, lockname, sock, sockname, server_timeout, xmlrpcinterface):
87 self.command_channel = False 84 self.command_channel = False
88 self.command_channel_reply = False 85 self.command_channel_reply = False
@@ -140,23 +137,7 @@ class ProcessServer():
140 serverlog("Error writing to lock file: %s" % str(e)) 137 serverlog("Error writing to lock file: %s" % str(e))
141 pass 138 pass
142 139
143 if self.cooker.configuration.profile: 140 return bb.utils.profile_function(self.cooker.configuration.profile, self.main, "profile-mainloop.log")
144 try:
145 import cProfile as profile
146 except:
147 import profile
148 prof = profile.Profile()
149
150 ret = profile.Profile.runcall(prof, self.main)
151
152 prof.dump_stats("profile.log")
153 bb.utils.process_profilelog("profile.log")
154 serverlog("Raw profiling information saved to profile.log and processed statistics to profile.log.processed")
155
156 else:
157 ret = self.main()
158
159 return ret
160 141
161 def _idle_check(self): 142 def _idle_check(self):
162 return len(self._idlefuns) == 0 and self.cooker.command.currentAsyncCommand is None 143 return len(self._idlefuns) == 0 and self.cooker.command.currentAsyncCommand is None
@@ -417,20 +398,7 @@ class ProcessServer():
417 serverlog("".join(msg)) 398 serverlog("".join(msg))
418 399
419 def idle_thread(self): 400 def idle_thread(self):
420 if self.cooker.configuration.profile: 401 bb.utils.profile_function(self.cooker.configuration.profile, self.idle_thread_internal, "profile-idleloop.log")
421 try:
422 import cProfile as profile
423 except:
424 import profile
425 prof = profile.Profile()
426
427 ret = profile.Profile.runcall(prof, self.idle_thread_internal)
428
429 prof.dump_stats("profile-mainloop.log")
430 bb.utils.process_profilelog("profile-mainloop.log")
431 serverlog("Raw profiling information saved to profile-mainloop.log and processed statistics to profile-mainloop.log.processed")
432 else:
433 self.idle_thread_internal()
434 402
435 def idle_thread_internal(self): 403 def idle_thread_internal(self):
436 def remove_idle_func(function): 404 def remove_idle_func(function):