<s> import Plugin <EOL> import Trace <EOL> import TraceOperations <EOL> import StringUtils <EOL> import Analyzer <EOL> import inspect <EOL> import StringIO <EOL> import copy <EOL> import code <EOL> import sys <EOL> import os <EOL> import re <EOL> import Common <EOL> from common import Collections <EOL> from common import Task <EOL> class CoreInteractivePlugin ( Plugin . InteractivePlugin ) : <EOL> def __init__ ( self , analyzer ) : <EOL> Plugin . InteractivePlugin . __init__ ( self , analyzer ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . help ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . loadTrace ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . newTrace ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . saveTrace ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . exportTrace , self . exportTraceHelp ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . closeTrace ) <EOL> self . analyzer . registerCommand ( "<STR_LIT:list>" , self . listTrace ) <EOL> self . analyzer . registerCommand ( "<STR_LIT:info>" , self . showTraceInfo ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . extractTrace ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . extractTraceWithState ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . showTraceState ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . joinTraces ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . mergeTraces ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . enableProfiling ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . interactivePythonMode ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . renumberTrace ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . reloadAnalyzer ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . showAnalyzerPlugins ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . showCallHistogram ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . grepTrace ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . setTraceEglConfig ) <EOL> self . analyzer . registerCommand ( "<STR_LIT>" , self . verifyTrace ) <EOL> def help ( self , command = None ) : <EOL> """<STR_LIT>""" <EOL> if command : <EOL> command = self . analyzer . completeCommand ( command ) <EOL> if command in self . analyzer . commands : <EOL> args , _ , _ , defaults = inspect . getargspec ( self . analyzer . commands [ command ] ) <EOL> if defaults is None : <EOL> defaults = [ ] <EOL> helpString = "<STR_LIT>" % command <EOL> for i , arg in enumerate ( args ) : <EOL> if arg == "<STR_LIT>" : <EOL> continue <EOL> if i >= len ( args ) - len ( defaults ) : <EOL> helpString += "<STR_LIT>" % ( arg , defaults [ i - ( len ( args ) - len ( defaults ) ) ] ) <EOL> else : <EOL> helpString += "<STR_LIT>" % arg <EOL> self . reportInfo ( helpString ) <EOL> if self . analyzer . commands [ command ] . __doc__ : <EOL> for line in self . analyzer . commands [ command ] . __doc__ . split ( "<STR_LIT:\n>" ) : <EOL> line = line . strip ( ) <EOL> if line . startswith ( "<STR_LIT>" ) : <EOL> _ , arg , text = line . split ( "<STR_LIT:U+0020>" , <NUM_LIT:2> ) <EOL> line = "<STR_LIT>" % ( arg . strip ( ) , text . strip ( ) ) <EOL> self . reportInfo ( line ) <EOL> if self . analyzer . commandHelp . get ( command ) : <EOL> self . reportInfo ( self . analyzer . commandHelp [ command ] ( ) ) <EOL> return <EOL> self . reportInfo ( "<STR_LIT>" ) <EOL> for command , func in sorted ( self . analyzer . commands . items ( ) ) : <EOL> doc = func . __doc__ or "<STR_LIT>" <EOL> if doc and "<STR_LIT:.>" in doc : <EOL> doc = doc . strip ( ) . split ( "<STR_LIT:.>" , <NUM_LIT:1> ) [ <NUM_LIT:0> ] + "<STR_LIT:.>" <EOL> doc = re . sub ( "<STR_LIT>" , "<STR_LIT:U+0020>" , doc ) <EOL> doc = re . sub ( "<STR_LIT:\n>" , "<STR_LIT:U+0020>" , doc ) <EOL> doc = StringUtils . wordWrap ( doc , columns = <NUM_LIT> ) <EOL> doc = doc . replace ( "<STR_LIT:\n>" , "<STR_LIT:\n>" + "<STR_LIT:U+0020>" * <NUM_LIT> ) <EOL> self . reportInfo ( "<STR_LIT>" % ( command , doc ) ) <EOL> self . reportInfo ( """<STR_LIT>""" ) <EOL> def loadTrace ( self , fileName , traceName = None , format = None ) : <EOL> """<STR_LIT>""" <EOL> trace = Trace . Trace ( ) <EOL> for importer in self . analyzer . importPlugins : <EOL> if format is not None and importer . formatName == format : <EOL> break <EOL> if importer . recognizeTraceFile ( fileName ) : <EOL> break <EOL> else : <EOL> if format is not None : <EOL> self . analyzer . fail ( "<STR_LIT>" % ( "<STR_LIT:U+002CU+0020>" . join ( [ i . formatName for i in self . analyzer . importPlugins ] ) ) ) <EOL> self . analyzer . fail ( "<STR_LIT>" ) <EOL> try : <EOL> f = open ( fileName , "<STR_LIT:rb>" ) <EOL> traces = importer . loadTrace ( f ) <EOL> f . close ( ) <EOL> if not isinstance ( traces , list ) : <EOL> traces = [ traces ] <EOL> for trace in traces : <EOL> traceName = traceName or "<STR_LIT>" % len ( self . analyzer . traces ) <EOL> self . analyzer . traces [ traceName ] = trace <EOL> self . analyzer . traceFiles [ traceName ] = fileName <EOL> if not TraceOperations . verify ( self , self . analyzer . project , trace ) : <EOL> self . reportWarning ( "<STR_LIT>" ) <EOL> self . reportInfo ( "<STR_LIT>" % ( fileName , traceName ) ) <EOL> traceName = None <EOL> return traces [ <NUM_LIT:0> ] <EOL> except IOError , e : <EOL> self . analyzer . fail ( e ) <EOL> def verifyTrace ( self , traceName ) : <EOL> """<STR_LIT>""" <EOL> if not traceName in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> trace = self . analyzer . traces [ traceName ] <EOL> TraceOperations . verify ( self , self . analyzer . project , trace ) <EOL> def newTrace ( self , traceName = None ) : <EOL> """<STR_LIT>""" <EOL> trace = Trace . Trace ( ) <EOL> traceName = traceName or "<STR_LIT>" % len ( self . analyzer . traces ) <EOL> self . analyzer . traces [ traceName ] = trace <EOL> self . reportInfo ( "<STR_LIT>" % ( traceName ) ) <EOL> return trace <EOL> def saveTrace ( self , traceName , fileName = None ) : <EOL> """<STR_LIT>""" <EOL> if not fileName : <EOL> try : <EOL> fileName = self . analyzer . traceFiles [ traceName ] <EOL> except KeyError : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> self . exportTrace ( traceName , fileName , format = "<STR_LIT>" ) <EOL> self . analyzer . traceFiles [ traceName ] = fileName <EOL> def exportTrace ( self , traceName , fileName , format = "<STR_LIT>" , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if not traceName in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> trace = self . analyzer . traces [ traceName ] <EOL> for exporter in self . analyzer . exportPlugins : <EOL> if exporter . formatName == format : <EOL> break <EOL> else : <EOL> self . analyzer . fail ( "<STR_LIT>" % ( "<STR_LIT:U+002CU+0020>" . join ( [ e . formatName for e in self . analyzer . exportPlugins ] ) ) ) <EOL> kwargs = Analyzer . completeKeywordArguments ( exporter . saveTrace , kwargs ) <EOL> try : <EOL> f = open ( fileName , "<STR_LIT:wb>" ) <EOL> exporter . saveTrace ( trace , f , ** kwargs ) <EOL> f . close ( ) <EOL> if format == "<STR_LIT>" : <EOL> self . analyzer . traceFiles [ traceName ] = fileName <EOL> self . reportInfo ( "<STR_LIT>" % ( traceName , fileName ) ) <EOL> else : <EOL> self . reportInfo ( "<STR_LIT>" % ( traceName , fileName , format ) ) <EOL> except IOError , e : <EOL> self . analyzer . fail ( e ) <EOL> def exportTraceHelp ( self ) : <EOL> helpText = [ "<STR_LIT>" ] <EOL> for exporter in self . analyzer . exportPlugins : <EOL> helpText . append ( "<STR_LIT>" % ( exporter . formatName , "<STR_LIT:U+002CU+0020>" . join ( Analyzer . getFunctionArguments ( exporter . saveTrace ) [ <NUM_LIT:3> : ] ) ) ) <EOL> return "<STR_LIT:\n>" . join ( helpText ) <EOL> def closeTrace ( self , traceName ) : <EOL> """<STR_LIT>""" <EOL> if not traceName in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> try : <EOL> del self . analyzer . traces [ traceName ] <EOL> del self . analyzer . traceFiles [ traceName ] <EOL> except KeyError : <EOL> pass <EOL> self . reportInfo ( "<STR_LIT>" % ( traceName ) ) <EOL> def listTrace ( self , traceName , eventRange = None ) : <EOL> """<STR_LIT>""" <EOL> if not traceName in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> trace = self . analyzer . traces [ traceName ] <EOL> try : <EOL> exporter = [ e for e in self . analyzer . exportPlugins if e . formatName == "<STR_LIT:text>" ] [ <NUM_LIT:0> ] <EOL> except IndexError : <EOL> self . analyzer . fail ( "<STR_LIT>" ) <EOL> firstEvent , lastEvent = self . analyzer . parseEventRange ( trace , eventRange ) <EOL> trace = copy . copy ( trace ) <EOL> trace . events = trace . events [ firstEvent : lastEvent ] <EOL> text = StringIO . StringIO ( ) <EOL> exporter . saveTrace ( trace , text , truncateValues = True , includeSensorData = False ) <EOL> self . reportInfo ( text . getvalue ( ) ) <EOL> def showTraceInfo ( self , traceName = None ) : <EOL> """<STR_LIT>""" <EOL> if traceName is not None : <EOL> if not traceName in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> traces = { traceName : self . analyzer . traces [ traceName ] } <EOL> else : <EOL> traces = self . analyzer . traces <EOL> arrayElementSizes = { <EOL> Trace . ByteArrayValue : <NUM_LIT:1> , <EOL> Trace . ShortArrayValue : <NUM_LIT:2> , <EOL> Trace . IntegerArrayValue : <NUM_LIT:4> , <EOL> Trace . LongArrayValue : <NUM_LIT:8> , <EOL> Trace . FloatArrayValue : <NUM_LIT:4> , <EOL> Trace . DoubleArrayValue : <NUM_LIT:8> , <EOL> Trace . ObjectArrayValue : <NUM_LIT:4> , <EOL> } <EOL> for name , trace in traces . items ( ) : <EOL> self . reportInfo ( "<STR_LIT>" % name ) <EOL> frames = <NUM_LIT:0> <EOL> renderCalls = <NUM_LIT:0> <EOL> arrayBytes = <NUM_LIT:0> <EOL> for event in trace . events : <EOL> for valueName , value in event . values . items ( ) : <EOL> if isinstance ( value , Trace . Array ) : <EOL> arrayBytes += len ( value ) * arrayElementSizes [ value . __class__ ] <EOL> try : <EOL> if self . analyzer . lookupFunction ( event ) . isFrameMarker : <EOL> frames += <NUM_LIT:1> <EOL> if self . analyzer . lookupFunction ( event ) . isRenderCall : <EOL> renderCalls += <NUM_LIT:1> <EOL> except AttributeError : <EOL> pass <EOL> self . reportInfo ( "<STR_LIT>" % len ( trace . events ) ) <EOL> self . reportInfo ( "<STR_LIT>" % frames ) <EOL> self . reportInfo ( "<STR_LIT>" % renderCalls ) <EOL> self . reportInfo ( "<STR_LIT>" % StringUtils . normalizeSiValue ( arrayBytes , "<STR_LIT:B>" , <NUM_LIT> ) ) <EOL> if len ( trace . events ) : <EOL> self . reportInfo ( "<STR_LIT>" % StringUtils . normalizeTimeValue ( ( trace . events [ - <NUM_LIT:1> ] . time - trace . events [ <NUM_LIT:0> ] . time ) / <NUM_LIT> ) ) <EOL> if name in self . analyzer . traceFiles : <EOL> self . reportInfo ( "<STR_LIT>" % self . analyzer . traceFiles [ name ] ) <EOL> def extractTrace ( self , traceName , eventRange , traceNameOut = None ) : <EOL> """<STR_LIT>""" <EOL> if not traceName in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> if traceNameOut is None : <EOL> traceNameOut = traceName <EOL> trace = self . analyzer . traces [ traceName ] <EOL> firstEvent , lastEvent = self . analyzer . parseEventRange ( trace , eventRange ) <EOL> trace = TraceOperations . extract ( trace , firstEvent , lastEvent ) <EOL> self . analyzer . traces [ traceNameOut ] = trace <EOL> self . reportInfo ( "<STR_LIT>" % ( len ( trace . events ) , traceName , traceNameOut ) ) <EOL> return trace <EOL> def showTraceState ( self , traceName , eventNumber = None ) : <EOL> """<STR_LIT>""" <EOL> if not traceName in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> trace = self . analyzer . traces [ traceName ] <EOL> if eventNumber is None : <EOL> eventNumber = len ( trace . events ) - <NUM_LIT:1> <EOL> else : <EOL> eventNumber = self . analyzer . parseEventRange ( trace , eventNumber ) [ <NUM_LIT:0> ] <EOL> state = TraceOperations . computeStateAtEvent ( self . analyzer . project , trace , eventNumber ) <EOL> self . reportInfo ( str ( state ) ) <EOL> def extractTraceWithState ( self , traceName , eventRange , traceNameOut = None ) : <EOL> """<STR_LIT>""" <EOL> if not traceName in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> if traceNameOut is None : <EOL> traceNameOut = traceName <EOL> trace = self . analyzer . traces [ traceName ] <EOL> firstEvent , lastEvent = self . analyzer . parseEventRange ( trace , eventRange ) <EOL> trace = TraceOperations . extractWithState ( self . analyzer . project , trace , firstEvent , lastEvent ) <EOL> self . analyzer . traces [ traceNameOut ] = trace <EOL> self . reportInfo ( "<STR_LIT>" % ( len ( trace . events ) , traceName , traceNameOut ) ) <EOL> return trace <EOL> def joinTraces ( self , traceName1 , traceName2 , traceNameOut = None ) : <EOL> """<STR_LIT>""" <EOL> if not traceName1 in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName1 ) <EOL> if not traceName2 in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName2 ) <EOL> if traceNameOut is None : <EOL> traceNameOut = traceName1 <EOL> trace = TraceOperations . join ( self . analyzer . traces [ traceName1 ] , self . analyzer . traces [ traceName2 ] ) <EOL> self . analyzer . traces [ traceNameOut ] = trace <EOL> self . reportInfo ( "<STR_LIT>" % ( traceName1 , traceName2 , traceNameOut ) ) <EOL> return trace <EOL> def mergeTraces ( self , traceName1 , traceName2 , traceNameOut = None , useTimeStamps = False ) : <EOL> """<STR_LIT>""" <EOL> if not traceName1 in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName1 ) <EOL> if not traceName2 in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName2 ) <EOL> if traceNameOut is None : <EOL> traceNameOut = traceName1 <EOL> useTimeStamps = self . analyzer . parseBoolean ( useTimeStamps ) <EOL> trace = TraceOperations . merge ( self . analyzer . traces [ traceName1 ] , self . analyzer . traces [ traceName2 ] , useTimeStamps = useTimeStamps ) <EOL> self . analyzer . traces [ traceNameOut ] = trace <EOL> self . reportInfo ( "<STR_LIT>" % ( traceName1 , traceName2 , traceNameOut ) ) <EOL> return trace <EOL> def enableProfiling ( self , state = "<STR_LIT>" ) : <EOL> """<STR_LIT>""" <EOL> self . analyzer . profiling = self . analyzer . parseBoolean ( state ) <EOL> if self . analyzer . profiling : <EOL> self . reportInfo ( "<STR_LIT>" ) <EOL> else : <EOL> self . reportInfo ( "<STR_LIT>" ) <EOL> def interactivePythonMode ( self , fileName = None , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> import AnalyzerEnvironment as env <EOL> env . analyzer = self . analyzer <EOL> env . project = self . analyzer . project <EOL> env . args = args <EOL> env . kwargs = kwargs <EOL> env . cmd = Collections . DictProxy ( self . analyzer . commands ) <EOL> env . traces = Collections . DictProxy ( self . analyzer . traces ) <EOL> try : <EOL> env . library = self . analyzer . project . targets [ "<STR_LIT:code>" ] . library <EOL> env . constants = Collections . DictProxy ( env . library . constants ) <EOL> except KeyError : <EOL> env . library = None <EOL> env . constants = None <EOL> try : <EOL> if fileName : <EOL> path = os . path . dirname ( fileName ) <EOL> moduleName = os . path . splitext ( os . path . basename ( fileName ) ) [ <NUM_LIT:0> ] <EOL> if not path in sys . path : <EOL> sys . path . append ( path ) <EOL> if not moduleName in sys . modules : <EOL> __import__ ( moduleName ) <EOL> else : <EOL> reload ( sys . modules [ moduleName ] ) <EOL> else : <EOL> console = code . InteractiveConsole ( locals = env . __dict__ ) <EOL> console . interact ( banner = "<STR_LIT>" ) <EOL> except SystemExit : <EOL> pass <EOL> def renumberTrace ( self , traceName ) : <EOL> """<STR_LIT>""" <EOL> if not traceName in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> trace = self . analyzer . traces [ traceName ] <EOL> for i , event in enumerate ( trace . events ) : <EOL> event . seq = i <EOL> self . reportInfo ( "<STR_LIT>" % ( len ( trace . events ) ) ) <EOL> def reloadAnalyzer ( self ) : <EOL> """<STR_LIT>""" <EOL> self . analyzer . reload ( ) <EOL> def showAnalyzerPlugins ( self ) : <EOL> """<STR_LIT>""" <EOL> def show ( plugin ) : <EOL> self . reportInfo ( "<STR_LIT>" % ( plugin . __class__ . __name__ , plugin . __module__ ) ) <EOL> self . reportInfo ( "<STR_LIT>" ) <EOL> for plugin in self . analyzer . plugins : <EOL> show ( plugin ) <EOL> self . reportInfo ( "<STR_LIT>" ) <EOL> for plugin in self . analyzer . importPlugins : <EOL> show ( plugin ) <EOL> self . reportInfo ( "<STR_LIT>" ) <EOL> for plugin in self . analyzer . exportPlugins : <EOL> show ( plugin ) <EOL> def showCallHistogram ( self , traceName ) : <EOL> """<STR_LIT>""" <EOL> if not traceName in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> trace = self . analyzer . traces [ traceName ] <EOL> hist = TraceOperations . calculateCallHistogram ( trace ) <EOL> width = <NUM_LIT> <EOL> largest = max ( hist . values ( ) ) <EOL> values = [ ( count , name ) for name , count in hist . items ( ) ] <EOL> for i , value in enumerate ( sorted ( values , reverse = True ) ) : <EOL> count , name = value <EOL> self . reportInfo ( "<STR_LIT>" % ( i + <NUM_LIT:1> , name , count , "<STR_LIT:#>" * int ( width * float ( count ) / largest ) ) ) <EOL> def setTraceEglConfig ( self , traceName , configId , eventRange = None ) : <EOL> """<STR_LIT>""" <EOL> if not traceName in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> trace = self . analyzer . traces [ traceName ] <EOL> firstEvent , lastEvent = self . analyzer . parseEventRange ( trace , eventRange ) <EOL> configId = int ( configId ) <EOL> for event in trace . events [ firstEvent : lastEvent ] : <EOL> for value in event . values . values ( ) : <EOL> if isinstance ( value , Trace . Object ) and value . cls . name == "<STR_LIT>" : <EOL> if not configId : <EOL> value . attrs [ "<STR_LIT>" ] = value . id <EOL> else : <EOL> value . attrs [ "<STR_LIT>" ] = - configId <EOL> self . analyzer . reportInfo ( "<STR_LIT>" % ( event . name , event . seq , abs ( value . attrs [ "<STR_LIT>" ] ) ) ) <EOL> def grepTrace ( self , traceName , expression , eventRange = None , fullText = True , context = <NUM_LIT:1> , outputTrace = None ) : <EOL> """<STR_LIT>""" <EOL> if not traceName in self . analyzer . traces : <EOL> self . analyzer . fail ( "<STR_LIT>" % traceName ) <EOL> trace = self . analyzer . traces [ traceName ] <EOL> try : <EOL> exporter = [ e for e in self . analyzer . exportPlugins if e . formatName == "<STR_LIT:text>" ] [ <NUM_LIT:0> ] <EOL> except IndexError : <EOL> self . analyzer . fail ( "<STR_LIT>" ) <EOL> if outputTrace : <EOL> newTrace = copy . copy ( trace ) <EOL> newTrace . events = [ ] <EOL> self . analyzer . traces [ outputTrace ] = newTrace <EOL> else : <EOL> newTrace = None <EOL> tempTrace = copy . copy ( trace ) <EOL> def eventToText ( event ) : <EOL> out = StringIO . StringIO ( ) <EOL> tempTrace . events = [ event ] <EOL> exporter . saveTrace ( tempTrace , out , truncateValues = True , includeSensorData = False ) <EOL> return out . getvalue ( ) <EOL> firstEvent , lastEvent = self . analyzer . parseEventRange ( trace , eventRange ) <EOL> fullText = self . analyzer . parseBoolean ( fullText ) <EOL> expression = re . compile ( expression ) <EOL> task = Task . startTask ( "<STR_LIT>" , "<STR_LIT>" , len ( trace . events [ firstEvent : lastEvent ] ) ) <EOL> for event in trace . events [ firstEvent : lastEvent ] : <EOL> task . step ( ) <EOL> if fullText : <EOL> text = eventToText ( event ) <EOL> else : <EOL> text = event . name <EOL> if expression . search ( text ) : <EOL> if newTrace : <EOL> newTrace . events . append ( event ) <EOL> else : <EOL> if not fullText : <EOL> text = eventToText ( event ) <EOL> self . reportInfo ( text ) </s>
