microsoft / deoptexplorer-vscode

A VS Code extension to visualize deoptimizations in your JavaScript and TypeScript code running in V8 (i.e., NodeJS, Edge, Chrome, etc.).
MIT License
754 stars 9 forks source link

Deopt explorer does not produce output when errors occur #11

Closed millerick closed 1 year ago

millerick commented 1 year ago

Running node 14.16.1 and invoking with the following to produce the log file to analyze.

node --trace-deopt --trace-ic --trace-maps --trace-maps-details --log-code --log-source-code --prof --log-internal-timer-events --detailed-line-info --logfile=v8.log --no-logfile-per-isolate dist/cluster-web.js

I'm attempting to use the deopt explorer on my company's largest node project. Once the file loads, a large number of errors are streamed to the output log in VS Code, all different variants of the following:

[ERR!: 12:30:19.786] line 140361: Expected argument to be an absolute path or URI: 'domain.js'
TypeError: Expected argument to be an absolute path or URI: 'domain.js'
    at t.pathOrUriStringToUri (/Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:5:155602)
    at Function.parse (/Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:5:8981)
    at finishInitialize (/Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:165:22342)
    at new f (/Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:165:25040)
    at t.Profile.addFuncCode (/Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:165:40423)
    at t.LogProcessor.processCodeCreation (/Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:2:180192)
    at u.dispatchLogRow_ (/Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:165:35835)
    at u.processLogLine_ (/Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:165:36292)
    at u.processLogLine (/Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:165:34581)
    at t.LogProcessor.processContent (/Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:2:174391)
    at t.measureAsync (/Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:5:27865)
    at t.LogProcessor.process (/Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:2:174665)
    at /Users/mmillerick/.vscode/extensions/rbuckton.deoptexplorer-vscode-1.0.2-darwin-arm64/dist/extension.js:5:42522

and the normal view in the extension does not open. Instead it reverts to showing file selection: image

rbuckton commented 1 year ago

Thanks for the stack trace, I'll take a look. It sounds like the extension was expecting a V8 trace event to contain an absolute path for fully-qualified URL, but received a bare file name instead. I'll see if I can make this more resilient.

rbuckton commented 1 year ago

This should be fixed by #15.