Changes

Jump to: navigation, search

DTrace 0.1 Release

3,374 bytes added, 11:49, 18 October 2008
New page: ==Purpose== The purpose of 0.1 is to show that I am aware of how a D-Trace probe works, by using a D script to pick up on function call counts (for now) and see what it can gather. This f...
==Purpose==

The purpose of 0.1 is to show that I am aware of how a D-Trace probe works, by using a D script to pick up on function call counts (for now) and see what it can gather. This functionality can only be tested on Mac OS X 10.5 Leopard or Open Solaris.

==Step 1: Build Pre-requisites==

The user is responsible for making sure that thier Mac or Solaris machine has met the requirements for building Mozilla. These instructions ([http://developer.mozilla.org/en/Mac_OS_X_Build_Prerequisites Mac] or [http://developer.mozilla.org/en/Linux_Build_Prerequisites OpenSolaris]) must be met. It is recommended that you have at least built Mozilla at least once and are able to run it.

You must build v3.0.1 or higher of Mozilla Firefox in order to have D-Trace functionality. I used 3.0.3. Retrieve this version [ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.0.3/source/ here]

==Step 2: Change your $PATH global==
There is one specific header file that client.mk or configure will check for. It is called sys/sdt.h. If your current PATH cannot link to it, then not only will D-Trace not work, but Mozilla will not compile. In Mac and Solaris, this problem should be resolved by using this as your $PATH:

<code>export PATH=/usr/include/sys:/usr/include:/opt/local/bin:/opt/local/sbin:$PATH</code>

/usr/include/(sys) contains the sys/sdt.h header you need. The other 2 help resolve a possible issue when compiling on Mac (Your compiler may say libIDL and GLib cannot be found, this should resolve it).

==Step 3: .Mozconfig file==
Once you have extracted all the contents of the tar file (from Step 1), you should have a mozilla directory.

<code>
//Assuming you placed it within your home directory<br>
$cd ~/mozilla<br>
$vi .mozconfig
</code>

Inside the .mozconfig editor, add at least following:
<code>
<b>ac_add_options --enable-dtrace</b><br>
ac_add_options --disable-tests<br>
ac_add_options --disable-debug <br>
ac_add_options --enable-optimize<br>
ac_add_options --enable-application=browser
</code>

The bolded option is the one we need. This tells the build to check for D-Trace dependancies and build the necessary probes on runtime. The rest are to ensure your build goes as fast as possible, and the application in the end will consume less memory. :wq out of the file and compile Mozilla using:<br>
<code>make -f client.mk build</code> or <code>gmake -f client.mk build</code> if you are using GNU.

Some people often omit the dtrace line from .mozconfig and run this command instead:
<code>
$ configure --enable-dtrace<br>
$ make or gmake
</code>

This works the same way. But I have seen most OpenSolaris people do this when it comes to installing patches to improve the D-Trace functionality.


==Step 3: Check for current probes==
In order to pick up any current probes, you must run the firefox-bin while you do these commands. Re-direct yourself to the Mozilla application you will use.

OpenSolaris<br>
<code>$cd dist/bin</code>

Mac<br>
<code>$cd dist/Minefield.app/Contents/MacOS</code><br>
You are not to use dist/bin! If you do, it will run - but it will not retrieve keyboard input.

Run the executable specified with:
<code>./firefox-bin -profilemanager [$]

Upon running, it is wise to create yourself a seperate profile than the one you are using for Firefox. This helps if you have 2 different versions of it running at once.
1
edit

Navigation menu