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

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

Issue 1914113002: [Findit] Enable project classifier and component classifier (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Address comments and add tests. Created 4 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
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 import re 5 import re
6 6
7 7
8 def FilterFramesBeforeSignature(callstack, signature): 8 def FilterFramesBeforeSignature(callstack, signature):
9 """Filter all the stack frames before the signature frame. 9 """Filters all the stack frames before the signature frame.
10 10
11 Note: The callstack is filtered in place. 11 Note: The callstack is filtered in place.
12 """ 12 """
13 if not signature: 13 if not signature:
14 return 14 return
15 15
16 signature_frame_index = 0 16 signature_frame_index = 0
17 # Filter out the types of signature, for example [Out of Memory]. 17 # Filter out the types of signature, for example [Out of Memory].
18 signature = re.sub('[[][^]]*[]]\s*', '', signature) 18 signature = re.sub('[[][^]]*[]]\s*', '', signature)
19 19
20 for index, frame in enumerate(callstack): 20 for index, frame in enumerate(callstack):
21 if signature in frame.function: 21 if signature in frame.function:
22 signature_frame_index = index 22 signature_frame_index = index
23 23
24 print signature_frame_index
Martin Barbella 2016/05/10 06:00:41 Remove before landing.
Sharu Jiang 2016/05/12 23:58:00 Done.
24 callstack[:] = callstack[signature_frame_index:] 25 callstack[:] = callstack[signature_frame_index:]
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698