From: Khassapov, Alex (Alex.Khassapov_at_[hidden])
Date: 2008-03-26 19:10:19
DTrace is a dynamic tracing facility that is built into Solaris and can be used to examine the behavior of both user programs and of the operating system itself.
In the example below it modifies .o files according to myserv.d dtrace script (which tells dtrace which functions we are interested in), it inserts hooks into the function calls of interest, but the hooks are actually implemented in the generated myserv.o object file which is also linked into the resulting executable.
So just a generator won't be sufficient. dtrace call should be inserted in between compilation and linking steps and the output of dtrace (.o file) linked back into the calling project.
It's really easy to achive in Automake as I showed in my previous post (2008-03-25 02:55:11 GMT), but I've got no idea how to do it in bjam!
It really became a showstopper in my project of converting our build system to bjam (I spent already 3 month on it!), if I can't do it - all this time will be wasted!
So any help is appreciated!
From: boost-build-bounces_at_[hidden] [mailto:boost-build-bounces_at_[hidden]] On Behalf Of Jurko Gospodnetic
Sent: Wednesday, 26 March 2008 6:15 PM
Subject: Re: [Boost-build] Anybody implemented dtrace?
> Here's an example of dtrace usage, which makes me copletely confused as to how
> to implement this in bjam!!
> cc -c src1.c
> cc -c src2.c
> dtrace -G -32 -s myserv.d src1.o src2.o ...
> cc -o myserv myserv.o src1.o src2.o ...
Do not know what 'dtrace' is and do not have the time to play around
with this, but here's the first thing that pops to mind...
At first glace seems similar to how regular link generators
implemented. Why not implement a ( .d, .obj ) ==> ( whatever dtrace
produces ) generator similar to how link generators are implemented and
then simply build those targets that dtrace builds?
Would that work?
One possible problem with this is if 'dtrace' actually modifies .o
files in-place. In that case I guess one would need to define new target
type for 'dtrace modified obj files' and somehow tell Boost Build to use
those targets for linking instead of 'raw' ones. But if this is the case
then I'd really have to play around with this to get some more insight...
Hope this helps.
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk