diff --git a/debug-viewer/GstDebugViewer/Data.py b/debug-viewer/GstDebugViewer/Data.py index 17523821ee..077aec062d 100644 --- a/debug-viewer/GstDebugViewer/Data.py +++ b/debug-viewer/GstDebugViewer/Data.py @@ -69,7 +69,7 @@ def parse_time (st): class DebugLevel (int): - __names = ["NONE", "ERROR", "WARN", "INFO", "DEBUG", "LOG"] + __names = ["NONE", "ERROR", "WARN", "INFO", "DEBUG", "LOG", "FIXME", "TRACE"] __instances = {} def __new__ (cls, level): @@ -113,7 +113,11 @@ debug_level_warning = DebugLevel ("WARN") debug_level_info = DebugLevel ("INFO") debug_level_debug = DebugLevel ("DEBUG") debug_level_log = DebugLevel ("LOG") +debug_level_fixme = DebugLevel ("FIXME") +debug_level_trace = DebugLevel ("TRACE") debug_levels = [debug_level_none, + debug_level_trace, + debug_level_fixme, debug_level_log, debug_level_debug, debug_level_info, @@ -213,10 +217,11 @@ class LineCache (Producer): offsets = self.offsets levels = self.levels - dict_levels = {"D" : debug_level_debug, "L" : debug_level_log, - "I" : debug_level_info, "E" : debug_level_error, - "W" : debug_level_warning, " " : debug_level_none} - rexp = re.compile (r"\d:\d\d:\d\d\.\d+\s+\d+\s+0x[0-9a-f]+\s+([DLIEW ])") + dict_levels = {"T" : debug_level_trace, "F" : debug_level_fixme, + "L" : debug_level_log, "D" : debug_level_debug, + "I" : debug_level_info, "W" : debug_level_warning, + "E" : debug_level_error, " " : debug_level_none} + rexp = re.compile (r"\d:\d\d:\d\d\.\d+\s+\d+\s+0x[0-9a-f]+\s+([TFLDIEW ])") # Moving attribute lookups out of the loop: readline = self.__fileobj.readline diff --git a/debug-viewer/GstDebugViewer/GUI/colors.py b/debug-viewer/GstDebugViewer/GUI/colors.py index 6e84093677..fc5cb047ad 100644 --- a/debug-viewer/GstDebugViewer/GUI/colors.py +++ b/debug-viewer/GstDebugViewer/GUI/colors.py @@ -123,6 +123,10 @@ class LevelColorThemeTango (LevelColorTheme): p = TangoPalette.get () self.add_color (Data.debug_level_none, None, None, None) + self.add_color (Data.debug_level_trace, + p.black, p.aluminium2, Color ("#d3d7cf")) + self.add_color (Data.debug_level_fixme, + p.black, p.butter3, Color ("#c4a000")) self.add_color (Data.debug_level_log, p.black, p.plum1, Color ("#e0a4d9")) self.add_color (Data.debug_level_debug, diff --git a/debug-viewer/GstDebugViewer/Plugins/Timeline.py b/debug-viewer/GstDebugViewer/Plugins/Timeline.py index b05cddc5e2..37ffaeed5a 100644 --- a/debug-viewer/GstDebugViewer/Plugins/Timeline.py +++ b/debug-viewer/GstDebugViewer/Plugins/Timeline.py @@ -152,6 +152,7 @@ class LevelDistributionSentinel (object): def process (self): + MAX_LEVELS = 8 YIELD_LIMIT = 10000 y = YIELD_LIMIT @@ -164,7 +165,7 @@ class LevelDistributionSentinel (object): i = 0 partitions_i = 0 partitions = self.freq_sentinel.partitions - counts = [0] * 6 + counts = [0] * MAX_LEVELS tree_iter = self.model.get_iter_first () if not partitions: @@ -179,7 +180,7 @@ class LevelDistributionSentinel (object): level = model_get (tree_iter, id_level) while i > partitions[partitions_i]: data.append (tuple (counts)) - counts = [0] * 6 + counts = [0] * MAX_LEVELS partitions_i += 1 if partitions_i == len (partitions): finished = True @@ -608,18 +609,30 @@ class TimelineWidget (gtk.DrawingArea): yield sum ((level_counts[level] for level in levels)) level = Data.debug_level_info - levels_prev = (Data.debug_level_log, Data.debug_level_debug,) + levels_prev = (Data.debug_level_trace,Data.debug_level_fixme,Data.debug_level_log, Data.debug_level_debug,) ctx.set_source_rgb (*(colors[level][1].float_tuple ())) self.__draw_graph (ctx, w, h, maximum, list (cumulative_level_counts (level, *levels_prev))) level = Data.debug_level_debug - levels_prev = (Data.debug_level_log,) + levels_prev = (Data.debug_level_trace,Data.debug_level_fixme,Data.debug_level_log,) ctx.set_source_rgb (*(colors[level][1].float_tuple ())) self.__draw_graph (ctx, w, h, maximum, list (cumulative_level_counts (level, *levels_prev))) level = Data.debug_level_log + levels_prev = (Data.debug_level_trace,Data.debug_level_fixme,) + ctx.set_source_rgb (*(colors[level][1].float_tuple ())) + self.__draw_graph (ctx, w, h, maximum, + list (cumulative_level_counts (level, *levels_prev))) + + level = Data.debug_level_fixme + levels_prev = (Data.debug_level_trace,) + ctx.set_source_rgb (*(colors[level][1].float_tuple ())) + self.__draw_graph (ctx, w, h, maximum, + list (cumulative_level_counts (level, *levels_prev))) + + level = Data.debug_level_trace ctx.set_source_rgb (*(colors[level][1].float_tuple ())) self.__draw_graph (ctx, w, h, maximum, [counts[level] for counts in dist_data])