[PATCH 0 of 4] Add support for dtrace compatible sdt probes on GNU/Linux

Mark Wielaard mjw at redhat.com
Sun Jul 22 02:47:17 PDT 2012

On Sun, Jul 22, 2012 at 06:09:31PM +1000, David Holmes wrote:
> On 22/07/2012 5:51 PM, Mark Wielaard wrote:
> >On Sun, 2012-07-22 at 08:10 +1000, David Holmes wrote:
> >>On 21/07/2012 7:08 PM, Mark Wielaard wrote:
> >>>On Sat, Jul 21, 2012 at 05:48:21PM +1000, David Holmes wrote:
> >>>>I'd love to see webrevs for these patches.
> >>>
> >>>Patches as webrevs here: http://icedtea.classpath.org/~mjw/webrev/7170638/
> >>
> >>Thanks. Unfortunately it didn't help with patch 1 as I can't mentally
> >>expand all those nested macros (in original or new). :(
> >
> >It just follows the pattern from the rest of jni.h. That patch is really
> >just a cleanup to make things more consistent. From my explanation:
> I'm having trouble understanding the orignal FP_SELECT_##Result
> macro and the inversion between its use with respect to the probe in
> the old and new code. I need to spend some time seeing what it does.

Yeah, that macro is somewhat hairy. But it is used likewise in the rest
of jni.cpp. It is easiest to understand if you know that the SDT probes
don't handle floating point arguments (this is a limitation shared by
all implementations, GNU/Linux, Solaris, MacOS). The macro is generically
expressed as selecting either an integer code path or a float code path.
But in practice it is just used to suppress the float arguments.

In the original variant the macro adds the value set as argument
(plus a comma) if the Set[Static]#Result#Field was an integer argument,
or adds the comment /* empty */ instead of the argument if the Result
was of floating point type. In the new variant the macro just selects
a DTRACE_PROBE4 variant (with value argument) for the integer case,
or a DTRACE_PROBE3 variant (without the value argument) for the
floating point case.

Hope that helps,


More information about the hotspot-dev mailing list