changeset 4354:3abb137806c7

Merge.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 17 Jan 2012 23:35:39 +0100
parents 043bec543161 (current diff) 2bc254976621 (diff)
children 636e2fcbbe32
files mx/benchmarkdb.py
diffstat 8 files changed, 64 insertions(+), 86 deletions(-) [+]
line wrap: on
line diff
--- a/mx/benchmarkdb.py	Tue Jan 17 23:35:21 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-import sqlite3
-
-class BenchmarkDb:
-    def __init__(self, path):
-        self.con = sqlite3.connect(path)
-        c = self.con.cursor();
-        c.execute('pragma foreign_keys = on')
-        c.execute('create table if not exists results (revnum integer, foreign key(benchmarkid) references benchmarks(benchmarkid), foreign key(valueid) references benchmarkvalues(valueid), value real)')
-        c.execute('create table if not exists benchmarks (benchmarkid integer primary key autoincrement, name text)')
-        c.execute('create table if not exists benchmarkvalues (valueid integer primary key autoincrement, name text)')
-        self.con.commit()
-        c.close()
-
-    def insertResults(self, revision, results):
-        c = self.con.cursor()
-        for result in results:
-            if not result.has_key('benchmark'):
-                continue
-            benchmarkName = result['benchmark']
-            del result['benchmark']
-            if len(result.keys()) <= 0:
-                continue
-            
-            benchIdRow = c.execute('select benchmarkid from benchmarks where name="' + benchmarkName + '"').fetchone()
-            benchId = -1;
-            if benchIdRow is None:
-                c.execute('insert into benchmarks (name) values ("' + benchmarkName + '")  values ')
-                benchId = c.lastrowid()
-            else:
-                benchId = benchIdRow['benchmarkid']
-            
-            insertcmd = 'insert into results (revnum, benchmarkid, valueid, value) '
-            first = True
-            for valueName in result.keys():
-                valueIdRow = c.execute('select valueid from benchmarkvalues where name="' + valueName + '"').fetchone()
-                valueId = -1;
-                if valueIdRow is None:
-                    c.execute('insert into benchmarkvalues (name) values ("' + valueName + '")')
-                    valueId = c.lastrowid()
-                else:
-                    valueId = benchIdRow['valueid']
-                
-                if first:
-                    insertcmd = insertcmd + 'select ' + str(revision) + ' as revnum, ' + str(benchId) + ' as benchmarkid, ' + str(valueId) + ' as valueid, ' + result[valueName] + ' as value '
-                else:
-                    insertcmd = insertcmd + 'union select ' + str(revision) + ', ' + str(benchId) + ', ' + str(valueId) + ', ' + result[valueName] + ' '
-            c.execute(insertcmd)
-        self.con.commit()
-        c.close()
-        
-    def close(self):
-        self.con.close()
\ No newline at end of file
--- a/mx/commands.py	Tue Jan 17 23:35:21 2012 +0100
+++ b/mx/commands.py	Tue Jan 17 23:35:39 2012 +0100
@@ -31,6 +31,7 @@
 from argparse import ArgumentParser, REMAINDER
 import mx
 import sanitycheck
+import json
 
 _graal_home = dirname(dirname(__file__))
 _vmSourcesAvailable = exists(join(_graal_home, 'make')) and exists(join(_graal_home, 'src')) 
@@ -507,19 +508,50 @@
     total.stop()
 
 def bench(args):
+    """run benchmarks and parse their ouput for results
+
+    Results are JSON formated : {group : {benchmark : score}}."""
+    resultFile = None
+    if '-resultfile' in args:
+        index = args.index('-resultfile')
+        if index + 1 < len(args):
+            resultFile = args[index + 1]
+	    del args[index]
+	    del args[index]
+        else:
+            mx.abort('-resultfile must be followed by a file name')
+    vm = 'graal'
+    if '-vm' in args:
+        index = args.index('-vm')
+        if index + 1 < len(args):
+            vm = args[index + 1]
+            del args[index]
+	    del args[index]
+        else:
+            mx.abort('-vm must be followed by a vm name (graal, server, client..)')
+    if len(args) is 0:
+        args += ['all']
+
     results = {}
+    benchmarks = []
     #DaCapo
-    benchmarks = sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Benchmark)
+    if ('dacapo' in args or 'all' in args):
+        benchmarks += sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Benchmark)
     #Bootstrap
-    benchmarks += sanitycheck.getBootstraps()
+    if ('bootstrap' in args or 'all' in args):
+        benchmarks += sanitycheck.getBootstraps()
     #SPECjvm2008
