Sun's Dynamic Tracing (DTrace) tool is one of the most-touted features of the company's Solaris 10 operating system, released in January, and provides advanced performance analysis and debugging features for server software. "DTrace is like being in a nudist colony," Sun developer Alan DuBoff said at the time. "There are no secrets--not even for Solaris."
The tool is currently being ported to FreeBSD by Devon O'Dell, a FreeBSD developer working for OffMyServer, a US-based vendor which sells servers running BSD and Linux variants.
DTrace was released by Sun under the Community Development and Distribution License (CDDL). The terms of the licence generally prohibit the software from intermingling with the popular GNU Public Licence, but are broadly compatible with others such as the licence used by FreeBSD and its sister BSD projects.
O'Dell told ZDNet Australia  the aim of the project -- which commenced a month ago -- was that all scripts and applications that utilised DTrace under its native Solaris environment should be able to run in FreeBSD with no changes.
While FreeBSD's existing ktrace function was similar to DTrace, it was limited in scope, according to O'Dell. "FreeBSD implements a somewhat similar facility for dynamically instrumenting syscalls for any given application," he said.
"I've used it quite often for debugging applications (most notably mail servers when I can't figure out why their configuration files aren't working). It has a good few shortcomings and doesn't give you nearly the granular scope opf instrumentation that DTrace does."
"Other various applications exist or have been ported that do implement other features accomplished by DTrace, but none provide all of the information one can obtain from DTrace."
O'Dell said he had spoken with various Sun engineers about the project, including Bryan Cantrill, one of three engineers Sun has working internally on DTrace development.
According to O'Dell, both Cantrill and another Sun engineer, Keith Wesolowski, had urged him to start work on the project.
Despite initial misgivings, the developer was convinced to undertake the work after watching a presentation Cantrill and PHP developer Wez Furlong gave at publisher O'Reilly's open source convention in the United States in early August.
That session demonstrated the potential for DTrace to improve performance in the PHP Web scripting language. A similar integration has since been built for the Ruby programming language.
"Over lunch, we discussed what it would take to get it running in FreeBSD," said O'Dell of one conversation with Cantrill and Wesolowski.
Work in progress
The developer said progress on the project was slow, but going ahead. His first task is to get the core DTrace software libraries working on FreeBSD, after which he'll work on more detail.
A stumbling block has been differences between the executable file format used in Solaris and that used in FreeBSD. While both - and indeed most Unix-based operating systems -- use a format named ELF, some internals of the format differ between the two.
O'Dell is currently working solo on the project, but is being supported by his employer with some unused hardware.
"It's a lot of work, but it's certainly doable," he wrote on his blog mid-way through last month. "I'm certainly hoping to have at least some functionality by the end of this year."
On his own blog, Cantrill pledged his support to the project. "We on Team DTrace are available to help out in any way we can," he wrote around the same time.