Updated to 0.4.6

This commit is contained in:
Jiri Kastner 2013-06-14 17:23:09 +02:00
parent f6422e6e22
commit 8796702743
3 changed files with 7 additions and 47 deletions

View File

@ -1,43 +0,0 @@
From 816b3fc12ed1eab106970db0cd493c14d0654005 Mon Sep 17 00:00:00 2001
From: Petr Oros <poros@redhat.com>
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 <poros@redhat.com>
---
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

View File

@ -4,13 +4,13 @@
Name: python-linux-procfs
Version: 0.4.5
Version: 0.4.6
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
# 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
@ -21,7 +21,7 @@ Abstractions to extract information from the Linux kernel /proc files.
%prep
%setup -q
%patch0 -p1
# %patch0 -p1
%build
%{__python} setup.py build
@ -43,6 +43,9 @@ rm -rf %{buildroot}
%doc COPYING
%changelog
* Wed Jun 14 2013 Jiri Kastner <jkastner@redhat.com> - 0.4.6-1
- updated to 0.4.6
* Thu Jun 6 2013 Jiri Kastner <jkastner@redhat.com> - 0.4.5-1
- Added support for parsing cgroups as a per thread attribute

View File

@ -1 +1 @@
e7356567cf318018a0bb34f51dc55777 python-linux-procfs-0.4.5.tar.bz2
91807f1a1dcf09372c15e76061ca1342 python-linux-procfs-0.4.6.tar.bz2