Discussion:
[PATCH] Split out oscilloscope from tuna
David Sommerseth
2013-12-04 20:47:31 UTC
Permalink
This removes the dependency of tuna in the oscilloscope package and
prepares the ground for packaging oscilloscope separately later on.

Signed-off-by: David Sommerseth <davids at redhat.com>
---
MANIFEST | 7 ++++--
oscilloscope-cmd.py | 2 +-
tuna/oscilloscope.py => oscilloscope/__init__.py | 0
rpm/SPECS/tuna.spec | 9 +++++--
setup-oscilloscope.py | 31 ++++++++++++++++++++++++
5 files changed, 44 insertions(+), 5 deletions(-)
rename tuna/oscilloscope.py => oscilloscope/__init__.py (100%)
create mode 100644 setup-oscilloscope.py

diff --git a/MANIFEST b/MANIFEST
index 95ae7c5..16b6cad 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,10 +1,8 @@
help/kthreads/
-oscilloscope-cmd.py
tuna-cmd.py
tuna/__init__.py
tuna/help.py
tuna/sysfs.py
-tuna/oscilloscope.py
tuna/tuna.py
tuna/config.py
tuna/tuna_gui.py
@@ -28,3 +26,8 @@ ChangeLog
docs/oscilloscope+tuna.html
docs/oscilloscope+tuna.pdf
docs/tuna.8
+etc/
+org.tuna.policy
+setup-oscilloscope.py
+oscilloscope-cmd.py
+oscilloscope/
diff --git a/oscilloscope-cmd.py b/oscilloscope-cmd.py
index c6de41f..3d5ae5b 100755
--- a/oscilloscope-cmd.py
+++ b/oscilloscope-cmd.py
@@ -21,7 +21,7 @@
# USA

import getopt, sys, gtk
-from tuna import oscilloscope
+import oscilloscope

