Hi, lsof may spit out a lot of (un)predictable warnings, unwanted and not relevant to arm. Adding the -w option (no warnings) stops that. Patch attached.
> From 7e2ca00f19505859ec02fbfbff9f4edfb14bd00d Mon Sep 17 00:00:00 2001 > From: Fabian Keil <f...@fabiankeil.de> > Date: Sat, 18 Dec 2010 14:45:09 +0100 > Subject: [PATCH 6/8] Replace the '\s' in RUN_LSOF with ' ' to get it working. > > --- > src/util/connections.py | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/src/util/connections.py b/src/util/connections.py > index abec3f6..d154288 100644 > --- a/src/util/connections.py > +++ b/src/util/connections.py > @@ -60,7 +60,7 @@ RUN_SS = "ss -nptu | grep \"ESTAB.*\\\"%s\\\",%s\"" > # oddly, using the -p flag via: > # lsof lsof -nPi -p <pid> | grep "^<process>.*(ESTABLISHED)" > # is much slower (11-28% in tests I ran) > -RUN_LSOF = "lsof -nPi | egrep \"^%s\\s*%s.*((UDP.*)|(\\(ESTABLISHED\\)))\"" > +RUN_LSOF = "lsof -nPi | egrep \"^%s *%s.*((UDP.*)|(\\(ESTABLISHED\\)))\"" > > # output: > # atagar tor 3475 tcp4 127.0.0.1:9051 127.0.0.1:38942 ESTABLISHED > -- > 1.7.3.3 >
Index: trunk/src/util/connections.py =================================================================== --- trunk/src/util/connections.py (revision 23956) +++ trunk/src/util/connections.py (working copy) @@ -60,7 +60,7 @@ # oddly, using the -p flag via: # lsof lsof -nPi -p <pid> | grep "^<process>.*(ESTABLISHED)" # is much slower (11-28% in tests I ran) -RUN_LSOF = "lsof -nPi | egrep \"^%s *%s.*((UDP.*)|(\\(ESTABLISHED\\)))\"" +RUN_LSOF = "lsof -wnPi | egrep \"^%s *%s.*((UDP.*)|(\\(ESTABLISHED\\)))\"" # output: # atagar tor 3475 tcp4 127.0.0.1:9051 127.0.0.1:38942 ESTABLISHED