Reduce find_unmapped_histograms.py false negative rate |
|
Issue descriptionCurrent known issues: 1. Some Chromium code wraps the histogram macros in custom macros, eg. https://cs.chromium.org/chromium/src/content/child/web_database_observer_impl.cc?q=UMA_HISTOGRAM_WEBSQL_RESULT 2. Some code uses compile-time macro concatenation, eg. https://cs.chromium.org/chromium/src/components/signin/core/browser/signin_metrics.h?q=%22UMA_HISTOGRAM_CUSTOM_COUNTS(name+%22 3. Some code doesn't use the macros at all but uses its own initialisation, eg. https://cs.chromium.org/chromium/src/net/disk_cache/blockfile/stats.cc?q=base::Histogram::FactoryGet 4. Sometimes the histogram name is declared separately in a constant: https://cs.chromium.org/chromium/src/net/cookies/canonical_cookie.cc?q="UMA_HISTOGRAM_ENUMERATION(k" 5. Some code generates the histogram name at runtime correctly: https://cs.chromium.org/chromium/src/net/nqe/network_quality_estimator.cc?q=base::Histogram::FactoryGet&sq=package:chromium 6. Blink has its own histogram wrappers: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/Histogram.h 7. NaCl has its own histogram wrappers: https://cs.chromium.org/chromium/src/components/nacl/renderer/histogram.h 8. Java code can record histograms: https://cs.chromium.org/chromium/src/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java
,
Aug 12 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/986ac05bfafd2f0016f282473324011326b52947 commit 986ac05bfafd2f0016f282473324011326b52947 Author: ricea <ricea@chromium.org> Date: Fri Aug 12 07:15:23 2016 In find_unmapped_histograms.py, remove comments from histogram names While scanning the source code for histogram matches, remove C++-style and C-style comments from histogram names. This reduces the number of false-negatives that the script produces. Before / after diff: WARNING: components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc contains non-literal histogram name <uma> WARNING: cc/raster/one_copy_raster_buffer_provider.cc contains non-literal histogram name <base::StringPrintf("Renderer4.%s.PartialRasterPercentageSaved.OneCopy"> - WARNING: content/browser/renderer_host/p2p/socket_host_udp.cc contains non-literal histogram name <"WebRTC.SystemSendPacketDuration_UDP" /* name */> - WARNING: ui/events/blink/input_handler_proxy.cc contains non-literal histogram name <// So named for historical reasons. - "Event.Latency.RendererImpl.GestureScroll2"> WARNING: chrome/browser/browser_shutdown.cc contains non-literal histogram name <time.c_str(> WARNING: chrome/browser/browser_shutdown.cc contains non-literal histogram name <time_per.c_str(> --- 20,23 ---- R=isherman@chromium.org BUG=635726 Review-Url: https://codereview.chromium.org/2228573003 Cr-Commit-Position: refs/heads/master@{#411567} [modify] https://crrev.com/986ac05bfafd2f0016f282473324011326b52947/tools/metrics/histograms/find_unmapped_histograms.py |
|
►
Sign in to add a comment |
|
Comment 1 by ricea@chromium.org
, Aug 9 2016