This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: systemtap multiple objs linking question
Hello:
> Yeah, I misremembered ... the /usr/bin/dtrace wrapper script
> that processes .d files hard-codes this in its header output:
> #define _SDT_HAS_SEMAPHORES 1
> #include <sys/sdt.h>
>
> So the way around this could be to
>
> #include <sys/sdt.h>
> #include "dtrace-generated-trace-header.h"
>
Awesome!
Yes. This was it. Building now on my ubuntu machine, going to test
on some more tomorrow. Notes section with probes all linked and
running. Sweet!
> in that order in the instrumented C code. That way, the initial
> (#undef) value of that macro will be used to define <sys/sdt.h>
> contents, and by the time the dtrace-generated-trace-header.h
> re-#includes <sys/sdt.h>, it will be too late: FOO_ENABLED() will be
> hard-coded at 1, and no semaphores will be compiled in.
>
> ... but we really ought to have a better method for this.
>
Great to have that explanation.
Something to ponder for sure.
>
>> attached is the latest build.log, showing the _sema.o being listed in
>> the call to the linker...
>
> Try to arrange it to show up before the -Wl,--end-group, perhaps.
>
Ended up not needing to do this now, but will keep in mind testing and
running this through the paces.
Want to get this in a clean pull request, mit licensed. Feel free to
clone github.com/jcwynholds/node (node-sdt branch) if you want to see
some untested partially done stuff that might compile.
Thanks again for the help!
--cheers
jan
--
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Sent from my brain.
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=