thlorenz / deoptigate

⏱️ Investigates v8/Node.js function deoptimizations.
https://nodesource.github.io/deoptigate-examples/xml2js/01_start/?selectedFileIdx=31&selectedLocation=157&includeAllSeverities=false&highlightCode=true&selectedTabIdx=1&selectedSummaryTabIdx=1
MIT License
1.16k stars 22 forks source link

chrome support #6

Open zebontheweb opened 6 years ago

zebontheweb commented 6 years ago

Hello, i tried to run the tool with a log generated by :

"E:\chromium\chrome.exe" --no-sandbox --js-flags="--trace-ic"

but i have a lot of errors, like this one :

code-creation,LazyCompile,10,2463053,0x359ed4c60ea,37,makeCallable extensions::SafeBuiltins:7:22,0x359ed4c50a8,~ ^^^^^^^^^^

SyntaxError: Unexpected identifier at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:616:28) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:191:16) at bootstrap_node.js:612:3

Would it be possible to extend the tool to support logs generated from chrome ?

thlorenz commented 6 years ago

Interesting idea. Not sure how easy that would be .. mostly ignoring those lines that cause errors. The processing is done by a v8 tool that I pulled out of v8/tools and am hosting here.

So maybe file this issue inside the v8 somewhere to find out if they can update the processor there and I can pull the changes?

zebontheweb commented 6 years ago

What is strange is that these tools are also used in the official ic-explorer.html which perfectly process my chrome logs... But their user interface is so poor :-(

thlorenz commented 6 years ago

OK that is interesting ... how are you running deoptigate? You should just do deoptigate in the directory where the v8.log got saved, i.e. don't do deoptigate v8.log.

If you keep having problems do you mind posting the v8.log file?

zebontheweb commented 6 years ago

I was indeed running it badly, obvioulsy leading the log to be interpreted as JS code :-)

I still have an error : deoptigate ?: TypeError: Path must be a string. Received null

but will dig a little before annoying you again. good exercize for me to learn how to debug node modules.

zebontheweb commented 6 years ago

Well i think i will give up on this one ;-)

after diving a little bit in your code, it seems you read js files (i assume to generate the pretty HTML view of it ?) using node file APIs, so there is probably a huge work to make it work with js files behind an http server.

What is strange is that even with node i have errors :

1/ The processing of the log eats some parts of js filename 2/ resolution of full pathes for js files fails

I attach several files :

v8. log the output for execution with node on one of the sample in your repo test.txt the sample itself v8.log

isolate-0000000003BBE5E0-v8.log : an example of chrome log

isolate-0000000003BBE5E0-v8.log

test.txt

billti commented 5 years ago

See my gist at https://gist.github.com/billti/a2ee40e60611ec9b37b89c7c00cd39ab for details on capturing/processing a log from the browser.

pbadenski commented 4 years ago

I'm getting an empty html even after following instructions in the gist. Might be related to: https://github.com/thlorenz/deoptigate/issues/9

Would be really cool if deoptigate supported collecting data from Chrome - looking for realistic profiling data of a live application.