Archive for August, 2012

Enabling dtrace on Freebsd

My freshly installed FreeBSD9 does not have dtrace? While using it I got this error:

dtrace: failed to initialize dtrace: DTrace device not available on system 

Doing a “kldstat” command query, dtrace kernel module was not listed.

And reading further:

http://forums.freebsd.org/showthread.php?t=19385

The answer given was to read:

http://wiki.freebsd.org/DTrace

But that seemed to take too much time, so I start investigating the kernel module – first “cd /boot/kernel” to go to the kernel modules directory:

kldload if_ath

kldload: can't load if_ath: File exists

Oops, this kernel modules is already loaded – as verified via “kldstat”. And just trying another file:

kldload dtrace
kldload dtraceall

No error message, so it seemed by default dtrace-related kernel module are not loaded? Not always, sometimes mismatched errors occurred (eg, after another FreeBSD 8.1 installation), and so rebulding the kernel modules are needed.

Steps are as followed:

cd /usr/src/sys/amd64/conf
cp GENERIC MYDTKERNEL

And inside MYDTKERNEL file:

options KDTRACE_FRAME # Ensure frames are compiled in
options KDTRACE_HOOKS # Kernel DTrace hooks

Other options are instruction to backup the current kernel to /boot/kernel.old and this is not enabled by default – my advice is to enable it.

config MYDTKERNEL

And you will see that ../compile/MYDTKERNEL returned, now cd to this directory and continue the compilation:

make depend
make
make install

Hopefully the above will all work without producing an error. If you get an error, like me, getting and “No space left on device” error, what I do is to move the /boot/kernel.old directory to the /usr directory which still have lots of space left. Next reboot the machine, and do a “kldstat” to check that dtrace is loaded or not, which is not.


cd /boot/kernel
kldload dtrace
kldload dtraceall

References:

http://www.freebsd.org/doc/handbook/kernelconfig-building.html

http://silverwraith.com/papers/freebsd-kernel.php

Vickblöm

Research scattered with thoughts, ideas, and dreams

Penetration Testing Lab

Offensive Techniques & Methodologies

Astr0baby's not so random thoughts _____ rand() % 100;

@astr0baby on Twitter for fresh randomness

The Data Explorer

playing around with open data to learn some cool stuff about data analysis and the world

Conorsblog

Data | ML | NLP | Python | R

quyv

Just a thought

IFT6266 - H2017 Deep Learning

A Graduate Course Offered at Université de Montréal

Deep Learning IFT6266-H2017 UdeM

Philippe Paradis - My solutions to the image inpainting problem

IFT6266 – H2017 DEEP LEARNING

Pulkit's thoughts on the course project

Thomas Dinsmore's Blog

No man but a blockhead ever wrote except for money -- Samuel Johnson

the morning paper

a random walk through Computer Science research, by Adrian Colyer

The Spectator

Shakir's Machine Learning Blog