comparison pytools/gl.py @ 3713:d6a0c46a73b2

Add all DaCapo benchmarks, allow batch execution of all DaCapo benchmarks, add -d flag to start HotSpot under the debugger
author Christian Wimmer <christian.wimmer@oracle.com>
date Tue, 13 Dec 2011 21:16:50 -0800
parents 4a76e44544d9
children
comparison
equal deleted inserted replaced
3710:4e037604f6ee 3713:d6a0c46a73b2
59 self._mx = None 59 self._mx = None
60 60
61 ArgumentParser.__init__(self, prog='gl') 61 ArgumentParser.__init__(self, prog='gl')
62 62
63 self.add_argument('-v', action='store_true', dest='verbose', help='enable verbose output') 63 self.add_argument('-v', action='store_true', dest='verbose', help='enable verbose output')
64 self.add_argument('-d', action='store_true', dest='java_dbg', help='make Java processes wait on port 8000 for a debugger')
64 self.add_argument('--dacapo', help='path to DaCapo 9.12 jar file', metavar='<path>') 65 self.add_argument('--dacapo', help='path to DaCapo 9.12 jar file', metavar='<path>')
65 self.add_argument('--jdk7', help='JDK7 in which the GraalVM will be installed', metavar='<path>') 66 self.add_argument('--jdk7', help='JDK7 in which the GraalVM will be installed', metavar='<path>')
66 self.add_argument('-M', dest='maxine', help='path to Maxine code base', metavar='<path>') 67 self.add_argument('-M', dest='maxine', help='path to Maxine code base', metavar='<path>')
67 68
68 def parse_cmd_line(self, configFile): 69 def parse_cmd_line(self, configFile):
112 def run_dacapo(self, args): 113 def run_dacapo(self, args):
113 if self.dacapo is None: 114 if self.dacapo is None:
114 self.abort('Need to specify DaCapo jar with --dacapo option or DACAPO environment variable') 115 self.abort('Need to specify DaCapo jar with --dacapo option or DACAPO environment variable')
115 if not isfile(self.dacapo) or not self.dacapo.endswith('.jar'): 116 if not isfile(self.dacapo) or not self.dacapo.endswith('.jar'):
116 self.abort('Specified DaCapo jar file does not exist or is not a jar file: ' + self.dacapo) 117 self.abort('Specified DaCapo jar file does not exist or is not a jar file: ' + self.dacapo)
117 return self.run_vm(['-Xms1g', '-Xmx2g', '-esa', '-XX:-GraalBailoutIsFatal', '-G:-QuietBailout', '-cp', self.dacapo] + args) 118 return self.run_vm(['-Xms1g', '-Xmx2g', '-esa', '-cp', self.dacapo] + args)
118 119
119 def run_vm(self, args, vm='-graal'): 120 def run_vm(self, args, vm='-graal'):
120 if self.maxine is None: 121 if self.maxine is None:
121 configFile = join(dirname(sys.argv[0]), 'glrc') 122 configFile = join(dirname(sys.argv[0]), 'glrc')
122 self.abort('Path to Maxine code base must be specified with -M option or MAXINE environment variable (in ' + configFile + ')') 123 self.abort('Path to Maxine code base must be specified with -M option or MAXINE environment variable (in ' + configFile + ')')
123 if not exists(join(self.maxine, 'com.oracle.max.graal.hotspot', 'bin', 'com', 'oracle', 'max', 'graal', 'hotspot', 'VMEntriesNative.class')): 124 if not exists(join(self.maxine, 'com.oracle.max.graal.hotspot', 'bin', 'com', 'oracle', 'max', 'graal', 'hotspot', 'VMEntriesNative.class')):
124 self.abort('Maxine code base path specified -M option or MAXINE environment variable does not contain com.oracle.max.graal.hotspot/bin/com/oracle/max/graal/hotspot/VMEntriesNative.class: ' + self.maxine) 125 self.abort('Maxine code base path specified -M option or MAXINE environment variable does not contain com.oracle.max.graal.hotspot/bin/com/oracle/max/graal/hotspot/VMEntriesNative.class: ' + self.maxine)
125 126
127 if self.java_dbg:
128 args = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000'] + args
129
126 os.environ['MAXINE'] = self.maxine 130 os.environ['MAXINE'] = self.maxine
127 exe = join(self.jdk7, 'bin', self.exe('java')) 131 exe = join(self.jdk7, 'bin', self.exe('java'))
128 return self.run([exe, vm] + args) 132 return self.run([exe, vm] + args)
129 133
130 def run(self, args, nonZeroIsFatal=True, out=None, err=None, cwd=None): 134 def run(self, args, nonZeroIsFatal=True, out=None, err=None, cwd=None):