]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.54.jcn1
authorJan Nieuwenhuizen <janneke@gnu.org>
Thu, 25 May 2000 21:22:02 +0000 (23:22 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Thu, 25 May 2000 21:22:02 +0000 (23:22 +0200)
1.3.54.jcn1
===========

* Fixed compile bug.

* Added scripts/linux-time.py: simple utility to monitor memory (and later
  maybe other) resource usage from Linux's proc fs.

---
Generated by janneke@gnu.org,
From = lilypond-1.3.54, To = lilypond-1.3.54.jcn1

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.3.54.jcn1.diff

Patches do not contain automatically generated files
or (urg) empty directories,
i.e., you should rerun autoconf, configure

CHANGES
VERSION
buildscripts/set-lily.sh
lily/staff-symbol-referencer.cc
scripts/linux-time.py [new file with mode: 0644]

diff --git a/CHANGES b/CHANGES
index 1e07902ff91f855782654b0c164f749e35242d72..4f557042f36445e84a40fe2d26f4667022c58b31 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,17 @@
-1.3.1.3.54.hwn1
+--- ../lilypond-1.3.54/CHANGES Thu May 25 00:20:46 2000
+++ b/CHANGES   Thu May 25 23:22:02 2000
+@@ -1,3 +1,11 @@
+1.3.54.jcn1
+===========
+
+* Fixed compile bug.
+
+* Added scripts/linux-time.py: simple utility to monitor memory (and later
+  maybe other) resource usage from Linux's proc fs.
+
+ 1.3.53.uu1
+ ==========
+ 1.3.1.3.54.hwn1
 ===========
 
 * Massive search replace patch: store pointers and properties
diff --git a/VERSION b/VERSION
index 12c3a8182799244f517d1515df3f0d071d5ada5d..4e3376e8bb72ee0a5413f9c4500c3edb7896f457 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=54
-MY_PATCH_LEVEL=hwn1
+MY_PATCH_LEVEL=jcn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index df01378c4567b5e61d2e43ceb28c940078c197a2..383a116988078f2d3428406f74e43adc104831d8 100755 (executable)
@@ -57,6 +57,7 @@ showln -sf $LILYPOND_SOURCEDIR/midi2ly/out/midi2ly $prefix/bin/midi2ly
 showln -sf $LILYPOND_SOURCEDIR/scripts/out/ly2dvi $prefix/bin/ly2dvi
 showln -sf $LILYPOND_SOURCEDIR/scripts/out/mudela-book $prefix/bin/mudela-book
 showln -sf $LILYPOND_SOURCEDIR/buildscripts/out/genheader $prefix/bin/genheader
+showln -sf $LILYPOND_SOURCEDIR/scripts/out/linux-time $prefix/bin/linux-time
 showln -sf $LILYPOND_SOURCEDIR/scripts/out/as2text $prefix/bin/as2text
 
 
index 328957da32161d9be1711a46b84a1ed95e9f8f56..0540f9f0aeeb4de21c5e7da1912e36772b15e0fc 100644 (file)
@@ -98,7 +98,8 @@ Staff_symbol_referencer_interface::callback (Score_element const* sc,Axis )
       Real space = staff_symbol_referencer (sc).staff_space ();
       off = gh_scm2double (pos) * space/2.0;
     }
-  sc->set_elt_property ("staff-position", gh_double2scm (0.0));
+  Score_element* urg = (Score_element*)sc;
+  urg->set_elt_property ("staff-position", gh_double2scm (0.0));
 
   return off;
 }
