Commit 84227fbf authored by Ell's avatar Ell

tools: in performance-log-viewer.py, fix "function()" predicate ...

... when not specifying a thread-ID
parent c7f17307
...@@ -727,12 +727,13 @@ class FindSamplesPopover (Gtk.Popover): ...@@ -727,12 +727,13 @@ class FindSamplesPopover (Gtk.Popover):
for i in range (len (samples)): for i in range (len (samples)):
try: try:
def match_thread (thread, id, state = None): def match_thread (thread, id, state = None):
return (type (id) == int and \ return (id is None or \
id == thread.id) or \ (type (id) == int and \
(type (id) == str and \ id == thread.id) or \
thread.name and \ (type (id) == str and \
re.fullmatch (id, thread.name)) and \ thread.name and \
(state is None or \ re.fullmatch (id, thread.name))) and \
(state is None or \
re.fullmatch (state, str (thread.state))) re.fullmatch (state, str (thread.state)))
def thread (id, state = None): def thread (id, state = None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment