def showTraceInfo(self, traceName = None):
    """
    Show information about a trace.
    
    @param traceName:   Trace to examine or all opened traces by default.
    """
    if traceName is not None:
      if not traceName in self.analyzer.traces:
        self.analyzer.fail("Trace not found: %s" % traceName)
      traces = {traceName: self.analyzer.traces[traceName]}
    else:
      traces = self.analyzer.traces
      
    arrayElementSizes = {
        Trace.ByteArrayValue:     1,
        Trace.ShortArrayValue:    2,
        Trace.IntegerArrayValue:  4,
        Trace.LongArrayValue:     8,
        Trace.FloatArrayValue:    4,
        Trace.DoubleArrayValue:   8,
        Trace.ObjectArrayValue:   4,
    }
        
    for name, trace in traces.items():
      self.reportInfo("Trace %s:" % name)
      frames      = 0
      renderCalls = 0
      arrayBytes  = 0
      for event in trace.events:
        for valueName, value in event.values.items():
          if isinstance(value, Trace.Array):
            arrayBytes += len(value) * arrayElementSizes[value.__class__]
        try:
          if self.analyzer.lookupFunction(event).isFrameMarker:
            frames += 1
          if self.analyzer.lookupFunction(event).isRenderCall:
            renderCalls += 1
        except AttributeError:
          pass
      self.reportInfo("          Events: %d" % len(trace.events))
      self.reportInfo("          Frames: %d" % frames)
      self.reportInfo("    Render calls: %d" % renderCalls)
      self.reportInfo("      Array data: %s" % StringUtils.normalizeSiValue(arrayBytes, "B", 1024.0))
      if len(trace.events):
        self.reportInfo("        Duration: %s" % StringUtils.normalizeTimeValue((trace.events[-1].time - trace.events[0].time) / 1e6))
      if name in self.analyzer.traceFiles:
        self.reportInfo("        Filename: %s" % self.analyzer.traceFiles[name])
dataset/ETHPy150Open skyostil/tracy/src/analyzer/plugins/core/CorePlugin.py/CoreInteractivePlugin.showTraceInfo/original