109
edits
Joel Reymont (talk | contribs) |
Joel Reymont (talk | contribs) |
||
Line 376: | Line 376: | ||
= DTrace tips and tricks = | = DTrace tips and tricks = | ||
=== Combining scripts === | |||
I find it convenient to have separate DTrace scripts for various exit probes. This way I can avoid editing the main script whenever I want to stop sampling once 10 seconds go by or ''XRE_main'' is entered or the ''BrowserReturn'' JavaScript function returns. | |||
It can be done like this | |||
<pre> | |||
#!/bin/bash | |||
cmd="./Minefield.app/Contents/MacOS/firefox-bin -no-remote -foreground -P 2" | |||
scripts="" | |||
for i in $*; do scripts="$scripts -s $i"; done | |||
sync && purge && dtrace -x dynvarsize=64m -x evaltime=exec -c "$cmd" -wZ $scripts | |||
</pre> | |||
and then | |||
<pre> | |||
./cold.sh startup.d stop-main.d | |||
Total: 11001.481323ms | |||
</pre> | |||
or | |||
<pre> | |||
./cold.sh startup.d stop-js.d | |||
Total: 7004.799264ms | |||
</pre> | |||
My scripts can be [http://github.com/wagerlabs/firefox-startup/tree/master found on GitHub]. | |||
=== No sudo === | === No sudo === |
edits