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

Side by Side Diff: tools/metrics/histograms/update_gpu_driver_bug_workaround_entries.py

Issue 2841273002: Add UMA histograms for GPU driver bug workaround entries. (Closed)
Patch Set: update script, include 0 entry Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2017 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Updates GpuDriverBugWorkaroundEntry enum in histograms.xml file with values
7 read from gpu_driver_bug_list.json.
8
9 If the file was pretty-printed, the updated version is pretty-printed too.
10 """
11
12 import os.path
13 import re
14 import sys
15
16 sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
17 import path_util
18 import json
19
20 import update_histogram_enum
21
22
23 GPU_DRIVER_BUG_WORKAROUND_PATH = 'gpu/config/gpu_driver_bug_list.json'
24
25
26 def ReadGpuDriverBugEntries(filename):
27 """Reads in the gpu driver bug list, returning a dictionary mapping
28 workaround ids to descriptions.
29 """
30 # Read the file as a list of lines
31 with open(path_util.GetInputFile(filename)) as f:
32 json_data = json.load(f)
33
34 entries = {}
35 entries[0] = '0: Recorded once every time this histogram is updated.'
36 for entry in json_data["entries"]:
37 entries[entry["id"]] = "%d: %s" % (entry["id"], entry["description"])
38 return entries
39
40
41 def main():
42 if len(sys.argv) > 1:
43 print >>sys.stderr, 'No arguments expected!'
44 sys.stderr.write(__doc__)
45 sys.exit(1)
46
47 update_histogram_enum.UpdateHistogramFromDict(
48 'GpuDriverBugWorkaroundEntry',
49 ReadGpuDriverBugEntries(GPU_DRIVER_BUG_WORKAROUND_PATH),
50 GPU_DRIVER_BUG_WORKAROUND_PATH)
51
52
53 if __name__ == '__main__':
54 main()
OLDNEW
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698