The script will try to build d8 in $tools_dir/.. in case it will not find d8 netiher in $D8_PATH, nor in $PATH.
I can add something like --no-build option to prohibit building at all. But I would like to keep auto-building since personally I find it useful. On Thu, Jun 18, 2009 at 23:05, Erik Corry<[email protected]> wrote: > Does this mean it never tries to build d8 when you call the profiler? > > 2009/6/18 <[email protected]> >> >> Reviewers: Erik Corry, >> >> Description: >> Two requested changes to tick processor. >> >> 1. If D8_PATH isn't specified, first try to locate 'd8' shell in path, >> and if not found, fallback to the one in tools_path/.. >> 2. Add '--nm=<nm_exec>' parameter to specify 'nm' executable to use. >> >> Please review this at http://codereview.chromium.org/132021 >> >> Affected files: >> M tools/linux-tick-processor >> M tools/tickprocessor.js >> >> >> Index: tools/linux-tick-processor >> diff --git a/tools/linux-tick-processor b/tools/linux-tick-processor >> index >> 2de988cc4b38049cd6e4cbb0ec72d06f36c98938..3df7ce1864b30b682a833fe68139b13c2bded182 >> 100755 >> --- a/tools/linux-tick-processor >> +++ b/tools/linux-tick-processor >> @@ -1,6 +1,10 @@ >> #!/bin/sh >> >> tools_path=`cd $(dirname "$0");pwd` >> +if [ ! "$D8_PATH" ]; then >> + d8_public=`which d8` >> + if [ $d8_public ]; then D8_PATH=$(dirname "$d8_public"); fi >> +fi >> [ "$D8_PATH" ] || D8_PATH=$tools_path/.. >> d8_exec=$D8_PATH/d8 >> >> Index: tools/tickprocessor.js >> diff --git a/tools/tickprocessor.js b/tools/tickprocessor.js >> index >> 72d367f1990aab42b80b46435b3e446f8bddd5fd..ed6b34b9faa0faf0d1ce8a7e9453ce29076285c0 >> 100644 >> --- a/tools/tickprocessor.js >> +++ b/tools/tickprocessor.js >> @@ -410,9 +410,10 @@ CppEntriesProvider.prototype.parseNextLine = >> function() { >> }; >> >> >> -function UnixCppEntriesProvider() { >> +function UnixCppEntriesProvider(nmExec) { >> this.symbols = []; >> this.parsePos = 0; >> + this.nmExec = nmExec; >> }; >> inherits(UnixCppEntriesProvider, CppEntriesProvider); >> >> @@ -424,8 +425,8 @@ UnixCppEntriesProvider.prototype.loadSymbols = >> function(libName) { >> this.parsePos = 0; >> try { >> this.symbols = [ >> - os.system('nm', ['-C', '-n', libName], -1, -1), >> - os.system('nm', ['-C', '-n', '-D', libName], -1, -1) >> + os.system(this.nmExec, ['-C', '-n', libName], -1, -1), >> + os.system(this.nmExec, ['-C', '-n', '-D', libName], -1, -1) >> ]; >> } catch (e) { >> // If the library cannot be found on this system let's not panic. >> @@ -523,7 +524,8 @@ function processArguments(args) { >> platform: 'unix', >> stateFilter: null, >> ignoreUnknown: false, >> - separateIc: false >> + separateIc: false, >> + nm: 'nm' >> }; >> var argsDispatch = { >> '-j': ['stateFilter', TickProcessor.VmStates.JS, >> @@ -543,7 +545,9 @@ function processArguments(args) { >> '--unix': ['platform', 'unix', >> 'Specify that we are running on *nix platform'], >> '--windows': ['platform', 'windows', >> - 'Specify that we are running on Windows platform'] >> + 'Specify that we are running on Windows platform'], >> + '--nm': ['nm', 'nm', >> + 'Specify the \'nm\' executable to use (e.g. --nm=/my_dir/nm)'] >> }; >> argsDispatch['--js'] = argsDispatch['-j']; >> argsDispatch['--gc'] = argsDispatch['-g']; >> @@ -575,9 +579,15 @@ function processArguments(args) { >> break; >> } >> args.shift(); >> + var userValue = null; >> + var eqPos = arg.indexOf('='); >> + if (eqPos != -1) { >> + userValue = arg.substr(eqPos + 1); >> + arg = arg.substr(0, eqPos); >> + } >> if (arg in argsDispatch) { >> var dispatch = argsDispatch[arg]; >> - result[dispatch[0]] = dispatch[1]; >> + result[dispatch[0]] = userValue == null ? dispatch[1] : userValue; >> } else { >> printUsageAndExit(); >> } >> @@ -592,7 +602,7 @@ function processArguments(args) { >> >> var params = processArguments(arguments); >> var tickProcessor = new TickProcessor( >> - params.platform == 'unix' ? new UnixCppEntriesProvider() : >> + params.platform == 'unix' ? new UnixCppEntriesProvider(params.nm) : >> new WindowsCppEntriesProvider(), >> params.separateIc, >> params.ignoreUnknown, >> >> > > > > -- > Erik Corry, Software Engineer > Google Denmark ApS. CVR nr. 28 86 69 84 > c/o Philip & Partners, 7 Vognmagergade, P.O. Box 2227, DK-1018 Copenhagen K, > Denmark. > --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
