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