bitbake: toaster: Fix total number of tasks in build dashboard

The total number of tasks in the build dashboard was counting
_setscene tasks, which are not exposed by Toaster as separate
tasks. This patch makes sure that _setscene tasks are not
counted when calculating that number.

[YOCTO #6145]

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake: toaster: Fix Empty tasks filter

Somehow the counter was set to count tasks with outcome
'not available', instead of outcome 'empty'. This patch
fixes the problem.

[YOCTO #6146]

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
runqueue: Fix handling of zero priority task

The zero priority task should be run first but was being confused with
the None value the priority field defaulted to. Check for None
explicitly to avoid this error.

In the real world this doesn't change much but it confused the debug
output from the schedulers.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
runqueue: Fix task weighting algorithm

When looking at a list of tasks, do_patch and do_unpack were being
given equal priority when one clearly depends on another. The
reason for this was the default task weights of 0 being to tasks.
This is therefore changed to 1 to allow correct weighting of dependencies
which means the scheduler has better information available to it about
tasks.

Weight endpoints differently (10) for clearer debugging of priorities.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
runqueue: Do not write out stamp files in dry_run mode

In dry run mode, stamps for noexec tasks are being written out which
is incorrect. Avoid this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
parse/ast: Optimise data finalisation

The optimisation where only the data we're interested in was finalised
was good but it turns out we can do better. In the case where a
class-extension is to be targeted, we can skip the other targets.

This change does that and speeds up parsing at the bitbake-worker
execution time. Specifically, you can see an improvement in the speed
of bitbake X -n.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake-worker: Drop BBHASH variables

Iterating through and calling setVar on this number of variables has significant
overhead in the profiling data. By not setting this, we save 3,000 calls
to setVar which gives a noticeable improvement to the speed of task execution.

The BBHASH variables have since been replaced by accessing that data through
the siggen code and going forward, that is the preferred way work with it.

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