summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-08-11 22:42:15 +0000
committerRichard Purdie <richard@openedhand.com>2007-08-11 22:42:15 +0000
commit18026165c3086b77253663fb12d5b7470de8f2a1 (patch)
treec07368e40fa2d1ae1c39947b66474b45dd672130 /bitbake/bin/bitbake
parent0197eb2d870263b983ba217aca69ffe9f7708eb5 (diff)
downloadpoky-18026165c3086b77253663fb12d5b7470de8f2a1.tar.gz
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/bitbake')
-rwxr-xr-xbitbake/bin/bitbake19
1 files changed, 18 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 4b212adc2d..8b69a0a33f 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -102,6 +102,8 @@ Default BBFILES are the .bb files in the current directory.""" )
102 parser.add_option( "-l", "--log-domains", help = """Show debug logging for the specified logging domains""", 102 parser.add_option( "-l", "--log-domains", help = """Show debug logging for the specified logging domains""",
103 action = "append", dest = "debug_domains", default = [] ) 103 action = "append", dest = "debug_domains", default = [] )
104 104
105 parser.add_option( "-P", "--profile", help = "profile the command and print a report",
106 action = "store_true", dest = "profile", default = False )
105 107
106 options, args = parser.parse_args(sys.argv) 108 options, args = parser.parse_args(sys.argv)
107 109
@@ -110,8 +112,23 @@ Default BBFILES are the .bb files in the current directory.""" )
110 configuration.pkgs_to_build.extend(args[1:]) 112 configuration.pkgs_to_build.extend(args[1:])
111 113
112 cooker = bb.cooker.BBCooker(configuration) 114 cooker = bb.cooker.BBCooker(configuration)
113 cooker.cook()
114 115
116 if configuration.profile:
117 try:
118 import cProfile as profile
119 except:
120 import profile
121
122 profile.runctx("cooker.cook()", globals(), locals(), "profile.log")
123 import pstats
124 p = pstats.Stats('profile.log')
125 p.sort_stats('time')
126 p.print_stats()
127 p.print_callers()
128 p.sort_stats('cumulative')
129 p.print_stats()
130 else:
131 cooker.cook()
115 132
116if __name__ == "__main__": 133if __name__ == "__main__":
117 main() 134 main()