John Kacur
2021-04-13 20:38:03 UTC
When in perf mode (so not polling) previously the GUI would be
refreshed at the arrival of any single perf event. This may mean
that it would get refreshed all the time especially on quite loaded
systems, causing very high CPU load and unuseable GUI.
The patch limits the refresh to the minimum refresh_time (already
used for polling and configurable via -R command line by the user)
to prevent such cases. If no events arrive, the GUI will still not
be refreshed at all as before.
---
tuna/gui/procview.py | 14 ++++++++++----
tuna/tuna_gui.py | 2 +-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/tuna/gui/procview.py b/tuna/gui/procview.py
index c224e4b..dc2e94e 100755
--- a/tuna/gui/procview.py
+++ b/tuna/gui/procview.py
self.treeview = treeview
self.nr_cpus = procfs.cpuinfo().nr_cpus
self.gladefile = gladefile
+ self.evlist_added = True
self.evlist = None
self.perf_counter[tid] = event.sample_period
- self.show()
+ self.evlist_added = True # Mark that event arrived, so next periodic show() will refresh GUI
return True
# create the rows.
return
- row = self.tree_store.get_iter_first()
- self.update_rows(self.ps, row, None)
- self.treeview.show_all()
+
+ # If using perf only refresh if we saw at least a new event since last refresh
+ self.evlist_added = None
+
+ row = self.tree_store.get_iter_first()
+ self.update_rows(self.ps, row, None)
+ self.treeview.show_all()
new_tids = list(threads.keys())
diff --git a/tuna/tuna_gui.py b/tuna/tuna_gui.py
index 83af063..f1f2caa 100755
--- a/tuna/tuna_gui.py
+++ b/tuna/tuna_gui.py
if not self.procview.evlist: # Poll, as we don't have perf
self.ps.reload()
self.ps.reload_threads()
- self.procview.show()
+ self.procview.show()
self.irqview.refresh()
return True
--
2.26.3
I like the idea but the patch does not apply cleanly, do you want to takerefreshed at the arrival of any single perf event. This may mean
that it would get refreshed all the time especially on quite loaded
systems, causing very high CPU load and unuseable GUI.
The patch limits the refresh to the minimum refresh_time (already
used for polling and configurable via -R command line by the user)
to prevent such cases. If no events arrive, the GUI will still not
be refreshed at all as before.
---
tuna/gui/procview.py | 14 ++++++++++----
tuna/tuna_gui.py | 2 +-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/tuna/gui/procview.py b/tuna/gui/procview.py
index c224e4b..dc2e94e 100755
--- a/tuna/gui/procview.py
+++ b/tuna/gui/procview.py
self.treeview = treeview
self.nr_cpus = procfs.cpuinfo().nr_cpus
self.gladefile = gladefile
+ self.evlist_added = True
self.evlist = None
self.perf_counter[tid] = event.sample_period
- self.show()
+ self.evlist_added = True # Mark that event arrived, so next periodic show() will refresh GUI
return True
# create the rows.
return
- row = self.tree_store.get_iter_first()
- self.update_rows(self.ps, row, None)
- self.treeview.show_all()
+
+ # If using perf only refresh if we saw at least a new event since last refresh
+ self.evlist_added = None
+
+ row = self.tree_store.get_iter_first()
+ self.update_rows(self.ps, row, None)
+ self.treeview.show_all()
new_tids = list(threads.keys())
diff --git a/tuna/tuna_gui.py b/tuna/tuna_gui.py
index 83af063..f1f2caa 100755
--- a/tuna/tuna_gui.py
+++ b/tuna/tuna_gui.py
if not self.procview.evlist: # Poll, as we don't have perf
self.ps.reload()
self.ps.reload_threads()
- self.procview.show()
+ self.procview.show()
self.irqview.refresh()
return True
--
2.26.3
a look?
Thanks
John
_______________________________________________
tuna-devel mailing list -- tuna-***@lists.fedorahosted.org
To unsubscribe send an email to tuna-devel-***@lists.fedorahosted.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedorahosted.org/archives/list/tuna-***@lists.fedorahosted.org
Do not reply to spam on the list, report it: https://pagure.io/fedora-i