Damian Johnson <atagar1@xxxxxxxxx> wrote: > Hi everyone. The next version of arm (1.4.1) is available including > the proc querying enhancements, Fabian's BSD compatibility patches, > and numerous other improvements: > https://blog.torproject.org/blog/arm-release-141 > > Updates to the packages and repositories will be staggered a week > (just in case issues are discovered over the next new days). Feedback > and bug reports are always welcome! -Damian I'm a bit behind on my Tor-related mails, so this one is out of order. Anyway, 1.4.1 seems to have issues in the !self._useProc case and (at least on FreeBSD) messes up the screen with exceptions like these if Tor has only recently been started: Exception in thread Thread-3: Traceback (most recent call last): File "/usr/local/lib/python2.6/threading.py", line 532, in __bootstrap_inner self.run() File "/usr/home/fk/arm/src/util/sysTools.py", line 538, in run newValues["cpuSampling"] = newValues["cpuAvg"] KeyError: 'cpuAvg' The attached patch (0003) seems to fix it for me, but I didn't properly test it yet. Fabian
From 0400ec3b28acd5818763f9f30a6b93275c228927 Mon Sep 17 00:00:00 2001 From: Fabian Keil <fk@xxxxxxxxxxxxx> Date: Tue, 11 Jan 2011 17:56:28 +0100 Subject: [PATCH 1/3] Fix the ps output in a comment --- src/util/sysTools.py | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/sysTools.py b/src/util/sysTools.py index ad9cd3c..b303d24 100644 --- a/src/util/sysTools.py +++ b/src/util/sysTools.py @@ -479,8 +479,9 @@ class ResourceTracker(threading.Thread): newValues["memUsagePercentage"] = float(memUsage) / totalMemory else: # the ps call formats results as: - # %CPU RSS %MEM ELAPSED - # 0.3 14096 1.3 29:51 + # TIME ELAPSED RSS %MEM + # 3-08:06:32 21-00:00:12 121844 23.5 + psCall = call("ps -p %s -o cputime,etime,rss,%%mem" % self.processPid) isSuccessful = False -- 1.7.3.5
From c18fc6796b7210fb5bb464b8e1e6105556e44a9f Mon Sep 17 00:00:00 2001 From: Fabian Keil <fk@xxxxxxxxxxxxx> Date: Tue, 11 Jan 2011 18:01:22 +0100 Subject: [PATCH 2/3] Mention another possible ps output that isn't yet covered --- src/util/sysTools.py | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/util/sysTools.py b/src/util/sysTools.py index b303d24..cea9374 100644 --- a/src/util/sysTools.py +++ b/src/util/sysTools.py @@ -479,8 +479,14 @@ class ResourceTracker(threading.Thread): newValues["memUsagePercentage"] = float(memUsage) / totalMemory else: # the ps call formats results as: + # # TIME ELAPSED RSS %MEM # 3-08:06:32 21-00:00:12 121844 23.5 + # + # or if Tor has only recently been started: + # + # TIME ELAPSED RSS %MEM + # 0:04.40 37:57 18772 0.9 psCall = call("ps -p %s -o cputime,etime,rss,%%mem" % self.processPid) -- 1.7.3.5
From cfa1a3b06f8fabe8b0ddffa56ecc0d1b5fff6e5e Mon Sep 17 00:00:00 2001 From: Fabian Keil <fk@xxxxxxxxxxxxx> Date: Tue, 11 Jan 2011 18:30:39 +0100 Subject: [PATCH 3/3] Let parseShortTimeLabel() deal with timestamps that use a dot between minutes and seconds --- src/util/uiTools.py | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/util/uiTools.py b/src/util/uiTools.py index 854ca39..07ea949 100644 --- a/src/util/uiTools.py +++ b/src/util/uiTools.py @@ -333,7 +333,7 @@ def parseShortTimeLabel(timeEntry): """ Provides the number of seconds corresponding to the formatting used for the cputime and etime fields of ps: - [[dd-]hh:]mm:ss + [[dd-]hh:]mm:ss or hh:mm.ss If the input entry is malformed then this raises a ValueError. @@ -349,6 +349,9 @@ def parseShortTimeLabel(timeEntry): days = int(timeEntry[:dateDivider]) timeEntry = timeEntry[dateDivider+1:] + # normalise the seconds delimiter + timeEntry = timeEntry.replace(".", ":") + timeComp = timeEntry.split(":") if len(timeComp) == 3: hours, minutes, seconds = timeComp -- 1.7.3.5
Attachment:
signature.asc
Description: PGP signature