Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27a82a2ee7 | ||
|
|
b15a08b3ff | ||
|
|
68683aa054 | ||
|
|
eb0e1ce731 |
@@ -1,5 +1,11 @@
|
||||
## Unreleased
|
||||
|
||||
## [1.5.2] - 2019-10-10
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fix emscripten remapping when symbols are hex-escaped, like `a\20b` [#233] (by @jyc)
|
||||
|
||||
## [1.5.1] - 2019-06-06
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -40,8 +40,13 @@ speedscope is designed to ingest profiles from a variety of different profilers
|
||||
- Ruby
|
||||
- [Importing from stackprof](https://github.com/jlfwong/speedscope/wiki/Importing-from-stackprof-(ruby))
|
||||
- [Importing from rbspy](https://github.com/jlfwong/speedscope/wiki/Importing-from-rbspy-(ruby))
|
||||
- Python
|
||||
- [Importing from py-spy](https://github.com/jlfwong/speedscope/wiki/Importing-from-py-spy-(python))
|
||||
- [pyspeedscope](https://github.com/windelbouwman/pyspeedscope)
|
||||
- Go
|
||||
- [Importing from pprof](https://github.com/jlfwong/speedscope/wiki/Importing-from-pprof-(go))
|
||||
- Rust
|
||||
- [flamescope](https://github.com/coolreader18/flamescope)
|
||||
- Native code
|
||||
- [Importing from Instruments.app](https://github.com/jlfwong/speedscope/wiki/Importing-from-Instruments.app) (macOS)
|
||||
- [Importing from `perf`](https://github.com/jlfwong/speedscope/wiki/Importing-from-perf-(linux)) (linux)
|
||||
|
||||
Generated
+2679
-2593
File diff suppressed because it is too large
Load Diff
+21
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "speedscope",
|
||||
"version": "1.5.1",
|
||||
"version": "1.5.2",
|
||||
"description": "",
|
||||
"repository": "jlfwong/speedscope",
|
||||
"main": "index.js",
|
||||
@@ -17,8 +17,15 @@
|
||||
"test": "tsc --noEmit && npm run lint && npm run coverage",
|
||||
"serve": "parcel assets/index.html --open --no-autoinstall"
|
||||
},
|
||||
"files": ["bin/cli.js", "dist/release/**", "!*.map"],
|
||||
"browserslist": ["last 2 Chrome versions", "last 2 Firefox versions"],
|
||||
"files": [
|
||||
"bin/cli.js",
|
||||
"dist/release/**",
|
||||
"!*.map"
|
||||
],
|
||||
"browserslist": [
|
||||
"last 2 Chrome versions",
|
||||
"last 2 Firefox versions"
|
||||
],
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
@@ -51,8 +58,17 @@
|
||||
"^.+\\.tsx?$": "ts-jest"
|
||||
},
|
||||
"testRegex": "\\.test\\.tsx?$",
|
||||
"collectCoverageFrom": ["**/*.{ts,tsx}", "!**/*.d.{ts,tsx}"],
|
||||
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json"]
|
||||
"collectCoverageFrom": [
|
||||
"**/*.{ts,tsx}",
|
||||
"!**/*.d.{ts,tsx}"
|
||||
],
|
||||
"moduleFileExtensions": [
|
||||
"ts",
|
||||
"tsx",
|
||||
"js",
|
||||
"jsx",
|
||||
"json"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"opn": "5.3.0"
|
||||
|
||||
@@ -41,6 +41,10 @@ test('importEmscriptenSymbolMap', () => {
|
||||
'1:B',
|
||||
'2:C',
|
||||
'3:D-D',
|
||||
'4:a\\20b',
|
||||
'5:a\\2',
|
||||
'6:a\\3z',
|
||||
'7:a\\20b\\20c',
|
||||
].join('\n'),
|
||||
),
|
||||
).toEqual(
|
||||
@@ -49,6 +53,10 @@ test('importEmscriptenSymbolMap', () => {
|
||||
['wasm-function[1]', 'B'],
|
||||
['wasm-function[2]', 'C'],
|
||||
['wasm-function[3]', 'D-D'],
|
||||
['wasm-function[4]', 'a b'],
|
||||
['wasm-function[5]', 'a\\2'],
|
||||
['wasm-function[6]', 'a\\3z'],
|
||||
['wasm-function[7]', 'a b c'],
|
||||
]),
|
||||
)
|
||||
|
||||
|
||||
+13
-3
@@ -1,5 +1,15 @@
|
||||
type EmscriptenSymbolMap = Map<string, string>
|
||||
|
||||
// Returns `input` with hex escapes expanded (e.g. `\20` becomes ` `.)
|
||||
//
|
||||
// NOTE: This will fail to ignore escaped backslahes (e.g. `\\20`).
|
||||
function unescapeHex(input: string): string {
|
||||
return input.replace(/\\([a-fA-F0-9]{2})/g, (_match, group) => {
|
||||
const scalar = parseInt(group, 16)
|
||||
return String.fromCharCode(scalar)
|
||||
})
|
||||
}
|
||||
|
||||
// This imports symbol maps generated by emscripten using the "--emit-symbol-map" flag.
|
||||
// It allows you to visualize a profile captured in a release build as long as you also
|
||||
// have the associated symbol map. To do this, first drop the profile into speedscope
|
||||
@@ -14,21 +24,21 @@ export function importEmscriptenSymbolMap(contents: string): EmscriptenSymbolMap
|
||||
if (!lines.length) return null
|
||||
|
||||
const map: EmscriptenSymbolMap = new Map()
|
||||
const intRegex = /^(\d+):([\$\w-]+)$/
|
||||
const intRegex = /^(\d+):(.+)$/
|
||||
const idRegex = /^([\$\w]+):([\$\w-]+)$/
|
||||
|
||||
for (const line of lines) {
|
||||
// Match lines like "103:__ZN8tinyxml210XMLCommentD0Ev"
|
||||
const intMatch = intRegex.exec(line)
|
||||
if (intMatch) {
|
||||
map.set(`wasm-function[${intMatch[1]}]`, intMatch[2])
|
||||
map.set(`wasm-function[${intMatch[1]}]`, unescapeHex(intMatch[2]))
|
||||
continue
|
||||
}
|
||||
|
||||
// Match lines like "u6:__ZN8tinyxml210XMLCommentD0Ev"
|
||||
const idMatch = idRegex.exec(line)
|
||||
if (idMatch) {
|
||||
map.set(idMatch[1], idMatch[2])
|
||||
map.set(idMatch[1], unescapeHex(idMatch[2]))
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user