From: Chris Larson Date: Wed, 16 Feb 2011 00:07:00 +0000 (-0700) Subject: server: clean up call of write_profile_stats X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd43144f0fe8487bb4dc8a7bd7be7a9ac071ecdd;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git server: clean up call of write_profile_stats Signed-off-by: Chris Larson --- diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py index 51a99182b26..26f72b02663 100644 --- a/lib/bb/server/process.py +++ b/lib/bb/server/process.py @@ -104,17 +104,16 @@ class ProcessServer(Process): return profiler.runcall(self.main) finally: profiler.dump_stats(self.profile_filename) - self.write_profile_stats(self.profile_filename, - self.profile_processed_filename) + self.write_profile_stats() sys.__stderr__.write("Raw profiling information saved to %s and " "processed statistics to %s\n" % (self.profile_filename, self.profile_processed_filename)) - def write_profile_stats(self, infn, outfn): + def write_profile_stats(self): import pstats - with open(outfn, 'w') as outfile: - stats = pstats.Stats(infn, stream=outfile) + with open(self.profile_processed_filename, 'w') as outfile: + stats = pstats.Stats(self.profile_filename, stream=outfile) stats.sort_stats('time') stats.print_stats() stats.print_callers()