[Mono-dev] Mono dtrace provider?
Andreas Färber
andreas.faerber at web.de
Sat Jan 12 19:54:49 EST 2008
Hello,
Am 27.09.2007 um 15:59 schrieb Paolo Molaro:
> On 09/26/07 Jason Brazile wrote:
>> I know this would only be applicable to Solaris, FreeBSD
>> (http://marc.info/?l=freebsd-current&m=114982741014845&w=2) or MacOSX
>> (http://blogs.sun.com/mws/#dtrace_on_macos_x_at) but is there a
>> C#/Mono dtrace provider available e.g.
>
> We don't, though feel free to contribute one.
I've looked into adding USDT probes to Mono; in theory this is very
easy:
- write a .d provider file with definitions of the probes,
- generate a C header file from the .d file (dtrace -h),
- use macros from the .h file in source file,
- compile sources to .o,
- provide .d file and .o files to dtrace -G and get an additional .o
file, and
- compile all .o files to executable.
This works fine for a test app.
Mono however uses libtool+automake for building: First, there seem to
be PIC and non-PIC .o files generated; then most .o files are compiled
into .a archives; and finally, all these .o files are handled
automagically by libtool/automake/whatever so it's difficult to add
such manual build steps.
I tried on Solaris Express 9/07 and finally got Mono building with a
probe in mini.c enabled, but at runtime it's not there, so something
goes wrong with my attached build process hack but I don't know
where. ;)
I thought data/ would be an obvious choice for the .d file, and chose
mono/utils for the generated header and object file but the object
file seems to depend on all object files with the probes, here mini.o
(and seems to update those with nops), so this kind of breaks that idea.
Obviously DTrace support would need to be enabled by configure, and
the dtrace path shouldn't be hardcoded (dtrace on OSX) etc., but
anything working would be a start!
If someone has a suggestion...
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dtrace-hack.diff
Type: application/octet-stream
Size: 2834 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080113/323a2043/attachment.obj
-------------- next part --------------
More information about the Mono-devel-list
mailing list