def usage():
print '''Usage: oscilloscope [OPTIONS]
diff --git a/tuna/oscilloscope.py b/oscilloscope/__init__.py
similarity index 100%
rename from tuna/oscilloscope.py
rename to oscilloscope/__init__.py
diff --git a/rpm/SPECS/tuna.spec b/rpm/SPECS/tuna.spec
index 9393df6..f82e667 100644
--- a/rpm/SPECS/tuna.spec
+++ b/rpm/SPECS/tuna.spec
@@ -3,7 +3,7 @@

Name: tuna
Version: 0.11.1
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2
Summary: Application tuning GUI & command line utility
Group: Applications/System
@@ -33,7 +33,6 @@ Group: Applications/System
Requires: python-matplotlib
Requires: numpy
Requires: pygtk2
-Requires: tuna = %{version}-%{release}

%description -n oscilloscope
Plots stream of values read from standard input on the screen together with
@@ -48,10 +47,12 @@ priority is changed, be it using tuna or plain chrt & taskset.

%build
%{__python} setup.py build
+%{__python} setup-oscilloscope.py build

%install
rm -rf %{buildroot}
%{__python} setup.py install --skip-build --root %{buildroot}
+%{__python} setup-oscilloscope.py install --skip-build --root %{buildroot}
mkdir -p %{buildroot}/%{_sysconfdir}/tuna/
mkdir -p %{buildroot}/{%{_bindir},%{_datadir}/tuna/help/kthreads,%{_mandir}/man8}
mkdir -p %{buildroot}/%{_datadir}/polkit-1/actions/
@@ -93,10 +94,14 @@ rm -rf %{buildroot}
%files -n oscilloscope
%defattr(-,root,root,-)
%{_bindir}/oscilloscope
+%{python_sitelib}/oscilloscope/
%doc docs/oscilloscope+tuna.html
%doc docs/oscilloscope+tuna.pdf

%changelog
+* Wed Dec 4 2013 David Sommerseth <davids at redhat.com> - 0.11.1-2
+- Removing tuna dependency in oscilloscope, repacking it as a separate module
+
* Fri Feb 1 2013 Arnaldo Carvalho de Melo <acme at redhat.com> - 0.10.4-1
- New upstream release

diff --git a/setup-oscilloscope.py b/setup-oscilloscope.py
new file mode 100644
index 0000000..730c14f
--- /dev/null
+++ b/setup-oscilloscope.py
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+from distutils.sysconfig import get_python_lib
+from distutils.core import setup
+from os.path import isfile, join
+import glob
+import os
+
+#if isfile("MANIFEST"):
+# os.unlink("MANIFEST")
+
+# Get PYTHONLIB with no prefix so --prefix installs work.
+PYTHONLIB = join(get_python_lib(standard_lib=1, prefix=''), 'site-packages')
+
+setup(name="oscilloscope",
+ version = "0.11.1",
+ description = "Application tuning GUI",
+ author = "Arnaldo Carvalho de Melo",
+ author_email = "acme at redhat.com",
+ url = "http://userweb.kernel.org/tuna",
+ license = "GPLv2",
+ long_description =
+"""\
+Plots stream of values read from standard input on the screen together with
+statistics and a histogram.
+
+Allows to instantly see how a signal generator, such as cyclictest, signaltest
+or even ping, reacts when, for instance, its scheduling policy or real time
+priority is changed, be it using tuna or plain chrt & taskset.
+""",
+ packages = ["oscilloscope"],
+ )
--
1.8.3.1
Jiri Kastner
2013-12-05 09:42:24 UTC
Permalink
i like more idea of 'cutting off' oscilloscope from tuna as it has more common with rt-tests then with tuna itself.

j.
Post by David Sommerseth
This removes the dependency of tuna in the oscilloscope package and
prepares the ground for packaging oscilloscope separately later on.
Signed-off-by: David Sommerseth <davids at redhat.com>
---
MANIFEST | 7 ++++--
oscilloscope-cmd.py | 2 +-
tuna/oscilloscope.py => oscilloscope/__init__.py | 0
rpm/SPECS/tuna.spec | 9 +++++--
setup-oscilloscope.py | 31 ++++++++++++++++++++++++
5 files changed, 44 insertions(+), 5 deletions(-)
rename tuna/oscilloscope.py => oscilloscope/__init__.py (100%)
create mode 100644 setup-oscilloscope.py
diff --git a/MANIFEST b/MANIFEST
index 95ae7c5..16b6cad 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,10 +1,8 @@
help/kthreads/
-oscilloscope-cmd.py
tuna-cmd.py
tuna/__init__.py
tuna/help.py
tuna/sysfs.py
-tuna/oscilloscope.py
tuna/tuna.py
tuna/config.py
tuna/tuna_gui.py
@@ -28,3 +26,8 @@ ChangeLog
docs/oscilloscope+tuna.html
docs/oscilloscope+tuna.pdf
docs/tuna.8
+etc/
+org.tuna.policy
+setup-oscilloscope.py
+oscilloscope-cmd.py
+oscilloscope/
diff --git a/oscilloscope-cmd.py b/oscilloscope-cmd.py
index c6de41f..3d5ae5b 100755
--- a/oscilloscope-cmd.py
+++ b/oscilloscope-cmd.py
@@ -21,7 +21,7 @@
# USA
import getopt, sys, gtk
-from tuna import oscilloscope
+import oscilloscope
print '''Usage: oscilloscope [OPTIONS]
diff --git a/tuna/oscilloscope.py b/oscilloscope/__init__.py
similarity index 100%
rename from tuna/oscilloscope.py
rename to oscilloscope/__init__.py
diff --git a/rpm/SPECS/tuna.spec b/rpm/SPECS/tuna.spec
index 9393df6..f82e667 100644
--- a/rpm/SPECS/tuna.spec
+++ b/rpm/SPECS/tuna.spec
@@ -3,7 +3,7 @@
Name: tuna
Version: 0.11.1
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2
Summary: Application tuning GUI & command line utility
Group: Applications/System
@@ -33,7 +33,6 @@ Group: Applications/System
Requires: python-matplotlib
Requires: numpy
Requires: pygtk2
-Requires: tuna = %{version}-%{release}
%description -n oscilloscope
Plots stream of values read from standard input on the screen together with
@@ -48,10 +47,12 @@ priority is changed, be it using tuna or plain chrt & taskset.
%build
%{__python} setup.py build
+%{__python} setup-oscilloscope.py build
%install
rm -rf %{buildroot}
%{__python} setup.py install --skip-build --root %{buildroot}
+%{__python} setup-oscilloscope.py install --skip-build --root %{buildroot}
mkdir -p %{buildroot}/%{_sysconfdir}/tuna/
mkdir -p %{buildroot}/{%{_bindir},%{_datadir}/tuna/help/kthreads,%{_mandir}/man8}
mkdir -p %{buildroot}/%{_datadir}/polkit-1/actions/
@@ -93,10 +94,14 @@ rm -rf %{buildroot}
%files -n oscilloscope
%defattr(-,root,root,-)
%{_bindir}/oscilloscope
+%{python_sitelib}/oscilloscope/
%doc docs/oscilloscope+tuna.html
%doc docs/oscilloscope+tuna.pdf
%changelog
+* Wed Dec 4 2013 David Sommerseth <davids at redhat.com> - 0.11.1-2
+- Removing tuna dependency in oscilloscope, repacking it as a separate module
+
* Fri Feb 1 2013 Arnaldo Carvalho de Melo <acme at redhat.com> - 0.10.4-1
- New upstream release
diff --git a/setup-oscilloscope.py b/setup-oscilloscope.py
new file mode 100644
index 0000000..730c14f
--- /dev/null
+++ b/setup-oscilloscope.py
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+from distutils.sysconfig import get_python_lib
+from distutils.core import setup
+from os.path import isfile, join
+import glob
+import os
+
+# os.unlink("MANIFEST")
+
+# Get PYTHONLIB with no prefix so --prefix installs work.
+PYTHONLIB = join(get_python_lib(standard_lib=1, prefix=''), 'site-packages')
+
+setup(name="oscilloscope",
+ version = "0.11.1",
+ description = "Application tuning GUI",
+ author = "Arnaldo Carvalho de Melo",
+ author_email = "acme at redhat.com",
+ url = "http://userweb.kernel.org/tuna",
+ license = "GPLv2",
+ long_description =
+"""\
+Plots stream of values read from standard input on the screen together with
+statistics and a histogram.
+
+Allows to instantly see how a signal generator, such as cyclictest, signaltest
+or even ping, reacts when, for instance, its scheduling policy or real time
+priority is changed, be it using tuna or plain chrt & taskset.
+""",
+ packages = ["oscilloscope"],
+ )
--
1.8.3.1
_______________________________________________
tuna-devel mailing list
tuna-devel at lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/tuna-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/tuna-devel/attachments/20131205/464eab43/attachment.sig>
David Sommerseth
2013-12-05 10:39:45 UTC
Permalink
Post by Jiri Kastner
i like more idea of 'cutting off' oscilloscope from tuna as it has
more common with rt-tests then with tuna itself.
Agreed! oscilloscope is really useful when joined with cyclictest. And
that's basically the path which this patch starts.

