1*c29d5175SchristosJavaScript - DTracing JavaScript 2*c29d5175Schristos 3*c29d5175Schristos There scripts trace the JavaScript programming language, and require a 4*c29d5175Schristos browser to be built with the DTrace JavaScript provider. 5*c29d5175Schristos 6*c29d5175Schristos The DTrace JavaScript provider was originally written by Brendan Gregg, 7*c29d5175Schristos and later developed as part of a Mozilla DTrace provider suite by 8*c29d5175Schristos engineers from both Sun and Mozilla. It currently exists as patches 9*c29d5175Schristos to the Mozilla source tree and requires building from source to get 10*c29d5175Schristos working; it may be integrated into Solaris builds by default in the 11*c29d5175Schristos future. To download the current patches and instructions, visit, 12*c29d5175Schristos 13*c29d5175Schristos http://www.opensolaris.org/os/project/mozilla-dtrace/ 14*c29d5175Schristos 15*c29d5175Schristos A rough guide for the process is, 16*c29d5175Schristos 17*c29d5175Schristos 1. Download the Mozilla source 18*c29d5175Schristos http://developer.mozilla.org/en/docs/Mozilla_Source_Code_Via_CVS 19*c29d5175Schristos 2. Download the Mozilla DTrace framework patch, and apply 20*c29d5175Schristos https://bugzilla.mozilla.org/show_bug.cgi?id=370906 21*c29d5175Schristos 3. Download the JavaScript DTrace provider patch, and apply 22*c29d5175Schristos https://bugzilla.mozilla.org/show_bug.cgi?id=388564 23*c29d5175Schristos 4. Create a .mozconfig file (needed for compilation). 24*c29d5175Schristos 5. Setup various compilation environment vars (CC/CFLAGS/CXX/...) 25*c29d5175Schristos 6. autoconf 26*c29d5175Schristos 7. ./configure --enable-dtrace 27*c29d5175Schristos 8. gmake 28*c29d5175Schristos 29*c29d5175Schristos See John Rice's instructions linked from the OpenSolaris page above 30*c29d5175Schristos for details on steps 4-8. 31*c29d5175Schristos 32*c29d5175Schristos Since the DTrace JavaScript provider may be developed further, there is a 33*c29d5175Schristos chance that it has changed slightly by the time you are reading this, 34*c29d5175Schristos causing these scripts to either break or behave oddly. Firstly, check for 35*c29d5175Schristos newer versions of the DTraceToolkit; if it hasn't been updated and you need 36*c29d5175Schristos to use these scripts immediately, then updating them shouldn't take 37*c29d5175Schristos too long. The following was the state of the provider when these scripts 38*c29d5175Schristos were written - check for changes and update the scripts accordingly, 39*c29d5175Schristos 40*c29d5175Schristos provider javascript { 41*c29d5175Schristos probe function-entry(file, class, func) 42*c29d5175Schristos probe function-info(file, class, func, lineno, runfile, runlineno) 43*c29d5175Schristos probe function-args(file, class, func, argc, argv, argv0, argv1, 44*c29d5175Schristos argv2, argv3, argv4) 45*c29d5175Schristos probe function-rval(file, class, func, lineno, rval, rval0) 46*c29d5175Schristos probe function-return(file, class, func) 47*c29d5175Schristos probe object-create-start(file, class) 48*c29d5175Schristos probe object-create(file, class, *object, rlineno) 49*c29d5175Schristos probe object-create-done(file, class) 50*c29d5175Schristos probe object-finalize(NULL, class, *object) 51*c29d5175Schristos probe execute-start(file, lineno) 52*c29d5175Schristos probe execute-done(file, lineno) 53*c29d5175Schristos }; 54*c29d5175Schristos 55