OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Scans the Chromium source of UseCounter, formats the Feature enum for | 6 """Scans the Chromium source of UseCounter, formats the Feature enum for |
7 histograms.xml and merges it. This script can also generate a python code | 7 histograms.xml and merges it. This script can also generate a python code |
8 snippet to put in uma.py of Chromium Dashboard. Make sure that you review the | 8 snippet to put in uma.py of Chromium Dashboard. Make sure that you review the |
9 output for correctness. | 9 output for correctness. |
10 """ | 10 """ |
(...skipping 20 matching lines...) Expand all Loading... |
31 'Chromium dashboard developed at ' | 31 'Chromium dashboard developed at ' |
32 'https://github.com/GoogleChrome/chromium-dashboard') | 32 'https://github.com/GoogleChrome/chromium-dashboard') |
33 options, args = parser.parse_args() | 33 options, args = parser.parse_args() |
34 | 34 |
35 source_path = 'third_party/WebKit/Source/core/frame/UseCounter.h' | 35 source_path = 'third_party/WebKit/Source/core/frame/UseCounter.h' |
36 | 36 |
37 START_MARKER = '^enum Feature : uint32_t {' | 37 START_MARKER = '^enum Feature : uint32_t {' |
38 END_MARKER = '^NumberOfFeatures' | 38 END_MARKER = '^NumberOfFeatures' |
39 | 39 |
40 if options.dashboard: | 40 if options.dashboard: |
41 enum_dict = ReadHistogramValues(source_path, START_MARKER, END_MARKER) | 41 enum_dict, ignored = ReadHistogramValues(source_path, START_MARKER, |
| 42 END_MARKER) |
42 PrintEnumForDashboard(enum_dict) | 43 PrintEnumForDashboard(enum_dict) |
43 else: | 44 else: |
44 UpdateHistogramEnum( | 45 UpdateHistogramEnum( |
45 histogram_enum_name='FeatureObserver', | 46 histogram_enum_name='FeatureObserver', |
46 source_enum_path=source_path, | 47 source_enum_path=source_path, |
47 start_marker=START_MARKER, | 48 start_marker=START_MARKER, |
48 end_marker=END_MARKER) | 49 end_marker=END_MARKER) |
OLD | NEW |