summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/bitbake
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-12-09 11:57:38 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-18 10:24:06 +0000
commit85a17f86ea2edf24b54aa62bd25e10ff522cb6e7 (patch)
tree69baa4d959be832b5c096b7d69b0fc2bcb2247b5 /bitbake/bin/bitbake
parentd086fa3aed34a05d52e73c255ca22379149a64a1 (diff)
downloadpoky-85a17f86ea2edf24b54aa62bd25e10ff522cb6e7.tar.gz
bitbake: add option to write offline event log file
This patch adds a "-w/--write-log" option to bitbake that writes an event log file for the current build. The name of the file is passed as a parameter to the "-w" argument. If the parameter is the empty string '', the file name is generated in the form bitbake_eventlog_DATE.json, where DATE is the current date and time, with second precision. The "-w" option can also be supplied as the BBEVENTLOG environment variable. We add a script, toater-eventreplay, that reads an event log file and loads the data into a Toaster database, creating a build entry. We modify the toasterui to fix minor issues with reading events from an event log file. Performance impact is undetectable under no-task executed builds. (Bitbake rev: 1befb4a783bb7b7b387d4b5ee08830d9516f1ac2) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin/bitbake')
-rwxr-xr-xbitbake/bin/bitbake12
1 files changed, 11 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 7f8449c7b3..d46c3dde3b 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -196,6 +196,9 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
196 parser.add_option("", "--status-only", help = "Check the status of the remote bitbake server.", 196 parser.add_option("", "--status-only", help = "Check the status of the remote bitbake server.",
197 action = "store_true", dest = "status_only", default = False) 197 action = "store_true", dest = "status_only", default = False)
198 198
199 parser.add_option("-w", "--write-log", help = "Writes the event log of the build to a bitbake event json file. Use '' (empty string) to assign the name automatically.",
200 action = "store", dest = "writeeventlog")
201
199 options, targets = parser.parse_args(sys.argv) 202 options, targets = parser.parse_args(sys.argv)
200 203
201 # some environmental variables set also configuration options 204 # some environmental variables set also configuration options
@@ -206,6 +209,14 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
206 if "BBTOKEN" in os.environ: 209 if "BBTOKEN" in os.environ:
207 options.xmlrpctoken = os.environ["BBTOKEN"] 210 options.xmlrpctoken = os.environ["BBTOKEN"]
208 211
212 if "BBEVENTLOG" is os.environ:
213 options.writeeventlog = os.environ["BBEVENTLOG"]
214
215 # fill in proper log name if not supplied
216 if options.writeeventlog is not None and len(options.writeeventlog) == 0:
217 import datetime
218 options.writeeventlog = "bitbake_eventlog_%s.json" % datetime.datetime.now().strftime("%Y%m%d%H%M%S")
219
209 # if BBSERVER says to autodetect, let's do that 220 # if BBSERVER says to autodetect, let's do that
210 if options.remote_server: 221 if options.remote_server:
211 [host, port] = options.remote_server.split(":", 2) 222 [host, port] = options.remote_server.split(":", 2)
@@ -266,7 +277,6 @@ def start_server(servermodule, configParams, configuration, features):
266 return server 277 return server
267 278
268 279
269
270def main(): 280def main():
271 281
272 configParams = BitBakeConfigParameters() 282 configParams = BitBakeConfigParameters()