diff --git a/scripts/linux-time.py b/scripts/linux-time.py
new file mode 100644 (file)
index 0000000..b41abc4
--- /dev/null
@@ -0,0 +1,151 @@
+#!@PYTHON@
+# linux-time.py -- Print resourse usage of a command executing on GNU/Linux
+#
+# awaiting PC's linux-mm patch for getrusage
+#
+# source file of the GNU LilyPond music typesetter
+# 
+# (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+# 
+
+name = 'linux-time'
+version = '@TOPLEVEL_VERSION@'
+if version == '@' + 'TOPLEVEL_VERSION' + '@':
+       version = '(unknown version)'           # uGUHGUHGHGUGH
+  
+import string
+import getopt
+import sys
+import os
+import time
+import posix
+import signal
+
+def identify():
+       sys.stderr.write ("%s from LilyPond %s\n" % (name, version))
+
+def help ():
+       print (r"""
+Usage: %s [OPTION]... COMMAND
+
+Print resourse usage of a command executing on GNU/Linux.
+
+Options:
+  -h, --help          this help
+  -v, --version       version information
+""" % name)
+
+def print_version ():
+       print (r"""%s (GNU LilyPond) %s""" % (name, version))
+
+(options, files) = getopt.getopt (sys.argv[1:], 'vh', ['help','version'])
+
+for opt in options:
+       o = opt[0]
+       a = opt[1]
+       if o== '--help' or o == '-h':
+               help ()
+               sys.exit (0)
+       if o == '--version' or o == '-v':
+               print_version ()
+               sys.exit (0)
+       else:
+               print o
+               raise getopt.error
+
+# identify ()
+
+if len (files) < 1:
+       help ()
+       sys.exit (2)
+
+#command = files[0]
+#sys.system ("/usr/bin/time %s" % command)
+pid = 0
+status = 0
+t = 0
+avg_size = 0
+max_size = 0
+avg_rss = 0
+max_rss = 0
+INTERVAL = 0.1
+
+# why doesn't it work when put in a function?
+#def time ():
+#      global status, t;
+#      #child_pid = os.fork ()
+#      child_pid = forkit ()
+#      if child_pid:
+#              #Parent
+#              while 1:
+#                      try:
+#                              # AARg, wait takes only 1 argument,
+#                              # but this still compiled
+#                              #(pid, status) = os.wait (child_pid, os.WNOHANG)
+#                              (pid, status) = os.waitpid (child_pid, os.WNOHANG)
+#                              if not pid:
+#                                      time.sleep (INTERVAL)
+#                                      t = t + 1
+#                                      print ("s: %d" % t)
+#                      except:
+#                              break
+#      else:
+#              # Child
+#              status = os.system ("/usr/bin/time %s" % string.join (files, " "))
+#              sys.exit (status)
+
+
+if 0:
+       # cute, but this doesn't work: we get resources of /usr/bin/time
+       command = "/usr/bin/time"
+       args = files
+else:
+       # we should do 'time' ourselves:
+       # man 5 proc
+       command = files[0]
+       args = files[1:]
+
+
+child_pid = os.fork ()
+if child_pid:
+       #Parent
+       statm = "/proc/%d/statm" % child_pid
+       while 1:
+               try:
+                       # AARg, wait takes only 1 argument,
+                       # but this still compiled
+                       #(pid, status) = os.wait (child_pid, os.WNOHANG)
+                       (pid, status) = os.waitpid (child_pid, os.WNOHANG)
+               except:
+                       break
+               if pid:
+                       break
+
+               time.sleep (INTERVAL)
+               f = open (statm, "r")
+               stats = f.readline ()
+               f.close ()
+               (size, rss, drie, vier, vijf, zes, zeven) = string.split (stats, " ")
+               t = t + 1
+               size = string.atoi (size)
+               max_size = max (size, max_size)
+               avg_size = avg_size + size
+               rss = string.atoi (rss)
+               max_rss = max (rss, max_rss)
+               avg_rss = avg_rss + rss
+else:
+       # Child
+       #status = os.system ("/usr/bin/time %s" % string.join (files, " "))
+       #sys.exit (status)
+       os.execvp (command, (command,) + tuple (args))
+
+
+ms = max_size * 4.0/1024
+mr = max_size * 4.0/1024
+avg_size = avg_size / t
+avg_rss = avg_rss / t
+as = avg_size * 4.0/1024
+ar = avg_rss * 4.0/1024
+print ("MAXSIZE: %6.3fM(%d), MAXRSS: %6.3fM(%d)" % (ms, max_size, mr, max_rss))
+print ("AVGSIZE: %6.3fM(%d), AVGRSS: %6.3fM(%d)" % (as, avg_size, ar, avg_rss))
+sys.exit (status)