Skip to content

Commit

Permalink
v8 prof file names
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmarkclements committed Feb 8, 2018
1 parent 6cc5dd3 commit ab874d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/prof-log-convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ function profLogConvert ({isolateLogPath, pid, folder, stream}, args) {

data.ticks.forEach((tick) => {
stream.write(`${proc} ${pid} ${tick.tm}: ${profName}:\n`)
stream.write(tick.stack.map(({name}) => {
stream.write(tick.stack.map(({name, kind}) => {
if (!name) return 'UKNOWN'
if (name[0] === ' ') name = '(anonymous)' + name
if (kind === 'Opt') name = '*' + name
if (kind === 'Unopt') name = '~' + name
return space + name
}).join('\n'))
stream.write('\n\n')
Expand Down
2 changes: 1 addition & 1 deletion lib/stack-convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Profile.prototype.addFrame = function (frame) {

this.stack.unshift(
frame
.replace(/^\w+ /, '')
.replace(/^\w+ /, '') // removes the hex address in linux stacks, works in dtrace stacks because first word always has symbols
.replace(/ \(\S+\)$/, '')
.replace(/(..)[(<].*/, '$1')
)
Expand Down

0 comments on commit ab874d7

Please sign in to comment.