metrics: Use absolute interval-based perf collection

Replace the old CWP collection scheme with a new scheme:
- Divide post-login time into four-hour intervals.
- Randomly select a time in each interval to collect a perf profile. The
  probability distribution should be even across that interval.
- Use the new SampledProfile protobuf to store the collected data.

Note that since this patch still collects only perf data, the module
perf_provider_chromeos is not renamed to reflect something more generic.
We would like to introduce other types of data collection in the future
but they may be in other modules, or we may create a new generic module
for data collection.

BUG=chromium:358778
TEST=The interval is too long to directly test. Shorten it to something
on the order of a minute and rebuild and deploy Chrome. Should be getting
some profile collections.
I added some logging to print the collected data size. It's around 12 kB,
and I get the same size data from running quipper manually:
quipper 2 `which perf` record -a -e cycles -c 1000003 > /usr/local/perf.proto

Signed-off-by: Simon Que <[email protected]>

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273971 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed