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

Side by Side Diff: appengine/findit/crash/stacktrace.py

Issue 2588133003: [Predator] Add clusterfuzz callstack filters. (Closed)
Patch Set: Created 4 years 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
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from collections import namedtuple 5 from collections import namedtuple
6 import copy 6 import copy
7 import logging 7 import logging
8 import re 8 import re
9 9
10 from crash import parse_util 10 from crash import parse_util
(...skipping 10 matching lines...) Expand all
21 r'(.*?):(\d+)(:\d+)?$') 21 r'(.*?):(\d+)(:\d+)?$')
22 } 22 }
23 23
24 FRAME_INDEX_PATTERN = re.compile(r'\s*#(\d+)\s.*') 24 FRAME_INDEX_PATTERN = re.compile(r'\s*#(\d+)\s.*')
25 25
26 _DEFAULT_FORMAT_TYPE = CallStackFormatType.DEFAULT 26 _DEFAULT_FORMAT_TYPE = CallStackFormatType.DEFAULT
27 27
28 28
29 class StackFrame(namedtuple('StackFrame', 29 class StackFrame(namedtuple('StackFrame',
30 ['index', 'dep_path', 'function', 'file_path', 'raw_file_path', 30 ['index', 'dep_path', 'function', 'file_path', 'raw_file_path',
31 'crashed_line_numbers', 'repo_url'])): 31 'crashed_line_numbers', 'repo_url'])):
32 """Represents a frame in a stacktrace. 32 """Represents a frame in a stacktrace.
33 33
34 Attributes: 34 Attributes:
35 index (int): Index shown in the stacktrace if a stackframe line looks like 35 index (int): Index shown in the stacktrace if a stackframe line looks like
36 this - '#0 ...', else use the index in the callstack list. 36 this - '#0 ...', else use the index in the callstack list.
37 dep_path (str): Path of the dep this frame represents, for example, 37 dep_path (str): Path of the dep this frame represents, for example,
38 'src/', 'src/v8', 'src/skia'...etc. 38 'src/', 'src/v8', 'src/skia'...etc.
39 function (str): Function that caused the crash. 39 function (str): Function that caused the crash.
40 file_path (str): Normalized path of the crashed file, with parts dep_path 40 file_path (str): Normalized path of the crashed file, with parts dep_path
41 and parts before it stripped, for example, api.cc. 41 and parts before it stripped, for example, api.cc.
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 for stack_buffer in self.stacks] 365 for stack_buffer in self.stacks]
366 366
367 if crash_stack_index is None: 367 if crash_stack_index is None:
368 # If there is no signature callstack, fall back to set crash stack using 368 # If there is no signature callstack, fall back to set crash stack using
369 # the first least priority callstack. 369 # the first least priority callstack.
370 crash_stack = min(callstacks, key=lambda stack: stack.priority) 370 crash_stack = min(callstacks, key=lambda stack: stack.priority)
371 else: 371 else:
372 crash_stack = callstacks[crash_stack_index] 372 crash_stack = callstacks[crash_stack_index]
373 373
374 return Stacktrace(tuple(callstacks), crash_stack) 374 return Stacktrace(tuple(callstacks), crash_stack)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698