Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Issue 2853853002: Fix overflow when logging MaxInt32 to a sparse histogram. (Closed)

Created:
3 years, 7 months ago by Alexei Svitkine (slow)
Modified:
3 years, 7 months ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, danakj+watch_chromium.org, asvitkine+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix overflow when logging MaxInt32 to a sparse histogram. The problem was that a bucket gets reported with an inclusive min value and exclusive max value, so max must to be +1 of the sample value for a sparse histogram value. Because the code wasn't handling this specifically, it caused the bucket max to be reported as a MinInt32 due to overflow of a 32 bit value. This CL changes the relevant iterator API to use int64_t for the max, to support MaxInt32 being logged. BUG=716600 TBR=jbauman@chromium.org, groby@chromium.org Review-Url: https://codereview.chromium.org/2853853002 Cr-Commit-Position: refs/heads/master@{#469136} Committed: https://chromium.googlesource.com/chromium/src/+/3f17b1463420e026459e2d7fde6335cf5e9b1852

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+104 lines, -51 lines) Patch
M base/metrics/histogram_samples.h View 1 5 chunks +12 lines, -5 lines 0 comments Download
M base/metrics/histogram_samples.cc View 1 7 chunks +15 lines, -14 lines 0 comments Download
M base/metrics/persistent_sample_map.cc View 1 5 chunks +7 lines, -6 lines 0 comments Download
M base/metrics/persistent_sample_map_unittest.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M base/metrics/sample_map.cc View 1 5 chunks +7 lines, -6 lines 0 comments Download
M base/metrics/sample_map_unittest.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M base/metrics/sample_vector.h View 1 chunk +1 line, -1 line 0 comments Download
M base/metrics/sample_vector.cc View 1 4 chunks +5 lines, -4 lines 0 comments Download
M base/metrics/sample_vector_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M base/metrics/sparse_histogram.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M base/metrics/sparse_histogram_unittest.cc View 1 chunk +37 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_internals_ui.cc View 1 2 chunks +7 lines, -2 lines 0 comments Download
M components/metrics/histogram_encoder.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/tracing/child/child_trace_message_filter.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/translate/core/common/translate_metrics_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 49 (38 generated)
Alexei Svitkine (slow)
3 years, 7 months ago (2017-05-02 15:29:33 UTC) #23
Ilya Sherman
Thanks, Alexei. LGTM % nits: https://codereview.chromium.org/2853853002/diff/60001/base/metrics/histogram_samples.h File base/metrics/histogram_samples.h (right): https://codereview.chromium.org/2853853002/diff/60001/base/metrics/histogram_samples.h#newcode203 base/metrics/histogram_samples.h:203: // values up to ...
3 years, 7 months ago (2017-05-02 21:37:49 UTC) #26
Alexei Svitkine (slow)
https://codereview.chromium.org/2853853002/diff/60001/base/metrics/histogram_samples.h File base/metrics/histogram_samples.h (right): https://codereview.chromium.org/2853853002/diff/60001/base/metrics/histogram_samples.h#newcode203 base/metrics/histogram_samples.h:203: // values up to MAXINT32+1. On 2017/05/02 21:37:49, Ilya ...
3 years, 7 months ago (2017-05-03 15:21:53 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2853853002/100001
3 years, 7 months ago (2017-05-03 15:22:28 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/426342)
3 years, 7 months ago (2017-05-03 15:30:24 UTC) #37
Alexei Svitkine (slow)
+gab for chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_internals_ui.cc OWNERS +TBR jbauman@ for trivial change to componets/tracing downstream of base/metrics API ...
3 years, 7 months ago (2017-05-03 17:37:38 UTC) #39
Primiano Tucci (use gerrit)
components/tracing/child/child_trace_message_filter.cc LGTM
3 years, 7 months ago (2017-05-03 18:07:49 UTC) #41
Alexei Svitkine (slow)
-gab +robliao since Rob wrote the task_scheduler_internals_ui.cc code being changed.
3 years, 7 months ago (2017-05-03 21:25:14 UTC) #43
robliao
chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_internals_ui.cc lgtm
3 years, 7 months ago (2017-05-03 21:29:05 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2853853002/100001
3 years, 7 months ago (2017-05-03 21:30:09 UTC) #46
commit-bot: I haz the power
3 years, 7 months ago (2017-05-03 21:37:57 UTC) #49
Message was sent while issue was closed.
Committed patchset #2 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/3f17b1463420e026459e2d7fde63...

Powered by Google App Engine
This is Rietveld 408576698