Fix toplevel.flow for TaskScheduler tasks.

First TaskTracker wasn't even using a fixed TaskAnnotator instance.

Second, it turns out that TaskAnnotator depends on a unique
|sequence_num| but TaskScheduler doesn't use nor set
PendingTask::sequence_num. While this is unfortunate and a bit of an
overreaching assumption, TaskScheduler is the only task system where
this isn't true. Thus, it's not worthwhile to refactor how this is
done at this time. This CL makes this assumption true for TaskScheduler
tasks when tracing is active.

Third, it appears there's a bug in TaskAnnotator/TRACE_ID_MANGLE
where the IDs aren't cross-process unique as they intend to be. This
occasionally still results in weird flow artifacts despite fixing the
above issues. Will address this independently.
Discussion @ https://groups.google.com/a/chromium.org/d/topic/benchmarking-dev/y_cK75SrevE/discussion

Example trace with this CL @ crbug.com/811035#c7

R=fdoray@chromium.org

Bug: 811035
Change-Id: I77f3ace2eca2b07f1e74f7f79cb35f6d8077931c
Reviewed-on: https://chromium-review.googlesource.com/913950
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536300}

CrOS-Libchrome-Original-Commit: 153eb02201c6bf2eca3eaa26d69de52eba60bc19
3 files changed
tree: d7950c5d51dfc24d8d39d8d8011561450d76e698
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/