android: Add the target to toplevel Looper events in tracing.

When tracing is enabled, toplevel Looper tasks come from Chrome and the
system. Non-native tasks are a black box, as they only show up as
"toplevel.dispatchMessage" in tracing. This commit adds the "target" of
the looper task as a parameter in the trace.

For instance (from a startup trace):
- android.view.ViewRootImpl$ViewRootHandler
- android.view.Choreographer$FrameHandler
- android.os.AsyncTask$InternalHandler
- com.google.android.gms.common.internal.s

This allows to distinguish between framework time, Chrome's Java tasks
and third-party libs (GMSCore above).

About performance cost:
- The Java string is already created by the framework code, we extract a
  substring of it.
- A new parameter for each toplevel trace event.

Review-Url: https://codereview.chromium.org/2883993002
Cr-Commit-Position: refs/heads/master@{#472043}


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