Next step is to rip out the oscilloscope parts from tuna.spec and
MANIFEST. Then to put the following files into a new git repository and
remove them from the tuna git repo:

oscilloscope/*
oscilloscope-cmd
setup-oscilloscope.py (rename to setup.py in new repo)

Then create a new MANIFEST file into the oscilloscope.git tree and copy
over the needed stuff from tuna.spec to oscilloscope.spec. And the
Makefile might also need some minor adjustments when being copied over
to oscilloscope too.

As I know there's some planned steps to rework the packaging parts, I
didn't want to put too much energy into splitting out the oscilloscope
parts from tuna.spec and Makefile yet.

We also need to bear in mind that we probably need to do some packaging
changes in RHEL too, as we currently ship a unified src.rpm with
tuna+oscilloscope. We need to ensure that splitting out oscilloscope
into a separate src.rpm won't cause troubles due to lack of coordination
with the rel-eng team.

With just this patch in place, nothing currently changes in the src.rpm,
it just cleans up the dependency on tuna in the oscilloscope package.


David S.
Post by Jiri Kastner
Post by David Sommerseth
This removes the dependency of tuna in the oscilloscope package and
prepares the ground for packaging oscilloscope separately later on.
Signed-off-by: David Sommerseth <davids at redhat.com>
---
MANIFEST | 7 ++++--
oscilloscope-cmd.py | 2 +-
tuna/oscilloscope.py => oscilloscope/__init__.py | 0
rpm/SPECS/tuna.spec | 9 +++++--
setup-oscilloscope.py | 31 ++++++++++++++++++++++++
5 files changed, 44 insertions(+), 5 deletions(-)
rename tuna/oscilloscope.py => oscilloscope/__init__.py (100%)
create mode 100644 setup-oscilloscope.py
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <https://lists.fedorahosted.org/pipermail/tuna-devel/attachments/20131205/a222f447/attachment.sig>
Arnaldo Carvalho de Melo
2013-12-05 17:50:29 UTC
Permalink
Post by David Sommerseth
Post by Jiri Kastner
i like more idea of 'cutting off' oscilloscope from tuna as it has
more common with rt-tests then with tuna itself.
Agreed! oscilloscope is really useful when joined with cyclictest. And
that's basically the path which this patch starts.
The idea was that you tune + observe the impact of tuning.

Tuna tunes, oscilloscope shows effect of such tuning, cyclictest was
just the easiest metric generator available, but it could be any other.

- Arnaldo
David Sommerseth
2013-12-05 18:39:12 UTC
Permalink
Post by Arnaldo Carvalho de Melo
Post by David Sommerseth
Post by Jiri Kastner
i like more idea of 'cutting off' oscilloscope from tuna as it has
more common with rt-tests then with tuna itself.
Agreed! oscilloscope is really useful when joined with cyclictest. And
that's basically the path which this patch starts.
The idea was that you tune + observe the impact of tuning.
Tuna tunes, oscilloscope shows effect of such tuning, cyclictest was
just the easiest metric generator available, but it could be any other.
Fair enough. But when considering that oscilloscope can work pretty
nicely separately makes it somewhat odd for an explicit tuna dependency.
If tuna gets more fancy in the future and implements an integrated
oscilloscope view, it would make more sense that tuna depends on
oscilloscope and not the other way around like now.

The reason for suggesting this split is also primarily packaging wise.
Especially for RHEL packaging where tuna is now a "standard" package
while oscilloscope is "optional". In addition, there's quite some
aversion among the "management layer" for packages which have an
explicit dependency between packages in "standard" and "optional". So
it's just to get resolve these issues, without introducing too many
other challenges.


David S.
Arnaldo Carvalho de Melo
2013-12-06 00:21:12 UTC
Permalink
Post by David Sommerseth
Post by Arnaldo Carvalho de Melo
Post by David Sommerseth
Post by Jiri Kastner
i like more idea of 'cutting off' oscilloscope from tuna as it has
more common with rt-tests then with tuna itself.
Agreed! oscilloscope is really useful when joined with cyclictest. And
that's basically the path which this patch starts.
The idea was that you tune + observe the impact of tuning.
Tuna tunes, oscilloscope shows effect of such tuning, cyclictest was
just the easiest metric generator available, but it could be any other.
Fair enough. But when considering that oscilloscope can work pretty
nicely separately makes it somewhat odd for an explicit tuna dependency.
If tuna gets more fancy in the future and implements an integrated
oscilloscope view, it would make more sense that tuna depends on
oscilloscope and not the other way around like now.
The reason for suggesting this split is also primarily packaging wise.
Especially for RHEL packaging where tuna is now a "standard" package
while oscilloscope is "optional". In addition, there's quite some
aversion among the "management layer" for packages which have an
explicit dependency between packages in "standard" and "optional". So
it's just to get resolve these issues, without introducing too many
other challenges.
Its nice to write code, better than that is to see people feel what you
felt and keep written code alive.

Thanks,

- Arnaldo
Jiri Kastner
2013-12-06 13:21:34 UTC
Permalink
ok, what about this:
instead of split oscilloscope from tuna, we can abandon 'oscilloscope' subpackage and merge it to tuna, so next version should have "Provides : oscilloscope = %{version}-%{release}" and "Obsoletes: oscilloscope < %{version}-%{release}", instead of oscilloscope subpackage in spec file.

this 'spec' solution should resolve base/optional channel struggles.

On Thu, Dec 05, 2013 at 10:21:12PM -0200, Arnaldo Carvalho de Melo wrote:
...
Post by Arnaldo Carvalho de Melo
Post by David Sommerseth
The reason for suggesting this split is also primarily packaging wise.
Especially for RHEL packaging where tuna is now a "standard" package
while oscilloscope is "optional". In addition, there's quite some
aversion among the "management layer" for packages which have an
explicit dependency between packages in "standard" and "optional". So
it's just to get resolve these issues, without introducing too many
other challenges.
Its nice to write code, better than that is to see people feel what you
felt and keep written code alive.
Thanks,
- Arnaldo
_______________________________________________
tuna-devel mailing list
tuna-devel at lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/tuna-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/tuna-devel/attachments/20131206/d9c1d705/attachment.sig>
Arnaldo Carvalho de Melo
2013-12-06 13:36:42 UTC
Permalink
Post by Jiri Kastner
instead of split oscilloscope from tuna, we can abandon 'oscilloscope' subpackage and merge it to tuna, so next version should have "Provides : oscilloscope = %{version}-%{release}" and "Obsoletes: oscilloscope < %{version}-%{release}", instead of oscilloscope subpackage in spec file.
this 'spec' solution should resolve base/optional channel struggles.
Nope, splitting it up is the best thing to do.

The oscilloscope is not tuna specific or tied to tuna, it just started
there.

But it can be used completely independently, i.e. one can use any other
way to tune its system and use it to check visually for spikes.

And apart from that, it addresses the "optional" being required by a
"standard" package in RHEL channels.

There is another gotcha here:

The oscilloscope needs the GUI packages to work, but tuna doesn't...

I.e. if, say, pygtk2 is not installed, the command line tuna can be
used, its just its GUI that won't be available, so tuna has code to
handle that:

[root at ssdandy ~]# rpm -e --nodeps pygtk2
[root at ssdandy ~]# tuna
tuna: packages needed for the GUI missing.
Make sure xauth, pygtk2-libglade are installed.
Usage: tuna [OPTIONS]
-h, --help Give this help list
-a, --config_file_apply=profilename Apply changes described in profile
-l, --config_file_list List preloaded profiles
-g, --gui Start the GUI
-G, --cgroup Display the processes with the type of cgroups they are in
-c, --cpus=CPU-LIST CPU-LIST affected by commands
-C, --affect_children Operation will affect children threads
-f, --filter Display filter the selected entities
-i, --isolate Move all threads away from CPU-LIST
-I, --include Allow all threads to run on CPU-LIST
-K, --no_kthreads Operations will not affect kernel threads
-m, --move Move selected entities to CPU-LIST
-p, --priority=[POLICY:]RTPRIO Set thread scheduler tunables: POLICY and RTPRIO
-P, --show_threads Show thread list
-Q, --show_irqs Show IRQ list
-q, --irqs=IRQ-LIST IRQ-LIST affected by commands
-s, --save=FILENAME Save kthreads sched tunables to FILENAME
-S, --sockets=CPU-SOCKET-LIST CPU-SOCKET-LIST affected by commands
-t, --threads=THREAD-LIST THREAD-LIST affected by commands
-U, --no_uthreads Operations will not affect user threads
-v, --version Show version
-W, --what_is Provides help about selected entities
-x, --spread Spread selected entities over CPU-LIST
[root at ssdandy ~]# tuna --gui
tuna: packages needed for the GUI missing.
Make sure xauth, pygtk2-libglade are installed.

I.e. if you call it without any arguments or with --gui it will try to start
the GUI and if the required packages are not installed, it will fail and state
which packages needs to be installed.

Now it may be the case that the 'tuna' rpm package doesn't requires the GUI
packages needed to run --gui, and installing the oscilloscope will bring those
packages. That may be why the oscilloscope ended up being a tuna req.

What I think should be done is to have a new, virtual package: "tuna-gui", that
basically has just requires for (tuna, xauth, pygtk2-libglade), then the GUI will
be enabled.

- Arnaldo
Post by Jiri Kastner
...
Post by David Sommerseth
The reason for suggesting this split is also primarily packaging wise.
Especially for RHEL packaging where tuna is now a "standard" package
while oscilloscope is "optional". In addition, there's quite some
aversion among the "management layer" for packages which have an
explicit dependency between packages in "standard" and "optional". So
it's just to get resolve these issues, without introducing too many
other challenges.
Jiri Kastner
2013-12-06 13:52:53 UTC
Permalink
Post by Arnaldo Carvalho de Melo
[root at ssdandy ~]# tuna --gui
tuna: packages needed for the GUI missing.
Make sure xauth, pygtk2-libglade are installed.
I.e. if you call it without any arguments or with --gui it will try to start
the GUI and if the required packages are not installed, it will fail and state
which packages needs to be installed.
Now it may be the case that the 'tuna' rpm package doesn't requires the GUI
packages needed to run --gui, and installing the oscilloscope will bring those
packages. That may be why the oscilloscope ended up being a tuna req.
What I think should be done is to have a new, virtual package: "tuna-gui", that
basically has just requires for (tuna, xauth, pygtk2-libglade), then the GUI will
be enabled.
well, in rt-tests on kernel.org are some python scripts, so why not to move oscilloscpoe there

j.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/tuna-devel/attachments/20131206/cf99f953/attachment.sig>
Loading...