Skip to content

Instantly share code, notes, and snippets.

@developit
Last active February 27, 2020 01:54
Show Gist options
  • Star 36 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save developit/64027410b3a09d2eca72d73b0a392b08 to your computer and use it in GitHub Desktop.
Save developit/64027410b3a09d2eca72d73b0a392b08 to your computer and use it in GitHub Desktop.
Alias to invoke Chrome Canary w/ tracing, for IRHydra

An Alias to run Chrome with tracing enabled

For Chrome Canary:

alias hydra='/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --no-sandbox --js-flags="--user-data-dir=/tmp/profile --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces"'

For regular ol' Chrome:

alias hydra='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --no-sandbox --js-flags="--user-data-dir=/tmp/profile --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces"'

Usage:

  1. Run this with the desired URL:

hydra http://localhost:8080

  1. let it run for a few seconds, then close it
  2. go to http://mrale.ph/irhydra/2/
  3. click the folder icon
  4. select hydrogen-*.cfg and code-*.asm the above command spit out in your current working directory.
@lukeed
Copy link

lukeed commented Jan 27, 2017

There a way to run this for Node CLI apps, without an exposed port? Couldn't figure it out a while ago and didn't revisit since.

@CYBAI
Copy link

CYBAI commented Jun 2, 2017

I think the --user-data-dir=/tmp/profile flag should be out of --js-flags.

Like following,

alias hydra='/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --no-sandbox --user-data-dir=/tmp/profile --js-flags="--trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment