Meet Mr. DTrace - Part 3

Thanks to Ben Klang’s comments, I eventually make the SunStudio 11 works on NexentaOS!

Stick to the bleeding-edge

I migrated to NexentaOS Alpha-7 test2, since the SUNWhea is maintained in the unstable brach. Edited the /etc/apt/source.listto use unstable instead of testing, then upgraded the SUNWhea package, at the end “emerge” the SPROcc from the OpenSolaris DVD.

Test drive of DTrace probes provider

Copy the simple.c, myserv.d from Ticket #405, build it using SunStudio C Compiler:

cc -c simple.c
dtrace -G -32 -s myserv.d simple.o
cc -o simple myserv.o simple.o

Prepare the test.d like this:

```/usr/sbin/dtrace -Zs

pragma D option quiet

dtrace:::BEGIN { printf(“Tracing… Hit Ctrl-C to end.”); }

myserv*:::loopstart-receive { printf(“%d hit.”, arg0); }

dtrace:::END { printf(" %-32s %-36s %8s“,”FILE“,”FUNC“,”CALLS“); }


Launch the _simple_ with root privilege, execute the _test.d_ with root privilege as well. The terminal would print out the value of counter _i_, bravo!

## Building the Mozilla Firefox

To build Mozilla Firefox, we need install the C++ compiler environment:

SPROcpl Sun Studio 11 C++ Compiler
SPROscl Sun Studio 11 Standard Class Library for C++
SPROsbld Sun Studio 11 Linker Stab Library

To simplify the installation, _--force_option is added to [emerge.py](/files/2007/04/emerge.py) to install packages regardless the dependencies.

We also need to install _libgtk2.0-dev_ and _libidl-dev_ to meet the dependencies required by Firefox.
Fetch the source code using `apt-get source firefox`, edit the `$HOME/.mozconfig`,

. $topsrcdir/browser/config/mozconfig ac_add_options –prefix=/opt/firefox ac_add_options –enable-application=browser ac_add_options –enable-optimize=“-xO2” ```

then invoke:

./configure
cd config ; make
cd ../js; make

CC reported an error at the linking time: /usr/ccs/bin/ar is not found. It seems that there is still some package missing, not quite sure it is binutils, I would ask for help from #gnusol tomorrow.