diff options
author | Fedor Indutny <fedor@indutny.com> | 2016-09-10 16:05:30 +0300 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2016-09-13 13:47:20 +0300 |
commit | 15d72c8365717e1ccbca4f3bdc388315ba10bc92 (patch) | |
tree | cacff42c4c6b25ab9fb291a2713b9698c6688abc /lib/internal/v8_prof_processor.js | |
parent | 7f2c9ba1ac343ebdd3d4fbe27757847555bf141d (diff) |
tickprocessor: apply c++filt manually on mac
`/bin/sh -c` trick wasn't working for several reasons:
* `/bin/sh -c "..."` expects the first argument after `"..."` to be a
`$0`, not a `$1`. Previously `-n` wasn't passed to `nm` because of
this, and many symbols were ordered improperly
* `c++filt` was applied not only to the names of the functions but to
their `nm` prefixes like `t` and `a` (`t xxx` turns into
`unsigned char xxx`).
Instead of applying `c++filt` wide and using `sh -c`, execute `nm` as
requested by `deps/v8/tools/tickprocessor.js` and apply `c++filt` to all
matching entries manually.
Included test demonstrates where previous approach failed: all builtins
were merged into `v8::internal::Builtins::~Builtins`, because they were
prefixed by `t` in `nm` output.
PR-URL: https://github.com/nodejs/node/pull/8480
Reviewed-By: Matthew Loring <mattloring@google.com>
Diffstat (limited to 'lib/internal/v8_prof_processor.js')
-rw-r--r-- | lib/internal/v8_prof_processor.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/internal/v8_prof_processor.js b/lib/internal/v8_prof_processor.js index 86f06629e1b..95b6254599a 100644 --- a/lib/internal/v8_prof_processor.js +++ b/lib/internal/v8_prof_processor.js @@ -20,8 +20,7 @@ scriptFiles.forEach(function(s) { var tickArguments = []; if (process.platform === 'darwin') { - const nm = 'foo() { nm "$@" | (c++filt -p -i || cat) }; foo $@'; - tickArguments.push('--mac', '--nm=' + nm); + tickArguments.push('--mac'); } else if (process.platform === 'win32') { tickArguments.push('--windows'); } |