Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

perf-sym

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

perf-sym - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

8

cmd.js
#!/usr/bin/env node
var args = require('minimist')(process.argv.slice(2))
var pump = require('pump')
/*

@@ -16,3 +16,3 @@ cat stacks.out | perf-sym <pid>

require('./')(Object.assign(args, {
var stream = require('./')(Object.assign(args, {
pid: args._[0],

@@ -32,2 +32,4 @@ internal: {

}
})
})
pump(process.stdin, stream, process.stdout)

@@ -21,3 +21,3 @@ var fs = require('fs')

if (notFound(mapFile)) return
if (notFound(mapFile, opts)) return

@@ -30,59 +30,70 @@ var map = fs.readFileSync(mapFile, 'utf8')

pump(
process.stdin,
split(function(line) {
var match
var res
var p
var stream = split(function(line) {
var match
var res
var p
if (!(match = line.match(hexRx))) {
errors++
if (!(match = line.match(hexRx))) {
errors++
return line + '\n'
}
if (res = resolver.resolve(match[1])) {
found++
line = line
.replace(hexRx, (keepAddr ? '$1 ' : '') + res.symbol)
.replace(optRx, '~*')
.replace(frameRx, '$1')
return line + '\n'
}
if (res = resolver.resolve(match[1])) {
found++
line = line
.replace(hexRx, (keepAddr ? '$1 ' : '') + res.symbol)
.replace(optRx, '~*')
.replace(frameRx, '$1')
if (relative) {
p = line.trim().split(' ').slice(1).join(' ')
if (p && (p[0] === '/' || p[0] === '.')) {
line = line.replace(p, path.relative(relative, p))
}
if (relative) {
p = line.trim().split(' ').slice(1).join(' ')
if (p && (p[0] === '/' || p[0] === '.')) {
line = line.replace(p, path.relative(relative, p))
}
return internal(line, opts.internal) ? '' : line + '\n'
}
}),
process.stdout
)
return internal(line, opts.internal) ? '' : line + '\n'
}
})
eos(process.stdin, function () {
process.stdout.write('\n\n') //<-- important final line
stream.on('pipe', function (src) {
if (!opts.silent) {
eos(src, function () {
console.error('symbols found', found)
console.error('symbols not found', errors)
console.error('done')
})
}
console.error('symbols found', found)
console.error('symbols not found', errors)
console.error('done')
stream.pipe = (function (pipe) {
return function (dest) {
eos(src, function () {
dest.write('\n\n') //<-- important final line
})
return pipe.apply(stream, arguments)
}
}(stream.pipe))
})
return stream
}
function notFound(file) {
function notFound(file, opts) {
if (!fs.existsSync(file)|| !fs.statSync(file).size) {
console.error([
,
'There should be a ' + file + ' file (with a size greater than zero)',
'It\'s either not there or it\'s empty, make sure you ran your process with',
'--perf-basic-prof, and make sure to clean up when process receives a SIGINT',
'see the on-sigint and close-server-on-sigint modules for example',
,
].join('\n'))
if (!opts.silent) {
console.error([
,
'There should be a ' + file + ' file (with a size greater than zero)',
'It\'s either not there or it\'s empty, make sure you ran your process with',
'--perf-basic-prof, and make sure to clean up when process receives a SIGINT',
'see the on-sigint and close-server-on-sigint modules for example',
,
].join('\n'))
}
return true
}
}
{
"name": "perf-sym",
"version": "1.0.5",
"version": "1.0.6",
"description": "Translate symbol names generated by `--basic-perf-prof` into JavaScript names",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc