Date: Tue, 22 Oct 2013 23:13:44 -0400 From: Mark Johnston <markj@freebsd.org> To: freebsd-dtrace@freebsd.org Cc: Veniamin Gvozdikov <vg@freebsd.org> Subject: Re: Integration DTrace problems Message-ID: <20131023031344.GA8033@raichu> In-Reply-To: <20131020235216.GA13816@charmander> References: <6A174747-D855-481D-A191-67A2805BC9AE@freebsd.org> <20131020235216.GA13816@charmander>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Oct 20, 2013 at 07:52:16PM -0400, Mark Johnston wrote: > On Wed, Oct 09, 2013 at 01:54:14AM +0400, Veniamin Gvozdikov wrote: > > Hello, > > > > I have problems with integration DTrace: > > > > * Wildcard bug > > * USDT at runtime works only with probes with arguments less than 5 > > ... > > Arguments of index > 5 come from the stack and may still be incorrect > with this patch. I'm not yet sure what the problem is - if the arguments > are (4-byte) ints, some of the values are wrong, but when I change the > types to long, the values are correct (up to arg9 at least). This comment can be ignored - I had forgotten that the argN variables are always 64 bits wide and so may give incorrect results when trying to print a 32-bit function argument. Switching to args[N] gives me correct results. So with r256822, argument fetching seems to be working properly with USDT and PID probes. :) -Mark > > > * USDT depended by base src because need dtrace.h although It exists on OSX and Oracle Linux > > * Bug with providers position in D file with multi link dtrace objects > > * Bug with not used probes when all providers unavailable if doesn't use in code > > * Inconvenient toolchains (need to see DTrace on OSX) > > > > For more details go to link http://zlonet.ru/page/dtrace-integration-features/ . > > > > > > Any idea? > > diff --git a/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c b/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c > index 65991af..8afc45a 100644 > --- a/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c > +++ b/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c > @@ -271,8 +271,26 @@ fasttrap_anarg(struct reg *rp, int function_entry, int argno) > * In 64-bit mode, the first six arguments are stored in > * registers. > */ > - if (argno < 6) > + if (argno < 6) { > +#if !defined(sun) > + switch (argno) { > + case 0: > + return (rp->r_rdi); > + case 1: > + return (rp->r_rsi); > + case 2: > + return (rp->r_rdx); > + case 3: > + return (rp->r_rcx); > + case 4: > + return (rp->r_r8); > + case 5: > + return (rp->r_r9); > + } > +#else > return ((&rp->r_rdi)[argno]); > +#endif > + } > > stack = (uintptr_t *)rp->r_rsp; > DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); > diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c > index 34d6f33..b82b77f 100644 > --- a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c > +++ b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c > @@ -367,7 +367,31 @@ dtrace_getarg(int arg, int aframes) > sizeof (uintptr_t)); > > if (arg <= inreg) { > +#if !defined(sun) > + switch (arg) { > + case 0: > + stack = (uintptr_t *)&rp->r_rdi; > + break; > + case 1: > + stack = (uintptr_t *)&rp->r_rsi; > + break; > + case 2: > + stack = (uintptr_t *)&rp->r_rdx; > + break; > + case 3: > + stack = (uintptr_t *)&rp->r_rcx; > + break; > + case 4: > + stack = (uintptr_t *)&rp->r_r8; > + break; > + case 5: > + stack = (uintptr_t *)&rp->r_r9; > + break; > + } > + arg = 0; > +#else > stack = (uintptr_t *)&rp->r_rdi; > +#endif > } else { > stack = (uintptr_t *)(rp->r_rsp); > arg -= inreg;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131023031344.GA8033>