[gimp/gimp-2-10] tools: a few improvements in performance-log-viewer.py
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] tools: a few improvements in performance-log-viewer.py
- Date: Wed, 7 Nov 2018 19:27:12 +0000 (UTC)
commit 9489b66eec8cec01de5e335f02e81ec630f634e8
Author: Ell <ell_se yahoo com>
Date: Wed Nov 7 13:59:36 2018 -0500
tools: a few improvements in performance-log-viewer.py
In sample-search predicates, remove the "exclusive" parameter of
the "function()" function, and replace it with optional "id" and
"state" parameters, which limit the match to the call-stacks of
matching threads, as per the "thread()" function.
Sort the backtrace thread-list by thread ID.
(cherry picked from commit 0b2d41635ab7b2c158925fa11a6537fdfb4af046)
tools/performance-log-viewer.py | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/tools/performance-log-viewer.py b/tools/performance-log-viewer.py
index 1e19353f61..2c84ed8858 100755
--- a/tools/performance-log-viewer.py
+++ b/tools/performance-log-viewer.py
@@ -726,23 +726,22 @@ class FindSamplesPopover (Gtk.Popover):
for i in range (len (samples)):
try:
- def thread (id, state = None):
- for thread in samples[i].backtrace or []:
- if (type (id) == int and id == thread.id) or \
- (type (id) == str and thread.name and \
- re.fullmatch (id, thread.name)):
- if state is None or \
- re.fullmatch (state, str (thread.state)):
- return True
+ def match_thread (thread, id, state = None):
+ return (type (id) == int and \
+ id == thread.id) or \
+ (type (id) == str and \
+ thread.name and \
+ re.fullmatch (id, thread.name)) and \
+ (state is None or \
+ re.fullmatch (state, str (thread.state)))
- return False
+ def thread (id, state = None):
+ return any (match_thread (thread, id, state)
+ for thread in samples[i].backtrace or [])
- def function (name, exclusive = False):
+ def function (name, id = None, state = None):
for thread in samples[i].backtrace or []:
- if exclusive:
- if re.fullmatch (name, thread.frames[0].info.name):
- return True
- else:
+ if match_thread (thread, id, state):
for frame in thread.frames:
if re.fullmatch (name, frame.info.name):
return True
@@ -1887,6 +1886,7 @@ class BacktraceViewer (Gtk.Box):
store = self.ThreadStore ()
self.thread_store = store
+ store.set_sort_column_id (store.ID, Gtk.SortType.ASCENDING)
tree = Gtk.TreeView (model = store)
self.thread_tree = tree
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]