Add TRACE_COUNTER_WITH_TIMESTAMPx macros.

base::ProcessMetrics::GetCPUUsage() gives access to the % of CPU usage
for the current process in the time interval [a, b], where a is the
timestamp of the previous call to the method and b is the current
timestamp.

In order to display a correct CPU usage graph in about:tracing from the
values returned by base::ProcessMetrics::GetCPUUsage(), we need a way
to emit a counter event with timestamp |b| when we read the CPU usage at
timestamp |a|.

This CL introduces 2 TRACE_COUNTER_WITH_TIMESTAMPx macros that can emit
a counter event with a custom timestamp.

BUG=553266

Review URL: https://codereview.chromium.org/1432873002

Cr-Commit-Position: refs/heads/master@{#361807}


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