mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
debug-viewer: Added filter for threads
https://bugzilla.gnome.org/show_bug.cgi?id=793241
This commit is contained in:
parent
8c93cc156f
commit
07cd72be78
3 changed files with 35 additions and 0 deletions
|
@ -89,6 +89,18 @@ class FunctionFilter (Filter):
|
||||||
self.filter_func = function_filter_func
|
self.filter_func = function_filter_func
|
||||||
|
|
||||||
|
|
||||||
|
class ThreadFilter (Filter):
|
||||||
|
|
||||||
|
def __init__(self, thread_, all_but_this=False):
|
||||||
|
|
||||||
|
col_id = LogModelBase.COL_THREAD
|
||||||
|
comparison_function = get_comparison_function(all_but_this)
|
||||||
|
|
||||||
|
def thread_filter_func(row):
|
||||||
|
return comparison_function(row[col_id], thread_)
|
||||||
|
self.filter_func = thread_filter_func
|
||||||
|
|
||||||
|
|
||||||
class FilenameFilter (Filter):
|
class FilenameFilter (Filter):
|
||||||
|
|
||||||
def __init__(self, filename, all_but_this=False):
|
def __init__(self, filename, all_but_this=False):
|
||||||
|
|
|
@ -40,6 +40,7 @@ from GstDebugViewer.GUI.filters import (CategoryFilter,
|
||||||
DebugLevelFilter,
|
DebugLevelFilter,
|
||||||
FilenameFilter,
|
FilenameFilter,
|
||||||
FunctionFilter,
|
FunctionFilter,
|
||||||
|
ThreadFilter,
|
||||||
ObjectFilter)
|
ObjectFilter)
|
||||||
from GstDebugViewer.GUI.models import (FilteredLogModel,
|
from GstDebugViewer.GUI.models import (FilteredLogModel,
|
||||||
LazyLogModel,
|
LazyLogModel,
|
||||||
|
@ -289,6 +290,10 @@ class Window (object):
|
||||||
"Hide log category")),
|
"Hide log category")),
|
||||||
("show-only-log-category", None, _(
|
("show-only-log-category", None, _(
|
||||||
"Show only log category")),
|
"Show only log category")),
|
||||||
|
("hide-log-thread", None, _(
|
||||||
|
"Hide thread")),
|
||||||
|
("show-only-log-thread", None, _(
|
||||||
|
"Show only thread")),
|
||||||
("hide-log-object", None, _("Hide object")),
|
("hide-log-object", None, _("Hide object")),
|
||||||
("show-only-log-object", None, _(
|
("show-only-log-object", None, _(
|
||||||
"Show only object")),
|
"Show only object")),
|
||||||
|
@ -824,6 +829,13 @@ class Window (object):
|
||||||
category = row[LogModelBase.COL_CATEGORY]
|
category = row[LogModelBase.COL_CATEGORY]
|
||||||
self.add_model_filter(CategoryFilter(category))
|
self.add_model_filter(CategoryFilter(category))
|
||||||
|
|
||||||
|
@action
|
||||||
|
def handle_hide_log_thread_action_activate(self, action):
|
||||||
|
|
||||||
|
row = self.get_active_line()
|
||||||
|
thread = row[LogModelBase.COL_THREAD]
|
||||||
|
self.add_model_filter(ThreadFilter(thread))
|
||||||
|
|
||||||
@action
|
@action
|
||||||
def handle_hide_log_object_action_activate(self, action):
|
def handle_hide_log_object_action_activate(self, action):
|
||||||
|
|
||||||
|
@ -868,6 +880,13 @@ class Window (object):
|
||||||
category = row[LogModelBase.COL_CATEGORY]
|
category = row[LogModelBase.COL_CATEGORY]
|
||||||
self.add_model_filter(CategoryFilter(category, True))
|
self.add_model_filter(CategoryFilter(category, True))
|
||||||
|
|
||||||
|
@action
|
||||||
|
def handle_show_only_log_thread_action_activate(self, action):
|
||||||
|
|
||||||
|
row = self.get_active_line()
|
||||||
|
thread = row[LogModelBase.COL_THREAD]
|
||||||
|
self.add_model_filter(ThreadFilter(thread, True))
|
||||||
|
|
||||||
@action
|
@action
|
||||||
def handle_show_only_log_object_action_activate(self, action):
|
def handle_show_only_log_object_action_activate(self, action):
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
<menuitem name="ViewContextMenuShowOnlyLevel" action="show-only-log-level"/>
|
<menuitem name="ViewContextMenuShowOnlyLevel" action="show-only-log-level"/>
|
||||||
<menuitem name="ViewContextMenuHideCategory" action="hide-log-category"/>
|
<menuitem name="ViewContextMenuHideCategory" action="hide-log-category"/>
|
||||||
<menuitem name="ViewContextMenuShowOnlyCategory" action="show-only-log-category"/>
|
<menuitem name="ViewContextMenuShowOnlyCategory" action="show-only-log-category"/>
|
||||||
|
<menuitem name="ViewContextMenuHideThread" action="hide-log-thread"/>
|
||||||
|
<menuitem name="ViewContextMenuShowOnlyThread" action="show-only-log-thread"/>
|
||||||
<menuitem name="ViewContextMenuHideObject" action="hide-log-object"/>
|
<menuitem name="ViewContextMenuHideObject" action="hide-log-object"/>
|
||||||
<menuitem name="ViewContextMenuShowOnlyObject" action="show-only-log-object"/>
|
<menuitem name="ViewContextMenuShowOnlyObject" action="show-only-log-object"/>
|
||||||
<menuitem name="ViewContextMenuHideFunction" action="hide-log-function"/>
|
<menuitem name="ViewContextMenuHideFunction" action="hide-log-function"/>
|
||||||
|
@ -57,6 +59,8 @@
|
||||||
<menuitem name="ViewContextMenuShowOnlyLevel" action="show-only-log-level"/>
|
<menuitem name="ViewContextMenuShowOnlyLevel" action="show-only-log-level"/>
|
||||||
<menuitem name="ViewContextMenuHideCategory" action="hide-log-category"/>
|
<menuitem name="ViewContextMenuHideCategory" action="hide-log-category"/>
|
||||||
<menuitem name="ViewContextMenuShowOnlyCategory" action="show-only-log-category"/>
|
<menuitem name="ViewContextMenuShowOnlyCategory" action="show-only-log-category"/>
|
||||||
|
<menuitem name="ViewContextMenuHideThread" action="hide-log-thread"/>
|
||||||
|
<menuitem name="ViewContextMenuShowOnlyThread" action="show-only-log-thread"/>
|
||||||
<menuitem name="ViewContextMenuHideObject" action="hide-log-object"/>
|
<menuitem name="ViewContextMenuHideObject" action="hide-log-object"/>
|
||||||
<menuitem name="ViewContextMenuShowOnlyObject" action="show-only-log-object"/>
|
<menuitem name="ViewContextMenuShowOnlyObject" action="show-only-log-object"/>
|
||||||
<menuitem name="ViewContextMenuHideFunction" action="hide-log-function"/>
|
<menuitem name="ViewContextMenuHideFunction" action="hide-log-function"/>
|
||||||
|
|
Loading…
Reference in a new issue