-    benchmarks += [sanitycheck.getSPECjvm2008(True, 60, 120)]
+    if ('specjvm2008' in args or 'all' in args):
+        benchmarks += [sanitycheck.getSPECjvm2008(True, 120, 120)]
     
     for test in benchmarks:
         if not results.has_key(test.group):
             results[test.group] = {}
-        results[test.group].update(test.bench('-graal'))
-    print results
+        results[test.group].update(test.bench('-' + vm))
+    mx.log(json.dumps(results))
+    if resultFile:
+        with open(resultFile, 'w') as f:
+            f.write(json.dumps(results))
     
 def specjvm2008(args):
     sanitycheck.getSPECjvm2008().bench('-graal')
@@ -534,7 +566,7 @@
         'specjvm2008': [specjvm2008, ''],
         'example': [example, '[-v] example names...'],
         'gate' : [gate, ''],
-        'bench' : [bench, ''],
+        'bench' : [bench, '[-vm vm] [-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'],
         'unittest' : [unittest, '[filters...]'],
         'vm': [vm, '[-options] class [args...]']
     }
--- a/mx/outputparser.py	Tue Jan 17 23:35:21 2012 +0100
+++ b/mx/outputparser.py	Tue Jan 17 23:35:39 2012 +0100
@@ -37,7 +37,7 @@
         self.matchers.append(matcher)
     
     def parse(self, vm, cmd, cwd=None, vmbuild=None):
-        ret = [{}]
+        ret = []
         
         def parseLine(line):
             anyMatch = False
@@ -45,7 +45,7 @@
                 parsed = matcher.parse(line.strip())
                 if parsed:
                     anyMatch = True
-                    if matcher.startNewLine and len(ret[0]) > 0:
+                    if len(ret) is 0 or (matcher.startNewLine and len(ret[len(ret)-1]) > 0):
                         ret.append({})
                     ret[len(ret)-1].update(parsed)
             if anyMatch :
--- a/mx/sanitycheck.py	Tue Jan 17 23:35:21 2012 +0100
+++ b/mx/sanitycheck.py	Tue Jan 17 23:35:39 2012 +0100
@@ -31,27 +31,27 @@
 from os.path import isfile, join, exists
 
 dacapoSanityWarmup = {
-    'avrora':     [0, 0,  3,  6, 10],
+    'avrora':     [0, 0,  3,  6, 13],
     'batik':      [0, 0,  5,  5, 20],
-    'eclipse':    [2, 4,  5, 10, 13],
+    'eclipse':    [2, 4,  5, 10, 16],
     'fop':        [4, 8, 10, 20, 30],
-    'h2':         [0, 0,  5,  5,  5],
-    'jython':     [0, 0,  5, 10, 10],
+    'h2':         [0, 0,  5,  5,  8],
+    'jython':     [0, 0,  5, 10, 13],
     'luindex':    [0, 0,  5, 10, 10],
-    'lusearch':   [0, 4,  5,  5,  5],
-    'pmd':        [0, 0,  5, 10, 10],
+    'lusearch':   [0, 4,  5,  5,  8],
+    'pmd':        [0, 0,  5, 10, 13],
     'sunflow':    [0, 0,  5, 10, 15],
-    'tomcat':     [0, 0,  5, 10, 10],
-    'tradebeans': [0, 0,  5, 10, 10],
-    'tradesoap':  [2, 4,  5, 10, 10],
-    'xalan':      [0, 0,  5, 10, 15],
+    'tomcat':     [0, 0,  5, 10, 15],
+    'tradebeans': [0, 0,  5, 10, 13],
+    'tradesoap':  [2, 4,  5, 10, 15],
+    'xalan':      [0, 0,  5, 10, 18],
 }
 
 dacapoGateBuildLevels = {
     'avrora':     ['product', 'fastdebug', 'debug'],
     'batik':      ['product', 'fastdebug', 'debug'],
     'eclipse':    ['product'],
-    'fop':        ['product', 'fastdebug', 'debug'],
+    'fop':        [           'fastdebug', 'debug'],
     'h2':         ['product', 'fastdebug', 'debug'],
     'jython':     ['product', 'fastdebug', 'debug'],
     'luindex':    ['product', 'fastdebug', 'debug'],
@@ -60,7 +60,7 @@
     'sunflow':    ['product', 'fastdebug', 'debug'],
     'tomcat':     ['product', 'fastdebug', 'debug'],
     'tradebeans': ['product', 'fastdebug', 'debug'],
-    'tradesoap':  ['product', 'fastdebug', 'debug'],
+    'tradesoap':  ['product'],
     'xalan':      ['product', 'fastdebug', 'debug'],
 }
 
