diff options
author | Richard Purdie <richard@openedhand.com> | 2007-08-11 22:42:15 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-08-11 22:42:15 +0000 |
commit | 18026165c3086b77253663fb12d5b7470de8f2a1 (patch) | |
tree | c07368e40fa2d1ae1c39947b66474b45dd672130 /bitbake/bin | |
parent | 0197eb2d870263b983ba217aca69ffe9f7708eb5 (diff) | |
download | openembedded-core-18026165c3086b77253663fb12d5b7470de8f2a1.tar.gz openembedded-core-18026165c3086b77253663fb12d5b7470de8f2a1.tar.bz2 openembedded-core-18026165c3086b77253663fb12d5b7470de8f2a1.tar.xz openembedded-core-18026165c3086b77253663fb12d5b7470de8f2a1.zip |
bitbake: Sync with upstream
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2480 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/bitbake | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 4b212adc2..8b69a0a33 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake @@ -102,6 +102,8 @@ Default BBFILES are the .bb files in the current directory.""" ) parser.add_option( "-l", "--log-domains", help = """Show debug logging for the specified logging domains""", action = "append", dest = "debug_domains", default = [] ) + parser.add_option( "-P", "--profile", help = "profile the command and print a report", + action = "store_true", dest = "profile", default = False ) options, args = parser.parse_args(sys.argv) @@ -110,8 +112,23 @@ Default BBFILES are the .bb files in the current directory.""" ) configuration.pkgs_to_build.extend(args[1:]) cooker = bb.cooker.BBCooker(configuration) - cooker.cook() + if configuration.profile: + try: + import cProfile as profile + except: + import profile + + profile.runctx("cooker.cook()", globals(), locals(), "profile.log") + import pstats + p = pstats.Stats('profile.log') + p.sort_stats('time') + p.print_stats() + p.print_callers() + p.sort_stats('cumulative') + p.print_stats() + else: + cooker.cook() if __name__ == "__main__": main() |