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

Side by Side Diff: tools/valgrind/scan-build.py

Issue 2193923002: Update the remaining chromium references to memory.fyi. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 4 years, 4 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/valgrind/regrind.sh ('k') | tools/valgrind/waterfall.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 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 import argparse 6 import argparse
7 import errno 7 import errno
8 import json 8 import json
9 import os 9 import os
10 import re 10 import re
11 import sys 11 import sys
12 import urllib 12 import urllib
13 import urllib2 13 import urllib2
14 14
15 # Where all the data lives. 15 # Where all the data lives.
16 ROOT_URL = "http://build.chromium.org/p/chromium.memory.fyi/builders" 16 ROOT_URL = "http://build.chromium.org/p/chromium.memory.full/builders"
17 17
18 # TODO(groby) - support multi-line search from the command line. Useful when 18 # TODO(groby) - support multi-line search from the command line. Useful when
19 # scanning for classes of failures, see below. 19 # scanning for classes of failures, see below.
20 SEARCH_STRING = """<p class=\"failure result\"> 20 SEARCH_STRING = """<p class=\"failure result\">
21 Failed memory test: content 21 Failed memory test: content
22 </p>""" 22 </p>"""
23 23
24 # Location of the log cache. 24 # Location of the log cache.
25 CACHE_DIR = "buildlogs.tmp" 25 CACHE_DIR = "buildlogs.tmp"
26 26
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 commands = parser.add_mutually_exclusive_group(required=True) 192 commands = parser.add_mutually_exclusive_group(required=True)
193 commands.add_argument("--update", action='store_true') 193 commands.add_argument("--update", action='store_true')
194 commands.add_argument("--find", metavar='search term') 194 commands.add_argument("--find", metavar='search term')
195 parser.add_argument("--json", action='store_true', 195 parser.add_argument("--json", action='store_true',
196 help="Output in JSON format") 196 help="Output in JSON format")
197 args = parser.parse_args() 197 args = parser.parse_args()
198 198
199 path = os.path.abspath(os.path.dirname(argv[0])) 199 path = os.path.abspath(os.path.dirname(argv[0]))
200 cache_path = os.path.join(path, CACHE_DIR) 200 cache_path = os.path.join(path, CACHE_DIR)
201 201
202 fyi = Waterfall(ROOT_URL, cache_path) 202 full = Waterfall(ROOT_URL, cache_path)
203 203
204 if args.update: 204 if args.update:
205 fyi.Update() 205 full.Update()
206 for builder in fyi.Builders(): 206 for builder in full.Builders():
207 print "Updating", builder.Name() 207 print "Updating", builder.Name()
208 builder.ScanLogs(lambda x:False) 208 builder.ScanLogs(lambda x:False)
209 209
210 if args.find: 210 if args.find:
211 result = [] 211 result = []
212 tester = MultiLineChange(args.find.splitlines()) 212 tester = MultiLineChange(args.find.splitlines())
213 fyi.FetchInfo() 213 full.FetchInfo()
214 214
215 if not args.json: 215 if not args.json:
216 print "SCANNING FOR ", args.find 216 print "SCANNING FOR ", args.find
217 for builder in fyi.Builders(): 217 for builder in full.Builders():
218 if not args.json: 218 if not args.json:
219 print "Scanning", builder.Name() 219 print "Scanning", builder.Name()
220 occurrences = builder.ScanLogs(tester) 220 occurrences = builder.ScanLogs(tester)
221 if occurrences: 221 if occurrences:
222 min_build = min(occurrences) 222 min_build = min(occurrences)
223 path = builder.GetBuildPath(min_build) 223 path = builder.GetBuildPath(min_build)
224 if args.json: 224 if args.json:
225 data = {} 225 data = {}
226 data['builder'] = builder.Name() 226 data['builder'] = builder.Name()
227 data['first_affected'] = min_build 227 data['first_affected'] = min_build
228 data['last_affected'] = max(occurrences) 228 data['last_affected'] = max(occurrences)
229 data['last_build'] = builder.LatestBuild() 229 data['last_build'] = builder.LatestBuild()
230 data['frequency'] = ((int(builder.LatestBuild()) - int(min_build)) / 230 data['frequency'] = ((int(builder.LatestBuild()) - int(min_build)) /
231 len(occurrences)) 231 len(occurrences))
232 data['total'] = len(occurrences) 232 data['total'] = len(occurrences)
233 data['first_url'] = path 233 data['first_url'] = path
234 result.append(data) 234 result.append(data)
235 else: 235 else:
236 print "Earliest occurrence in build %d" % min_build 236 print "Earliest occurrence in build %d" % min_build
237 print "Latest occurrence in build %d" % max(occurrences) 237 print "Latest occurrence in build %d" % max(occurrences)
238 print "Latest build: %d" % builder.LatestBuild() 238 print "Latest build: %d" % builder.LatestBuild()
239 print path 239 print path
240 print "%d total" % len(occurrences) 240 print "%d total" % len(occurrences)
241 if args.json: 241 if args.json:
242 json.dump(result, sys.stdout, indent=2, sort_keys=True) 242 json.dump(result, sys.stdout, indent=2, sort_keys=True)
243 243
244 if __name__ == "__main__": 244 if __name__ == "__main__":
245 sys.exit(main(sys.argv)) 245 sys.exit(main(sys.argv))
246
OLDNEW
« no previous file with comments | « tools/valgrind/regrind.sh ('k') | tools/valgrind/waterfall.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698