@@ -87,7 +87,7 @@
     if skipKitValidation:
         opts += ['-ikv']
     
-    return Test("SPECjvm2008", "SPECjvm2008", ['-jar', 'SPECjvm2008.jar'] + opts, [success], [error], [matcher], vmOpts=['-Xms2g'], defaultCwd=specjvm2008)
+    return Test("SPECjvm2008", "SPECjvm2008", ['-jar', 'SPECjvm2008.jar'] + opts, [success], [error], [matcher], vmOpts=['-Xms3g'], defaultCwd=specjvm2008)
 
 def getDacapos(level=SanityCheckLevel.Normal, gateBuildLevel=None, dacapoArgs=[]):
     checks = []
@@ -117,10 +117,10 @@
     
     dacapoMatcher = Matcher(dacapoTime, {'const:name' : 'benchmark', 'const:score' : 'time'})
     
-    return Test("DaCapo-" + name, "DaCapo", ['-jar', dacapo, name, '-n', str(n), ] + dacapoArgs, [dacapoSuccess], [dacapoFail], [dacapoMatcher], ['-Xms1g', '-Xmx2g', '-XX:MaxPermSize=256m'])
+    return Test("DaCapo-" + name, "DaCapo", ['-jar', dacapo, name, '-n', str(n), ] + dacapoArgs, [dacapoSuccess], [dacapoFail], [dacapoMatcher], ['-Xms2g', '-XX:MaxPermSize=256m'])
 
 def getBootstraps():
-    time = re.compile(r"Bootstrapping Graal............... in (?P<time>[0-9]+) ms")
+    time = re.compile(r"Bootstrapping Graal\.+ in (?P<time>[0-9]+) ms")
     scoreMatcher = Matcher(time, {'const:name' : 'const:BootstrapTime', 'const:score' : 'time'})
     tests = []
     tests.append(Test("Bootstrap", "Bootstrap", ['-version'], successREs=[time], scoreMatchers=[scoreMatcher]))
--- a/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/genfiles.properties	Tue Jan 17 23:35:21 2012 +0100
+++ b/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/genfiles.properties	Tue Jan 17 23:35:39 2012 +0100
@@ -2,4 +2,4 @@
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
 nbproject/build-impl.xml.data.CRC32=ebcf0422
 nbproject/build-impl.xml.script.CRC32=42ef3ff6
-nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.45.1
+nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.47.1
--- a/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Parser.java	Tue Jan 17 23:35:21 2012 +0100
+++ b/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Parser.java	Tue Jan 17 23:35:39 2012 +0100
@@ -293,7 +293,7 @@
         @Override
         protected InputBlock start() throws SAXException {
             InputGraph graph = getParentObject();
-            String name = readRequiredAttribute(BLOCK_NAME_PROPERTY).intern();
+            String name = readRequiredAttribute(BLOCK_NAME_PROPERTY);
             InputBlock b = graph.addBlock(name);
             for (InputNode n : b.getNodes()) {
                 assert graph.getBlock(n).equals(b);
@@ -447,12 +447,12 @@
 
         @Override
         public String start() throws SAXException {
-            return readRequiredAttribute(PROPERTY_NAME_PROPERTY).intern();
+            return readRequiredAttribute(PROPERTY_NAME_PROPERTY);
          }
 
         @Override
         public void end(String text) {
-            getParentObject().getProperties().setProperty(getObject(), text.trim().intern());
+            getParentObject().getProperties().setProperty(getObject(), text.trim());
         }
     };
 
--- a/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLParser.java	Tue Jan 17 23:35:21 2012 +0100
+++ b/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLParser.java	Tue Jan 17 23:35:39 2012 +0100
@@ -150,8 +150,8 @@
         public void processAttributesAsProperties(Properties p) {
             int length = attr.getLength();
             for (int i = 0; i < length; i++) {
-                String val = attr.getValue(i).intern();
-                String localName = attr.getLocalName(i).intern();
+                String val = attr.getValue(i);
+                String localName = attr.getLocalName(i);
                 p.setProperty(val, localName);
             }
         }
--- a/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/callgraph.filter	Tue Jan 17 23:35:21 2012 +0100
+++ b/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/filters/callgraph.filter	Tue Jan 17 23:35:39 2012 +0100
@@ -1,5 +1,3 @@
-colorize("abstract", "1", yellow);
-colorize("leaf", "1", lightGray);
-
-var f = new com.sun.hotspot.igv.filter.EdgeColorIndexFilter("INPUTS", [black, pink]);
-f.apply(graph);
+colorize("name", "<init>.*", yellow);
+colorize("name", "<clinit>.*", pink);
+colorize("leaf", "1", red);