utils: Improve profile log processing

This stream redirection of stdout is horrible. pstats takes a stream argument
so lets use that instead.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake-worker: Extra profiling data dump

Currently we get no profiling oversight into either the main bitbake worker
process, or the overall parsing before task execution. This adds in extra
profiling hooks so we can truly capture all parts of bitbake's execution
into the profile data.

To do this we modify the 'magic' value passed to bitbake-worker to trigger
the profiling, before the configuration data is sent over to the worker.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
build/data: Write out more complete python run files

Currently the output in the python task/function run files is rather
incomplete and effectively useless. This enhances the code to take
advantage of the bitbake's dependency tracking and extend the output to
include dependencies. This makes the files more usable for debugging
purposes. Since this only happens at python function execution time, the
overhead is minimal in the grand scheme of things.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>