On Oct 29, 2007, at 4:48 PM, Adam Leventhal wrote:
On Mon, Oct 29, 2007 at 01:43:19PM -0700, James McIlree wrote:
OS X doesn't support the older DTRACE_PROBE style macros, only
the newer (and much safer!) typechecked generated header files.
That makes sense to me, but some folks -- such as the Postgres folks
--
were fond of the DTRACE_PROBE syntax. It might be worth figuring out
why...
We did actually look at trying to support a compatibility mode with
-G
being a no-op, but that turned out to be something of a slippery
slope.
The harder I pulled on that thread, the more corner cases I found
where
it fell over. As Steve mentioned, we know its an issue, and I filed:
<rdar://problem/5566030> Emulate dtrace -G for compatibility
Excellent. I wrote a wrapper script that emulates -G by just
emitting an
effectively empty object file. Is there some edge case in which that
technique would be insufficient?
The OS X linker will helpfully report an error if you pass it an empty
object file. There are various things you can add to the object file
to suppress
the "nothing's here" warning. Depending on what flags you pass, you
should get away with "mostly empty" most of the time.
Your insight about the is-enabled probes is on target, if you
attempt
to only use is-enabled probes, and never reference the actual dtrace
probe, you'll get link time errors.
I'm surprised the DTrace test suite didn't pick that up.
Specifically, this
guy should have failed:
usr/src/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh
Do you have a bug filed on this or should I file one?
No radar on this yet. Do you know of any use cases for this kind of
construct?
James M