public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer
@ 2008-04-21 21:07 Alec Warner (antarus)
  0 siblings, 0 replies; 12+ messages in thread
From: Alec Warner (antarus) @ 2008-04-21 21:07 UTC (permalink / raw
  To: gentoo-commits

antarus     08/04/21 21:07:16

  Added:                process_timer
  Log:
  add scriptlet to find walltime of PROCESSES and if the walltime is above a certain limit yield the pids on stdout.

Revision  Changes    Path
1.1                  users/antarus/projects/infra/process_timer

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.1&content-type=text/plain

Index: process_timer
===================================================================
#!/usr/bin/python
# Copyright Alec Warner 2008
# Released in the public domain.

"""Find tasks that have been running over X time.

Look in /proc, match on some regexes, offer to print pids that match
options given by the user.
"""


__author__ = """Alec Warner <antarus@gentoo.org>"""

import logging
import optparse
import os
import re

PROC_PATH='/proc'

def GetOpts():
  """Parse the options."""

  parser = optparse.OptionParser()
  parser.add_option('-p', '--prog', help='program to search for')
  parser.add_option('-t', '--time', help='max time prog can run')
  parser.add_option('-w', '--walltime', help='match time against walltime')
  parser.add_option('-v', '--verbose', help='increase loglevel')
  opts, args = parser.parse_args()

  if not opts.prog:
    parser.error('--prog is required')

  if not opts.walltime:
    opts.walltime = True

  if opts.verbose:
    logging.getLogger().setLevel(10)

  logging.debug('opts are %s' % opts)

  return opts, args

def FindPids(search_str):
  """Return PIDS for all processes that have match search_str.
  Args:
    search_str: match /proc/*/cmdline to this string.
  Returns:
    (pid, cmdline), PIDS of processes that match search_str
  """
  matches = set()

  pid_re = re.compile(r'[0-9]+')

  files = os.listdir(PROC_PATH)
  files = [f for f in files if pid_re.match(f)]

  # we shouldn't output ourselves
  my_pid = str(os.getpid())
  if my_pid in files:
    files.remove(my_pid)

  logging.debug('pids avaialble: %s' % files)

  for pid in files:
    PID_DIR_PATH = os.path.join(PROC_PATH, pid)
    cmdline = open(os.path.join(PID_DIR_PATH, 'cmdline')).read()
    logging.debug('cmdline: %s' % cmdline)
    if search_str in cmdline:
      logging.debug('matched %s' % pid)
      matches.add((pid, cmdline))

  logging.debug('pids matched: %s' % matches)

  return matches


def CalculateTime(pid):
  """Calculate walltime, runtime, and other random time bits for PID.
  Args:
    pid: pid to make time calculations for.
  Returns:
    A tuple of random crap.

  These times are in 'jiffies' or as far as I can tell USER_HZ or 1/100ths
  of a second slices.
  """

  PID_DIR_PATH = os.path.join(PROC_PATH, pid)
  data = open(os.path.join(PID_DIR_PATH, 'stat')).read().split(' ')
  utime, stime, cutime, cstime = data[13:17]
  starttime = data[21]

  wall = int(utime) + int(stime)
  cwall = int(cutime) + int(cstime)

  return (utime, stime, cutime, cstime, wall, cwall, starttime)


def Main():
  """Main Driver function."""

  opts, args = GetOpts()
  pids = FindPids(opts.prog)
  for pid in pids:
    times = CalculateTime(pid[0])
    if opts.walltime:
      if times[4] / 100 > opts.time:
        print pid[0]

if __name__ == "__main__":
  Main()



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer
@ 2008-05-02  4:37 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson (robbat2) @ 2008-05-02  4:37 UTC (permalink / raw
  To: gentoo-commits

robbat2     08/05/02 04:37:18

  Modified:             process_timer
  Log:
  Add header to make it possible to track elsewhere.

Revision  Changes    Path
1.2                  users/antarus/projects/infra/process_timer

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?r1=1.1&r2=1.2

Index: process_timer
===================================================================
RCS file: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v
retrieving revision 1.1
retrieving revision 1.2
diff -p -w -b -B -u -u -r1.1 -r1.2
--- process_timer	21 Apr 2008 21:07:16 -0000	1.1
+++ process_timer	2 May 2008 04:37:17 -0000	1.2
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.2 2008/05/02 04:37:17 robbat2 Exp $
 # Copyright Alec Warner 2008
 # Released in the public domain.
 



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer
@ 2008-05-02  7:16 Alec Warner (antarus)
  0 siblings, 0 replies; 12+ messages in thread
From: Alec Warner (antarus) @ 2008-05-02  7:16 UTC (permalink / raw
  To: gentoo-commits

antarus     08/05/02 07:16:57

  Modified:             process_timer
  Log:
  Updates, changes times to a dict, add more debugging.

Revision  Changes    Path
1.3                  users/antarus/projects/infra/process_timer

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?r1=1.2&r2=1.3

Index: process_timer
===================================================================
RCS file: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- process_timer	2 May 2008 04:37:17 -0000	1.2
+++ process_timer	2 May 2008 07:16:57 -0000	1.3
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.2 2008/05/02 04:37:17 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.3 2008/05/02 07:16:57 antarus Exp $
 # Copyright Alec Warner 2008
 # Released in the public domain.
 
@@ -24,11 +24,15 @@
 
   parser = optparse.OptionParser()
   parser.add_option('-p', '--prog', help='program to search for')
-  parser.add_option('-t', '--time', help='max time prog can run')
-  parser.add_option('-w', '--walltime', help='match time against walltime')
+  parser.add_option('-t', '--time', help='max time prog can run in seconds')
+  parser.add_option('-w', '--walltime', action='store_true',
+                    help='match time against walltime')
   parser.add_option('-v', '--verbose', help='increase loglevel')
   opts, args = parser.parse_args()
 
+  if opts.time:
+    opts.time = int(opts.time)
+
   if not opts.prog:
     parser.error('--prog is required')
 
@@ -42,6 +46,7 @@
 
   return opts, args
 
+
 def FindPids(search_str):
   """Return PIDS for all processes that have match search_str.
   Args:
@@ -81,10 +86,10 @@
   Args:
     pid: pid to make time calculations for.
   Returns:
-    A tuple of random crap.
+    A dict of random times.
 
   These times are in 'jiffies' or as far as I can tell USER_HZ or 1/100ths
-  of a second slices.
+  of a second slices on recent linux kernels.
   """
 
   PID_DIR_PATH = os.path.join(PROC_PATH, pid)
@@ -95,7 +100,15 @@
   wall = int(utime) + int(stime)
   cwall = int(cutime) + int(cstime)
 
-  return (utime, stime, cutime, cstime, wall, cwall, starttime)
+  d = { 'utime' : utime,
+        'stime' : stime,
+        'cutime' : cutime,
+        'cstime' : cstime,
+        'wall' : wall,
+        'cwall' : cwall,
+        'starttime' : starttime }
+
+  return d
 
 
 def Main():
@@ -105,8 +118,13 @@
   pids = FindPids(opts.prog)
   for pid in pids:
     times = CalculateTime(pid[0])
+    logging.debug("Times: %s: %s" % (pid[1], times))
     if opts.walltime:
-      if times[4] / 100 > opts.time:
+      import pdb
+      pdb.set_trace()
+      print times['wall'] / 100, opts.time
+      if times['wall'] / 100 > opts.time:
+        print 'ponies'
         print pid[0]
 
 if __name__ == "__main__":



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer
@ 2008-05-02  7:18 Alec Warner (antarus)
  0 siblings, 0 replies; 12+ messages in thread
From: Alec Warner (antarus) @ 2008-05-02  7:18 UTC (permalink / raw
  To: gentoo-commits

antarus     08/05/02 07:18:03

  Modified:             process_timer
  Log:
  Remove pdb.set_trace, random print statements that only make debugging worse ;)

Revision  Changes    Path
1.4                  users/antarus/projects/infra/process_timer

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?r1=1.3&r2=1.4

Index: process_timer
===================================================================
RCS file: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- process_timer	2 May 2008 07:16:57 -0000	1.3
+++ process_timer	2 May 2008 07:18:03 -0000	1.4
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.3 2008/05/02 07:16:57 antarus Exp $
+# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.4 2008/05/02 07:18:03 antarus Exp $
 # Copyright Alec Warner 2008
 # Released in the public domain.
 
@@ -120,11 +120,7 @@
     times = CalculateTime(pid[0])
     logging.debug("Times: %s: %s" % (pid[1], times))
     if opts.walltime:
-      import pdb
-      pdb.set_trace()
-      print times['wall'] / 100, opts.time
       if times['wall'] / 100 > opts.time:
-        print 'ponies'
         print pid[0]
 
 if __name__ == "__main__":



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer
@ 2008-05-02  7:24 Alec Warner (antarus)
  0 siblings, 0 replies; 12+ messages in thread
From: Alec Warner (antarus) @ 2008-05-02  7:24 UTC (permalink / raw
  To: gentoo-commits

antarus     08/05/02 07:24:59

  Modified:             process_timer
  Log:
  Change logging stuff so that -v 1 produces a few lines of helpful information and -v 2 adds more debugging

Revision  Changes    Path
1.5                  users/antarus/projects/infra/process_timer

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.5&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.5&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?r1=1.4&r2=1.5

Index: process_timer
===================================================================
RCS file: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- process_timer	2 May 2008 07:18:03 -0000	1.4
+++ process_timer	2 May 2008 07:24:58 -0000	1.5
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.4 2008/05/02 07:18:03 antarus Exp $
+# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.5 2008/05/02 07:24:58 antarus Exp $
 # Copyright Alec Warner 2008
 # Released in the public domain.
 
@@ -7,6 +7,9 @@
 
 Look in /proc, match on some regexes, offer to print pids that match
 options given by the user.
+
+TODO: cmdline is an 'array' of null terminated strings and we don't handle that
+correctly right now.
 """
 
 
@@ -40,9 +43,10 @@
     opts.walltime = True
 
   if opts.verbose:
-    logging.getLogger().setLevel(10)
+    for i in range(int(opts.verbose)):
+      logging.getLogger().setLevel(logging.getLogger().getEffectiveLevel() - 10)
 
-  logging.debug('opts are %s' % opts)
+  logging.info('opts are %s' % opts)
 
   return opts, args
 
@@ -76,7 +80,7 @@
       logging.debug('matched %s' % pid)
       matches.add((pid, cmdline))
 
-  logging.debug('pids matched: %s' % matches)
+  logging.info('pids matched: %s' % matches)
 
   return matches
 
@@ -118,7 +122,7 @@
   pids = FindPids(opts.prog)
   for pid in pids:
     times = CalculateTime(pid[0])
-    logging.debug("Times: %s: %s" % (pid[1], times))
+    logging.info("Times: %s: %s" % (pid[1], times))
     if opts.walltime:
       if times['wall'] / 100 > opts.time:
         print pid[0]



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer
@ 2008-05-25 12:22 Alec Warner (antarus)
  0 siblings, 0 replies; 12+ messages in thread
From: Alec Warner (antarus) @ 2008-05-25 12:22 UTC (permalink / raw
  To: gentoo-commits

antarus     08/05/25 12:22:45

  Modified:             process_timer
  Log:
  make --match_time choice based, remove --walltime, make match_time look up into times dict, sync dict keys, add code to map simple time constructs like 5h30m into epoch seconds so users can easily specify time increments.

Revision  Changes    Path
1.6                  users/antarus/projects/infra/process_timer

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.6&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.6&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?r1=1.5&r2=1.6

Index: process_timer
===================================================================
RCS file: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- process_timer	2 May 2008 07:24:58 -0000	1.5
+++ process_timer	25 May 2008 12:22:44 -0000	1.6
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.5 2008/05/02 07:24:58 antarus Exp $
+# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.6 2008/05/25 12:22:44 antarus Exp $
 # Copyright Alec Warner 2008
 # Released in the public domain.
 
@@ -12,7 +12,6 @@
 correctly right now.
 """
 
-
 __author__ = """Alec Warner <antarus@gentoo.org>"""
 
 import logging
@@ -22,35 +21,81 @@
 
 PROC_PATH='/proc'
 
+TIME_KEYS = ('walltime', 'utime', 'stime', 'cutime', 'cstime', 'cwalltime',
+             'starttime')
+
 def GetOpts():
   """Parse the options."""
 
   parser = optparse.OptionParser()
   parser.add_option('-p', '--prog', help='program to search for')
-  parser.add_option('-t', '--time', help='max time prog can run in seconds')
-  parser.add_option('-w', '--walltime', action='store_true',
-                    help='match time against walltime')
-  parser.add_option('-v', '--verbose', help='increase loglevel')
+  parser.add_option('-t', '--time', help='max time prog can run (in format: 3h30m10s)',
+                    default='10s')
+  parser.add_option('-m', '--match_time', type='choice',
+                    default='walltime', choices=TIME_KEYS, 
+                    help='match time against a given choice')
+  parser.add_option('-v', '--verbose', help='increase loglevel', action='store_true')
   opts, args = parser.parse_args()
 
   if opts.time:
-    opts.time = int(opts.time)
+    opts.time = StringToEpochTime(opts.time)
 
   if not opts.prog:
     parser.error('--prog is required')
 
-  if not opts.walltime:
-    opts.walltime = True
-
   if opts.verbose:
-    for i in range(int(opts.verbose)):
-      logging.getLogger().setLevel(logging.getLogger().getEffectiveLevel() - 10)
+    map(logging.getLogger().setLevel(
+        logging.getLogger().getEffectiveLevel() - 10),
+        xrange(int(opts.verbose)))
 
   logging.info('opts are %s' % opts)
 
   return opts, args
 
 
+time_re = re.compile(r'(\d)+(\w)')
+
+
+def StringToEpochTime(str_time):
+  """Return time in Epoch time given a string identifier.
+
+  To support strings such as '3h30m' this function recursively calls itself
+  with substrings as a argument (first call parses '3h', second call parses '30m'
+  results are summed.)
+
+  Args:
+    str_time: a string representing a time interval, eg. '3h5m' or '52w'
+  Returns:
+    Unix timestamp of the amount of time specified.
+  """
+  
+  result = 0
+  match = time_re.match(str_time)
+  if not match:
+    raise ValueError('argument not in valid format ((\d)+(\w))+: %s' % str_time)
+  else:
+    value, identifier = match.groups()
+    value = int(value)
+    if identifier == 's':
+      result += value
+    elif identifier == 'm':
+      result += value * 60
+    elif identifier == 'h':
+      result += value * 3600
+    elif identifier == 'd':
+      result += value * 86400
+    elif identifier == 'w':
+      result += value * 604800
+    else:
+      raise ValueError('Time identifier not one of "smhdw"')
+
+    s = ''.join(match.groups())
+    str_time = str_time[str_time.find(s) + len(s):]
+    if len(str_time):
+      result += StringToEpochTime(str_time)
+    else:
+      return result
+
 def FindPids(search_str):
   """Return PIDS for all processes that have match search_str.
   Args:
@@ -74,11 +119,12 @@
 
   for pid in files:
     PID_DIR_PATH = os.path.join(PROC_PATH, pid)
-    cmdline = open(os.path.join(PID_DIR_PATH, 'cmdline')).read()
+    cmdline = open(os.path.join(PID_DIR_PATH, 'cmdline')).read().split('\0')
     logging.debug('cmdline: %s' % cmdline)
-    if search_str in cmdline:
+    match = filter(None, [search_str in command for command in cmdline])
+    if match:
       logging.debug('matched %s' % pid)
-      matches.add((pid, cmdline))
+      matches.add((pid, str(cmdline)))
 
   logging.info('pids matched: %s' % matches)
 
@@ -108,7 +154,7 @@
         'stime' : stime,
         'cutime' : cutime,
         'cstime' : cstime,
-        'wall' : wall,
+        'walltime' : wall,
         'cwall' : cwall,
         'starttime' : starttime }
 
@@ -123,9 +169,10 @@
   for pid in pids:
     times = CalculateTime(pid[0])
     logging.info("Times: %s: %s" % (pid[1], times))
-    if opts.walltime:
-      if times['wall'] / 100 > opts.time:
-        print pid[0]
+    if opts.match_time:
+      if opts.match_time in times:
+        if times[opts.match_time] / 100 > opts.time: 
+          print pid[0]
 
 if __name__ == "__main__":
   Main()



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer
@ 2008-07-06 18:53 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson (robbat2) @ 2008-07-06 18:53 UTC (permalink / raw
  To: gentoo-commits

robbat2     08/07/06 18:53:47

  Modified:             process_timer
  Log:
  The /proc/$PID/ directory may go away during processing. Also correct compute walltime, and there is no cwall, but there are also cputime and culm cputime.

Revision  Changes    Path
1.7                  users/antarus/projects/infra/process_timer

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.7&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.7&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?r1=1.6&r2=1.7

Index: process_timer
===================================================================
RCS file: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v
retrieving revision 1.6
retrieving revision 1.7
diff -p -w -b -B -u -u -r1.6 -r1.7
--- process_timer	25 May 2008 12:22:44 -0000	1.6
+++ process_timer	6 Jul 2008 18:53:46 -0000	1.7
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.6 2008/05/25 12:22:44 antarus Exp $
+# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.7 2008/07/06 18:53:46 robbat2 Exp $
 # Copyright Alec Warner 2008
 # Released in the public domain.
 
@@ -21,8 +22,7 @@ import re
 
 PROC_PATH='/proc'
 
-TIME_KEYS = ('walltime', 'utime', 'stime', 'cutime', 'cstime', 'cwalltime',
-             'starttime')
+TIME_KEYS = ['walltime', 'utime', 'stime', 'cutime', 'cstime', 'starttime', 'cpu', 'ccpu']
 
 def GetOpts():
   """Parse the options."""
@@ -119,12 +118,16 @@ def FindPids(search_str):
 
   for pid in files:
     PID_DIR_PATH = os.path.join(PROC_PATH, pid)
-    cmdline = open(os.path.join(PID_DIR_PATH, 'cmdline')).read().split('\0')
+    CMDLINE_FILE = os.path.join(PID_DIR_PATH, 'cmdline')
+    try:
+      cmdline = open(CMDLINE_FILE).read().split('\0')
     logging.debug('cmdline: %s' % cmdline)
     match = filter(None, [search_str in command for command in cmdline])
     if match:
       logging.debug('matched %s' % pid)
       matches.add((pid, str(cmdline)))
+    except IOError:
+        continue
 
   logging.info('pids matched: %s' % matches)
 
@@ -142,20 +145,29 @@ def CalculateTime(pid):
   of a second slices on recent linux kernels.
   """
 
+  # Initialize to zero, because the /proc files CAN go away while we are running
+  utime = stime = cutime = cstime = wall = starttime = 0
+
   PID_DIR_PATH = os.path.join(PROC_PATH, pid)
+  # Yup, the file can go away very fast.
+  try:
   data = open(os.path.join(PID_DIR_PATH, 'stat')).read().split(' ')
   utime, stime, cutime, cstime = data[13:17]
   starttime = data[21]
+  except IOError:
+    _
+  # If this one goes away, we're in shit anyway
+  uptime = open(os.path.join(PROC_PATH, 'uptime')).read().split(' ')[0] 
 
-  wall = int(utime) + int(stime)
-  cwall = int(cutime) + int(cstime)
+  wall = int(float(uptime)*100 - float(starttime))
 
   d = { 'utime' : utime,
         'stime' : stime,
         'cutime' : cutime,
         'cstime' : cstime,
+        'cpu' : int(utime) + int(stime),
+        'ccpu' : int(cutime) + int(cstime),
         'walltime' : wall,
-        'cwall' : cwall,
         'starttime' : starttime }
 
   return d



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer
@ 2008-07-06 19:05 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson (robbat2) @ 2008-07-06 19:05 UTC (permalink / raw
  To: gentoo-commits

robbat2     08/07/06 19:05:59

  Modified:             process_timer
  Log:
  Add pure seconds shortcut.

Revision  Changes    Path
1.8                  users/antarus/projects/infra/process_timer

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.8&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.8&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?r1=1.7&r2=1.8

Index: process_timer
===================================================================
RCS file: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v
retrieving revision 1.7
retrieving revision 1.8
diff -p -w -b -B -u -u -r1.7 -r1.8
--- process_timer	6 Jul 2008 18:53:46 -0000	1.7
+++ process_timer	6 Jul 2008 19:05:58 -0000	1.8
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.7 2008/07/06 18:53:46 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.8 2008/07/06 19:05:58 robbat2 Exp $
 # Copyright Alec Warner 2008
 # Released in the public domain.
 
@@ -52,7 +52,7 @@ def GetOpts():
 
   return opts, args
 
-time_re = re.compile(r'(\d)+(\w)')
+time_atom_re = re.compile(r'(\d)+(\w)')
 
 def StringToEpochTime(str_time):
   """Return time in Epoch time given a string identifier.
@@ -67,8 +67,13 @@ def StringToEpochTime(str_time):
     Unix timestamp of the amount of time specified.
   """
   
+  # Shortcut
+  result = int(str_time)
+  if str_time == str(result):
+    return result
+  
   result = 0
-  match = time_re.match(str_time)
+  match = time_atom_re.match(str_time)
   if not match:
     raise ValueError('argument not in valid format ((\d)+(\w))+: %s' % str_time)
   else:



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer
@ 2008-07-06 19:06 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson (robbat2) @ 2008-07-06 19:06 UTC (permalink / raw
  To: gentoo-commits

robbat2     08/07/06 19:06:22

  Modified:             yaboot-static-1.3.14.ebuild ChangeLog
  Log:
  Fix variable quoting "${WORKDIR}/*" is not equal to "${WORKDIR}"/*. Add some die traps to the mv and cp commands. The current ebuild didn't install anything...
  (Portage version: 2.1.4.4)

  Modified:             process_timer
  Log:
  Use shorter name for match_time option.

Revision  Changes    Path
1.4                  sys-boot/yaboot-static/yaboot-static-1.3.14.ebuild

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/yaboot-static/yaboot-static-1.3.14.ebuild?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/yaboot-static/yaboot-static-1.3.14.ebuild?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/yaboot-static/yaboot-static-1.3.14.ebuild?r1=1.3&r2=1.4

Index: yaboot-static-1.3.14.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-boot/yaboot-static/yaboot-static-1.3.14.ebuild,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- yaboot-static-1.3.14.ebuild	13 May 2008 23:41:15 -0000	1.3
+++ yaboot-static-1.3.14.ebuild	23 May 2008 07:07:04 -0000	1.4
@@ -1,6 +1,6 @@
 # Copyright 1999-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot-static/yaboot-static-1.3.14.ebuild,v 1.3 2008/05/13 23:41:15 josejx Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot-static/yaboot-static-1.3.14.ebuild,v 1.4 2008/05/23 07:07:04 corsair Exp $
 
 inherit eutils
 
@@ -21,6 +21,7 @@
 
 src_install() {
 	# don't blow away the user's old conf file
-	mv "${WORKDIR}/etc/yaboot.conf" "${WORKDIR}/etc/yaboot.conf.unconfigured"
-	cp -pPR "${WORKDIR}/*" "${D}/"
+	mv "${WORKDIR}/etc/yaboot.conf" "${WORKDIR}/etc/yaboot.conf.unconfigured" \
+		|| die "mv failed"
+	cp -pPR "${WORKDIR}"/* "${D}" || die "cp failed"
 }



1.20                 sys-boot/yaboot-static/ChangeLog

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/yaboot-static/ChangeLog?rev=1.20&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/yaboot-static/ChangeLog?rev=1.20&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/yaboot-static/ChangeLog?r1=1.19&r2=1.20

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-boot/yaboot-static/ChangeLog,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ChangeLog	13 May 2008 23:41:15 -0000	1.19
+++ ChangeLog	23 May 2008 07:07:04 -0000	1.20
@@ -1,6 +1,12 @@
 # ChangeLog for sys-boot/yaboot-static
 # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot-static/ChangeLog,v 1.19 2008/05/13 23:41:15 josejx Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot-static/ChangeLog,v 1.20 2008/05/23 07:07:04 corsair Exp $
+
+  23 May 2008; Markus Rothe <corsair@gentoo.org>
+  yaboot-static-1.3.14.ebuild:
+  Fix variable quoting: "${WORKDIR}/*" is not equal to "${WORKDIR}"/*. Add
+  some die traps to the mv and cp commands. The current ebuild didn't install
+  anything...
 
   13 May 2008; Joseph Jezak <josejx@gentoo.org>
   -files/ofpath_device-tree_check.patch, -yaboot-static-1.3.12.ebuild,



1.9                  users/antarus/projects/infra/process_timer

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.9&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.9&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?r1=1.8&r2=1.9

Index: process_timer
===================================================================
RCS file: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v
retrieving revision 1.8
retrieving revision 1.9
diff -p -w -b -B -u -u -r1.8 -r1.9
--- process_timer	6 Jul 2008 19:05:58 -0000	1.8
+++ process_timer	6 Jul 2008 19:06:22 -0000	1.9
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.8 2008/07/06 19:05:58 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.9 2008/07/06 19:06:22 robbat2 Exp $
 # Copyright Alec Warner 2008
 # Released in the public domain.
 
@@ -31,7 +31,7 @@ def GetOpts():
   parser.add_option('-p', '--prog', help='program to search for')
   parser.add_option('-t', '--time', help='max time prog can run (in format: 3h30m10s)',
                     default='10s')
-  parser.add_option('-m', '--match_time', type='choice',
+  parser.add_option('-m', '--match', type='choice',
                     default='walltime', choices=TIME_KEYS, 
                     help='match time against a given choice')
   parser.add_option('-v', '--verbose', help='increase loglevel', action='store_true')
@@ -186,9 +186,9 @@ def Main():
   for pid in pids:
     times = CalculateTime(pid[0])
     logging.info("Times: %s: %s" % (pid[1], times))
-    if opts.match_time:
-      if opts.match_time in times:
-        if times[opts.match_time] / 100 > opts.time: 
+    if opts.match:
+      if opts.match in times:
+        if times[opts.match] / 100 > opts.time: 
           print pid[0]
 
 if __name__ == "__main__":



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer
@ 2008-07-06 19:11 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 12+ messages in thread
From: Robin H. Johnson (robbat2) @ 2008-07-06 19:11 UTC (permalink / raw
  To: gentoo-commits

robbat2     08/07/06 19:11:06

  Modified:             process_timer
  Log:
  Ensure integer conversions are good.

Revision  Changes    Path
1.10                 users/antarus/projects/infra/process_timer

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.10&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.10&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?r1=1.9&r2=1.10

Index: process_timer
===================================================================
RCS file: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v
retrieving revision 1.9
retrieving revision 1.10
diff -p -w -b -B -u -u -r1.9 -r1.10
--- process_timer	6 Jul 2008 19:06:22 -0000	1.9
+++ process_timer	6 Jul 2008 19:11:06 -0000	1.10
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.9 2008/07/06 19:06:22 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.10 2008/07/06 19:11:06 robbat2 Exp $
 # Copyright Alec Warner 2008
 # Released in the public domain.
 
@@ -68,9 +68,12 @@ def StringToEpochTime(str_time):
   """
   
   # Shortcut
+  try:
   result = int(str_time)
   if str_time == str(result):
     return result
+  except ValueError:
+    None
   
   result = 0
   match = time_atom_re.match(str_time)
@@ -157,8 +160,8 @@ def CalculateTime(pid):
   # Yup, the file can go away very fast.
   try:
     data = open(os.path.join(PID_DIR_PATH, 'stat')).read().split(' ')
-    utime, stime, cutime, cstime = data[13:17]
-    starttime = data[21]
+    utime, stime, cutime, cstime = map(int, data[13:17])
+    starttime = int(data[21])
   except IOError:
     _
   # If this one goes away, we're in shit anyway
@@ -170,8 +173,8 @@ def CalculateTime(pid):
         'stime' : stime,
         'cutime' : cutime,
         'cstime' : cstime,
-        'cpu' : int(utime) + int(stime),
-        'ccpu' : int(cutime) + int(cstime),
+        'cpu' : utime + stime,
+        'ccpu' : cutime + cstime,
         'walltime' : wall,
         'starttime' : starttime }
 



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer
@ 2008-07-20  5:11 Alec Warner (antarus)
  0 siblings, 0 replies; 12+ messages in thread
From: Alec Warner (antarus) @ 2008-07-20  5:11 UTC (permalink / raw
  To: gentoo-commits

antarus     08/07/20 05:11:36

  Modified:             process_timer
  Log:
  Integrate robin's changes; move shortcut out of StringToEpoch and into option parsing (keep the function on topic) and fail better when critical files are missing

Revision  Changes    Path
1.11                 users/antarus/projects/infra/process_timer

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.11&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.11&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?r1=1.10&r2=1.11

Index: process_timer
===================================================================
RCS file: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- process_timer	6 Jul 2008 19:11:06 -0000	1.10
+++ process_timer	20 Jul 2008 05:11:35 -0000	1.11
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.10 2008/07/06 19:11:06 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.11 2008/07/20 05:11:35 antarus Exp $
 # Copyright Alec Warner 2008
 # Released in the public domain.
 
@@ -15,10 +15,12 @@
 
 __author__ = """Alec Warner <antarus@gentoo.org>"""
 
+import errno
 import logging
 import optparse
 import os
 import re
+import sys
 
 PROC_PATH='/proc'
 
@@ -37,8 +39,16 @@
   parser.add_option('-v', '--verbose', help='increase loglevel', action='store_true')
   opts, args = parser.parse_args()
 
+  # Support the case where opts.time is already in unmarked seconds
+  # aka Epoch time; thus we do not need to transform it to epoch time.
   if opts.time:
-    opts.time = StringToEpochTime(opts.time)
+    try:
+      int_time = int(opts.time)
+    except ValueError:
+      opts.time = StringToEpochTime(opts.time)
+    else:
+      if str(int_time) != opts.time:
+        opts.time = StringToEpochTime(opts.time)
 
   if not opts.prog:
     parser.error('--prog is required')
@@ -65,16 +75,9 @@
     str_time: a string representing a time interval, eg. '3h5m' or '52w'
   Returns:
     Unix timestamp of the amount of time specified.
+  Raises: ValueError.
   """
   
-  # Shortcut
-  try:
-    result = int(str_time)
-    if str_time == str(result):
-      return result
-  except ValueError:
-    None
-  
   result = 0
   match = time_atom_re.match(str_time)
   if not match:
@@ -134,7 +137,7 @@
       if match:
         logging.debug('matched %s' % pid)
         matches.add((pid, str(cmdline)))
-    except IOError:
+    except IOError, OSError:
         continue
 
   logging.info('pids matched: %s' % matches)
@@ -150,22 +153,31 @@
     A dict of random times.
 
   These times are in 'jiffies' or as far as I can tell USER_HZ or 1/100ths
-  of a second slices on recent linux kernels.
+  of a second slices on recent linux kernels.  Be careful with these files
+  because the process may have gone away between reads of /proc.
   """
 
-  # Initialize to zero, because the /proc files CAN go away while we are running
+  # We may only get some items (some files may or may not exist
+  # depending on the state of the process) so it is important to return
+  # partial results here.
   utime = stime = cutime = cstime = wall = starttime = 0
 
   PID_DIR_PATH = os.path.join(PROC_PATH, pid)
-  # Yup, the file can go away very fast.
+
   try:
     data = open(os.path.join(PID_DIR_PATH, 'stat')).read().split(' ')
     utime, stime, cutime, cstime = map(int, data[13:17])
     starttime = int(data[21])
-  except IOError:
-    _
-  # If this one goes away, we're in shit anyway
-  uptime = open(os.path.join(PROC_PATH, 'uptime')).read().split(' ')[0] 
+  except IOError, OSError:
+    pass
+
+  # fail a bit more gracefully if we could not gather uptime data.
+  try:
+    uptime = open(os.path.join(PROC_PATH, 'uptime')).read().split(' ')[0] 
+  except (IOError, OSError), e:
+    if e.errno == errno.ENOENT:
+      logging.fatal('Could not read %s' % os.path.join(PROC_PATH ,'uptime'))
+      sys.exit(1)
 
   wall = int(float(uptime)*100 - float(starttime))
 






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer
@ 2008-07-20  5:21 Alec Warner (antarus)
  0 siblings, 0 replies; 12+ messages in thread
From: Alec Warner (antarus) @ 2008-07-20  5:21 UTC (permalink / raw
  To: gentoo-commits

antarus     08/07/20 05:21:34

  Modified:             process_timer
  Log:
  Make improvements such that pylint complains a lot less.

Revision  Changes    Path
1.12                 users/antarus/projects/infra/process_timer

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.12&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?rev=1.12&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/antarus/projects/infra/process_timer?r1=1.11&r2=1.12

Index: process_timer
===================================================================
RCS file: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- process_timer	20 Jul 2008 05:11:35 -0000	1.11
+++ process_timer	20 Jul 2008 05:21:33 -0000	1.12
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.11 2008/07/20 05:11:35 antarus Exp $
+# $Header: /var/cvsroot/gentoo/users/antarus/projects/infra/process_timer,v 1.12 2008/07/20 05:21:33 antarus Exp $
 # Copyright Alec Warner 2008
 # Released in the public domain.
 
@@ -22,21 +22,23 @@
 import re
 import sys
 
-PROC_PATH='/proc'
+PROC_PATH = '/proc'
 
-TIME_KEYS = ['walltime', 'utime', 'stime', 'cutime', 'cstime', 'starttime', 'cpu', 'ccpu']
+TIME_KEYS = ['walltime', 'utime', 'stime', 'cutime', 'cstime', 'starttime',
+             'cpu', 'ccpu']
 
 def GetOpts():
   """Parse the options."""
 
   parser = optparse.OptionParser()
   parser.add_option('-p', '--prog', help='program to search for')
-  parser.add_option('-t', '--time', help='max time prog can run (in format: 3h30m10s)',
-                    default='10s')
+  parser.add_option('-t', '--time', help='max time prog can run'
+                    '(in format: 3h30m10s)', default='10s')
   parser.add_option('-m', '--match', type='choice',
                     default='walltime', choices=TIME_KEYS, 
                     help='match time against a given choice')
-  parser.add_option('-v', '--verbose', help='increase loglevel', action='store_true')
+  parser.add_option('-v', '--verbose', help='increase loglevel',
+                    action='store_true')
   opts, args = parser.parse_args()
 
   # Support the case where opts.time is already in unmarked seconds
@@ -62,14 +64,14 @@
 
   return opts, args
 
-time_atom_re = re.compile(r'(\d)+(\w)')
+TIME_ATOM_RE = re.compile(r'(\d)+(\w)')
 
 def StringToEpochTime(str_time):
   """Return time in Epoch time given a string identifier.
 
   To support strings such as '3h30m' this function recursively calls itself
-  with substrings as a argument (first call parses '3h', second call parses '30m'
-  results are summed.)
+  with substrings as a argument (first call parses '3h', second call parses
+  '30m' results are summed.)
 
   Args:
     str_time: a string representing a time interval, eg. '3h5m' or '52w'
@@ -79,9 +81,10 @@
   """
   
   result = 0
-  match = time_atom_re.match(str_time)
+  match = TIME_ATOM_RE.match(str_time)
   if not match:
-    raise ValueError('argument not in valid format ((\d)+(\w))+: %s' % str_time)
+    raise ValueError('argument not in valid format ((\d)+(\w))+: %s' % (
+        str_time,))
   else:
     value, identifier = match.groups()
     value = int(value)
@@ -128,8 +131,8 @@
   logging.debug('pids avaialble: %s' % files)
 
   for pid in files:
-    PID_DIR_PATH = os.path.join(PROC_PATH, pid)
-    CMDLINE_FILE = os.path.join(PID_DIR_PATH, 'cmdline')
+    pid_dir_path = os.path.join(PROC_PATH, pid)
+    CMDLINE_FILE = os.path.join(pid_dir_path, 'cmdline')
     try:
       cmdline = open(CMDLINE_FILE).read().split('\0')
       logging.debug('cmdline: %s' % cmdline)
@@ -138,7 +141,7 @@
         logging.debug('matched %s' % pid)
         matches.add((pid, str(cmdline)))
     except IOError, OSError:
-        continue
+      continue
 
   logging.info('pids matched: %s' % matches)
 
@@ -162,10 +165,10 @@
   # partial results here.
   utime = stime = cutime = cstime = wall = starttime = 0
 
-  PID_DIR_PATH = os.path.join(PROC_PATH, pid)
+  pid_dir_path = os.path.join(PROC_PATH, pid)
 
   try:
-    data = open(os.path.join(PID_DIR_PATH, 'stat')).read().split(' ')
+    data = open(os.path.join(pid_dir_path, 'stat')).read().split(' ')
     utime, stime, cutime, cstime = map(int, data[13:17])
     starttime = int(data[21])
   except IOError, OSError:
@@ -196,7 +199,7 @@
 def Main():
   """Main Driver function."""
 
-  opts, args = GetOpts()
+  opts, unused_args = GetOpts()
   pids = FindPids(opts.prog)
   for pid in pids:
     times = CalculateTime(pid[0])






^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-07-20  5:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-25 12:22 [gentoo-commits] gentoo commit in users/antarus/projects/infra: process_timer Alec Warner (antarus)
  -- strict thread matches above, loose matches on Subject: below --
2008-07-20  5:21 Alec Warner (antarus)
2008-07-20  5:11 Alec Warner (antarus)
2008-07-06 19:11 Robin H. Johnson (robbat2)
2008-07-06 19:06 Robin H. Johnson (robbat2)
2008-07-06 19:05 Robin H. Johnson (robbat2)
2008-07-06 18:53 Robin H. Johnson (robbat2)
2008-05-02  7:24 Alec Warner (antarus)
2008-05-02  7:18 Alec Warner (antarus)
2008-05-02  7:16 Alec Warner (antarus)
2008-05-02  4:37 Robin H. Johnson (robbat2)
2008-04-21 21:07 Alec Warner (antarus)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox