Updated to 0.4.6
This commit is contained in:
parent
f6422e6e22
commit
8796702743
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user