Meet Mr. DTrace - Part 3
dtraceThanks 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.list
to 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:
#pragma D option quiet
dtrace:::BEGIN
{
printf("Tracing... Hit Ctrl-C to end.\n");
}
myserv*:::loopstart-receive
{
printf("%d hit.\n", arg0);
}
dtrace:::END
{
printf(" %-32s %-36s %8s\n", "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++ CompilerSPROscl
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 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.