diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-08-27 14:56:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-08-28 15:12:45 +0100 |
commit | ac66e15f5cf0dfabab84967338909632559f5b7b (patch) | |
tree | c1c7da7a46f34d62165b7f129b6447aa3537d9f5 /bitbake | |
parent | c79b7f06af33f0b4531455aab25b6af646d29284 (diff) | |
download | ast2050-yocto-poky-ac66e15f5cf0dfabab84967338909632559f5b7b.zip ast2050-yocto-poky-ac66e15f5cf0dfabab84967338909632559f5b7b.tar.gz |
bitbake: utils: Improve profile log processing
This stream redirection of stdout is horrible. pstats takes a stream argument
so lets use that instead.
(Bitbake rev: 93d155f4766e27e7b004d13569aa03961fe89e3b)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/utils.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 7d37a74..670e592 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -862,21 +862,16 @@ def nonblockingfd(fd): fcntl.fcntl(fd, fcntl.F_SETFL, fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK) def process_profilelog(fn): - # Redirect stdout to capture profile information pout = open(fn + '.processed', 'w') - so = sys.stdout.fileno() - orig_so = os.dup(sys.stdout.fileno()) - os.dup2(pout.fileno(), so) import pstats - p = pstats.Stats(fn) + p = pstats.Stats(fn, stream=pout) p.sort_stats('time') p.print_stats() p.print_callers() p.sort_stats('cumulative') p.print_stats() - os.dup2(orig_so, so) pout.flush() pout.close() |