Update tuna to latest upstream tuna-0.16
This commit is contained in:
parent
517ae7268a
commit
dd5f06e885
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@
|
||||
/tuna-0.14.tar.xz
|
||||
/tuna-0.14.1.tar.xz
|
||||
/tuna-0.15.tar.xz
|
||||
/tuna-0.16.tar.xz
|
||||
|
||||
@ -1,156 +0,0 @@
|
||||
From 4511a331b8ea986b0026277e4753538b749c0a29 Mon Sep 17 00:00:00 2001
|
||||
From: Jiri Kastner <jkastner@redhat.com>
|
||||
Date: Mon, 7 Jan 2019 21:57:56 +0100
|
||||
Subject: [PATCH] oscilloscope: move from pygtk2 to gtk3 gobject
|
||||
|
||||
oscilloscope migration from pygtk2 to gtk3 + python
|
||||
gobject introspection
|
||||
|
||||
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
||||
---
|
||||
oscilloscope-cmd.py | 5 ++++-
|
||||
tuna/oscilloscope.py | 47 ++++++++++++++++++++++++--------------------
|
||||
2 files changed, 30 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/oscilloscope-cmd.py b/oscilloscope-cmd.py
|
||||
index 753b879..b9c24b4 100755
|
||||
--- a/oscilloscope-cmd.py
|
||||
+++ b/oscilloscope-cmd.py
|
||||
@@ -20,7 +20,10 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
# USA
|
||||
|
||||
-import getopt, sys, gtk
|
||||
+import getopt, sys
|
||||
+import gi
|
||||
+gi.require_version('Gtk', '3.0')
|
||||
+from gi.repository import Gtk as gtk
|
||||
from tuna import oscilloscope
|
||||
|
||||
def usage():
|
||||
diff --git a/tuna/oscilloscope.py b/tuna/oscilloscope.py
|
||||
index b26f903..af54d83 100755
|
||||
--- a/tuna/oscilloscope.py
|
||||
+++ b/tuna/oscilloscope.py
|
||||
@@ -23,16 +23,21 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
# USA
|
||||
|
||||
-import gobject, gtk, os, sys
|
||||
-from matplotlib.backends.backend_gtkagg import \
|
||||
- FigureCanvasGTKAgg as figure_canvas
|
||||
+import os, sys, gi
|
||||
+gi.require_version('Gtk', '3.0')
|
||||
+from gi.repository import Gtk as gtk
|
||||
+from gi.repository import Gdk as gdk
|
||||
+from gi.repository import GObject as gobject
|
||||
+
|
||||
+from matplotlib.backends.backend_gtk3agg import \
|
||||
+ FigureCanvasGTK3Agg as figure_canvas
|
||||
import matplotlib.figure, matplotlib.ticker, numpy
|
||||
|
||||
class histogram_frame(gtk.Frame):
|
||||
def __init__(self, title = "Statistics", width = 780, height = 100,
|
||||
max_value = 500, nr_entries = 10,
|
||||
facecolor = "white"):
|
||||
- gtk.Frame.__init__(self, title)
|
||||
+ gtk.Frame.__init__(self)
|
||||
|
||||
self.fraction = int(max_value / nr_entries)
|
||||
if self.fraction == 0:
|
||||
@@ -69,7 +74,7 @@ class histogram_frame(gtk.Frame):
|
||||
label.set_alignment(0, 1)
|
||||
table.attach(self.buckets_counter[bucket], 2, 3, bucket, bucket + 1, 0, 0, 0, 0)
|
||||
|
||||
- self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(facecolor))
|
||||
+ self.modify_bg(gtk.StateFlags.NORMAL, gdk.color_parse(facecolor))
|
||||
|
||||
def add_sample(self, sample):
|
||||
if sample > self.max_value:
|
||||
@@ -97,7 +102,7 @@ class oscilloscope_frame(gtk.Frame):
|
||||
bg_color = "darkgreen", facecolor = "white",
|
||||
ylabel = "Latency", picker = None):
|
||||
|
||||
- gtk.Frame.__init__(self, title)
|
||||
+ gtk.Frame.__init__(self)
|
||||
|
||||
self.font = { 'fontname' : 'Liberation Sans',
|
||||
'color' : 'b',
|
||||
@@ -113,7 +118,7 @@ class oscilloscope_frame(gtk.Frame):
|
||||
facecolor = facecolor)
|
||||
ax = figure.add_subplot(111)
|
||||
self.ax = ax
|
||||
- ax.set_axis_bgcolor(bg_color)
|
||||
+ ax.set_facecolor(bg_color)
|
||||
|
||||
self.on_screen_samples = ax.plot(self.ind, self.samples, graph_type,
|
||||
color = plot_color,
|
||||
@@ -132,7 +137,7 @@ class oscilloscope_frame(gtk.Frame):
|
||||
self.canvas.set_size_request(width, height)
|
||||
|
||||
self.add(self.canvas)
|
||||
- self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(facecolor))
|
||||
+ self.modify_bg(gtk.StateFlags.NORMAL, gdk.color_parse(facecolor))
|
||||
self.nr_samples = 0
|
||||
|
||||
def add_sample(self, sample):
|
||||
@@ -164,9 +169,9 @@ def add_table_row(table, row, label_text, label_value = "0"):
|
||||
|
||||
class system_info_frame(gtk.Frame):
|
||||
def __init__(self, title = "System", facecolor = "white"):
|
||||
- gtk.Frame.__init__(self, title)
|
||||
+ gtk.Frame.__init__(self)
|
||||
|
||||
- self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(facecolor))
|
||||
+ self.modify_bg(gtk.StateFlags.NORMAL, gdk.color_parse(facecolor))
|
||||
|
||||
table = gtk.Table(3, 2, False)
|
||||
table.set_border_width(5)
|
||||
@@ -209,8 +214,8 @@ class oscilloscope(gtk.Window):
|
||||
vbox.set_border_width(8)
|
||||
self.add(vbox)
|
||||
|
||||
- stats_frame = gtk.Frame("Statistics")
|
||||
- stats_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(facecolor))
|
||||
+ stats_frame = gtk.Frame.new("Statistics")
|
||||
+ stats_frame.modify_bg(gtk.StateFlags.NORMAL, gdk.color_parse(facecolor))
|
||||
|
||||
table = gtk.Table(3, 2, False)
|
||||
table.set_border_width(5)
|
||||
@@ -222,8 +227,8 @@ class oscilloscope(gtk.Window):
|
||||
self.avg_label = add_table_row(table, 1, "Avg")
|
||||
self.max_label = add_table_row(table, 2, "Max")
|
||||
|
||||
- help_frame = gtk.Frame("Help")
|
||||
- help_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(facecolor))
|
||||
+ help_frame = gtk.Frame.new("Help")
|
||||
+ help_frame.modify_bg(gtk.StateFlags.NORMAL, gdk.color_parse(facecolor))
|
||||
|
||||
table = gtk.Table(4, 2, False)
|
||||
table.set_border_width(5)
|
||||
@@ -251,15 +256,15 @@ class oscilloscope(gtk.Window):
|
||||
info_frame = system_info_frame()
|
||||
|
||||
vbox_help_info = gtk.VBox()
|
||||
- vbox_help_info.pack_start(info_frame, False, False)
|
||||
- vbox_help_info.pack_end(help_frame, False, False)
|
||||
+ vbox_help_info.pack_start(info_frame, False, False, 0)
|
||||
+ vbox_help_info.pack_end(help_frame, False, False, 0)
|
||||
hbox = gtk.HBox()
|
||||
- hbox.pack_start(vbox_help_info, False, False)
|
||||
- hbox.pack_start(stats_frame, False, False)
|
||||
- hbox.pack_end(self.hist, True, True)
|
||||
+ hbox.pack_start(vbox_help_info, False, False, 0)
|
||||
+ hbox.pack_start(stats_frame, False, False, 0)
|
||||
+ hbox.pack_end(self.hist, True, True, 0)
|
||||
|
||||
- vbox.pack_start(self.scope, True, True)
|
||||
- vbox.pack_end(hbox, True, False)
|
||||
+ vbox.pack_start(self.scope, True, True, 0)
|
||||
+ vbox.pack_end(hbox, True, False, 0)
|
||||
|
||||
self.show_all()
|
||||
|
||||
--
|
||||
2.20.1
|
||||
|
||||
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (tuna-0.15.tar.xz) = de4e705fc126f087697dc31956ad80ee55a3ef932dcd0abfcacd31ff3fb4742061293f2de4e4e608b18d5840d320420dc64f746c6aa88adad38af1fb3bd968be
|
||||
SHA512 (tuna-0.16.tar.xz) = 971f3e91906c85830d1945fd876a961785d4741f4df53c701b4f8871bd8d2633327cfd994b80687fbb385fb4d3448a9280773c9a0c49db54fe9cf0983a6df80a
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
From cd9e707b23980ed568aeddac6eaa2125b651c6cc Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Wed, 3 Mar 2021 10:45:28 -0500
|
||||
Subject: [PATCH] tuna: Fix tuna --include option breakage
|
||||
|
||||
The change to remove the dependency on python-schedutils
|
||||
broke the --include function.
|
||||
|
||||
get_affinity(pid) from python-schedutils returned a list
|
||||
os.sched_getaffinity(pid) returns a set
|
||||
|
||||
In many cases they can be interchanged, but not with the '+' operation
|
||||
Fix this by changing affinity to a list before concatenation
|
||||
|
||||
Reported-by: Mark Simmons <msimmons@redhat.com>
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
tuna/tuna.py | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/tuna/tuna.py b/tuna/tuna.py
|
||||
index e5122dac1081..614a8250b054 100755
|
||||
--- a/tuna/tuna.py
|
||||
+++ b/tuna/tuna.py
|
||||
@@ -431,9 +431,9 @@ def include_cpus(cpus, nr_cpus):
|
||||
if err.args[0] == errno.ESRCH:
|
||||
continue
|
||||
raise err
|
||||
- if set(affinity).intersection(set(cpus)) != set(cpus):
|
||||
+ if affinity.intersection(set(cpus)) != set(cpus):
|
||||
previous_pid_affinities[pid] = copy.copy(affinity)
|
||||
- affinity = list(set(affinity + cpus))
|
||||
+ affinity = list(affinity) + cpus
|
||||
try:
|
||||
os.sched_setaffinity(pid, affinity)
|
||||
except OSError as err:
|
||||
@@ -453,9 +453,9 @@ def include_cpus(cpus, nr_cpus):
|
||||
if err.args[0] == errno.ESRCH:
|
||||
continue
|
||||
raise err
|
||||
- if set(affinity).intersection(set(cpus)) != set(cpus):
|
||||
+ if affinity.intersection(set(cpus)) != set(cpus):
|
||||
previous_pid_affinities[tid] = copy.copy(affinity)
|
||||
- affinity = list(set(affinity + cpus))
|
||||
+ affinity = list(affinity) + cpus
|
||||
try:
|
||||
os.sched_setaffinity(tid, affinity)
|
||||
except OSError as err:
|
||||
--
|
||||
2.26.3
|
||||
|
||||
10
tuna.spec
10
tuna.spec
@ -1,6 +1,6 @@
|
||||
Name: tuna
|
||||
Version: 0.15
|
||||
Release: 3%{?dist}
|
||||
Version: 0.16
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2
|
||||
Summary: Application tuning GUI & command line utility
|
||||
URL: https://git.kernel.org/pub/scm/utils/tuna/tuna.git
|
||||
@ -14,7 +14,6 @@ Requires: python3-linux-procfs >= 0.6
|
||||
# Requires: python-inet_diag
|
||||
|
||||
# Patches
|
||||
Patch1: tuna-Fix-tuna-include-option-breakage.patch
|
||||
|
||||
%description
|
||||
Provides interface for changing scheduler and IRQ tunables, at whole CPU and at
|
||||
@ -27,7 +26,6 @@ installed.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p1
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
@ -69,6 +67,10 @@ done
|
||||
%{_datadir}/polkit-1/actions/org.tuna.policy
|
||||
|
||||
%changelog
|
||||
* Wed Jun 30 2021 John Kacur <jkacur@redhat.com> - 0.16-1
|
||||
- Update to latest upstream tuna-0.16
|
||||
Resolves: rhbz#1890565
|
||||
|
||||
* Mon Jun 14 2021 John Kacur <jkacur@redhat.com> - 0.15-3
|
||||
- Remove oscilloscope from tuna
|
||||
Resolves: rhbz#1970997
|
||||
|
||||
Loading…
Reference in New Issue
Block a user