The current code for -w event.log doesn't start recording the events until the event name == "bb.event.BuildStarted": So, for example bitbake -p -w cow.log does not write out anything to cow.log, in fact the cow.log file is not created. The current code does dump all the events in the Q and on the pending Q, so no events are lost. Unfortunately, if there is no buildstarted event , we see nothing. We do currently dump { "allvariables" : self.cooker.getAllKeysWithFlags(["doc", "func"])} on buildstarted but it seems like we could start from the beginning and dump the allvariables when and if we get to a buildstarted (or maybe a parsecompleted?).
I decided not to change current behaviour too much as there could be a reason to collect variables on BuildStarted event as variables can reflect real build environment better if they're collected when build is started. To make sure we always record events it's better to record them also when CookerExit event is received. This way bitbake -p -w eventlog with output events to the log even if BuildStarted is not received, but it will output them starting from BuildStarted if it's received. Please, review: http://lists.openembedded.org/pipermail/bitbake-devel/2016-September/007982.html
merged to master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=ead05456264e9c7c32819271562d0ac074ecaee3