diff --git a/.gitignore b/.gitignore index 73a9714..e107621 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ python-linux-procfs-0.4.4.tar.bz2 +/python-linux-procfs-0.4.6.tar.bz2 +/python-linux-procfs-0.4.5.tar.bz2 diff --git a/0001-pidstats-Added-support-for-parsing-cgroups-as-a-per-.patch b/0001-pidstats-Added-support-for-parsing-cgroups-as-a-per-.patch new file mode 100644 index 0000000..a122982 --- /dev/null +++ b/0001-pidstats-Added-support-for-parsing-cgroups-as-a-per-.patch @@ -0,0 +1,43 @@ +From 816b3fc12ed1eab106970db0cd493c14d0654005 Mon Sep 17 00:00:00 2001 +From: Petr Oros +Date: Wed, 27 Mar 2013 09:38:07 +0100 +Subject: [PATCH] pidstats: Added support for parsing cgroups as a per thread attribute + +Signed-off-by: Petr Oros +--- + procfs/procfs.py | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +diff --git a/procfs/procfs.py b/procfs/procfs.py +index c0ceec8..533a709 100755 +--- a/procfs/procfs.py ++++ b/procfs/procfs.py +@@ -165,6 +165,8 @@ class process: + self.load_cmdline() + elif attr == "threads": + self.load_threads() ++ elif attr == "cgroups": ++ self.load_cgroups() + + return getattr(self, attr) + +@@ -181,6 +183,16 @@ class process: + # remove thread leader + del self.threads[self.pid] + ++ def load_cgroups(self): ++ f = file("/proc/%d/cgroup" % self.pid) ++ self.cgroups = "" ++ for line in reversed(f.readlines()): ++ if len(self.cgroups): ++ self.cgroups = self.cgroups + "," + line[:-1] ++ else: ++ self.cgroups = line[:-1] ++ f.close() ++ + class pidstats: + + def __init__(self, basedir = "/proc"): +-- +1.7.1 + diff --git a/python-linux-procfs.spec b/python-linux-procfs.spec index 349a6fa..46fa144 100644 --- a/python-linux-procfs.spec +++ b/python-linux-procfs.spec @@ -1,13 +1,16 @@ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python_ver: %define python_ver %(%{__python} -c "import sys ; print sys.version[:3]")} + + Name: python-linux-procfs -Version: 0.4.4 -Release: 8%{?dist} +Version: 0.4.5 +Release: 1%{?dist} License: GPLv2 Summary: Linux /proc abstraction classes Group: System Environment/Libraries Source: http://userweb.kernel.org/~acme/python-linux-procfs/%{name}-%{version}.tar.bz2 +Patch0: 0001-pidstats-Added-support-for-parsing-cgroups-as-a-per-.patch URL: http://userweb.kernel.org/~acme/python-linux-procfs BuildArch: noarch BuildRequires: python-devel @@ -18,6 +21,7 @@ Abstractions to extract information from the Linux kernel /proc files. %prep %setup -q +%patch0 -p1 %build %{__python} setup.py build @@ -39,6 +43,9 @@ rm -rf %{buildroot} %doc COPYING %changelog +* Thu Jun 6 2013 Jiri Kastner - 0.4.5-1 +- Added support for parsing cgroups as a per thread attribute + * Thu Feb 14 2013 Fedora Release Engineering - 0.4.4-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild diff --git a/sources b/sources index 1d73bbb..811a630 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7209283a013e3358bad7dc4c3b19c109 python-linux-procfs-0.4.4.tar.bz2 +e7356567cf318018a0bb34f51dc55777 python-linux-procfs-0.4.5.tar.bz2