Date: Mon, 1 Dec 2014 16:59:02 +0400 From: Fedor Indutny <fedor@indutny.com> To: Mark Johnston <markj@freebsd.org> Cc: "freebsd-dtrace@freebsd.org" <freebsd-dtrace@freebsd.org> Subject: Re: DTrace fixes for node.js Message-ID: <CAEv2VfLXmnfAHdXDF9CExVPjX_BVRGQiYhQQ29nnDFnGNhaa-Q@mail.gmail.com> In-Reply-To: <CAEv2VfL9h4FUaFgDGCMDuQ_1d3tK3K_e19bBw3kvD0hun4P=Kg@mail.gmail.com> References: <CAEv2VfLJR7b9Gj7qN9VuuQKWphUUrdJYwQ4r5P%2BKWJYLuddCiA@mail.gmail.com> <20140227050136.GB28089@raichu> <CAEv2Vf%2BHh-K11ika7-awEwFE67OM=Du8Pn9sWvC1cwuVBmSjxw@mail.gmail.com> <CAMw1wOwwk8tZxFmxTpV04y04-Dqj9vdDwwprrv2BeQcCtV0z6g@mail.gmail.com> <CAEv2VfL9h4FUaFgDGCMDuQ_1d3tK3K_e19bBw3kvD0hun4P=Kg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello Mark, DTrace people! Hope you are doing well. Looks like FreeBSD 10.1 decided to play some not that funny games with drti.c again :) I have submitted a [patch][0] as a problem report. It fixes iteration over aligned DOFs, and accounts for a non-master-branch FreeBSD stuff in: cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Which is currently producing SHT_PROGBITS section instead of expected SHT_SUNW_dof, thus confusing the drti.c file. Thank you, Fedor. [0]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195555 On Thu, Feb 27, 2014 at 6:50 PM, Fedor Indutny <fedor@indutny.com> wrote: > Update sent, thank you! > > On Thu, Feb 27, 2014 at 6:39 PM, Mark Johnston <markj@freebsd.org> wrote: > > On Thu, Feb 27, 2014 at 3:30 AM, Fedor Indutny <fedor@indutny.com> > wrote: > >> Mark, > >> > >> Thanks for looking into this. I just tried your patch and it (no > >> surprise) builds fine. Node.js DOF symbols seems to be resolving > >> properly too! > >> > >> Do you want me to squash this changes into my patch, and post them on > >> that ticket? > >> > > > > That would be good, thanks. When I have some time I'll do more testing > > and commit the change. > > > > -Mark > > > >> On Thu, Feb 27, 2014 at 9:01 AM, Mark Johnston <markj@freebsd.org> > wrote: > >>> On Tue, Feb 25, 2014 at 06:16:15PM +0400, Fedor Indutny wrote: > >>>> Hello devs! > >>>> > >>>> I have made some fixes to fix DTrace support for node.js in FreeBSD: > >>>> > >>>> * http://www.freebsd.org/cgi/query-pr.cgi?pr=186821 > >>>> * http://www.freebsd.org/cgi/query-pr.cgi?pr=187027 > >>>> > >>>> Here is a blog post with a bit of explanation of why this is needed > >>>> and what is fixed: https://blog.indutny.com/7.freebsd-dtrace > >>>> > >>>> Please let me know if I could be any help in reviewing it. > >>> > >>> Hi Fedor, > >>> > >>> The DOF limit change looks fine to me. I note that the illumos guys > have > >>> just pushed a change to illumos-gate which bumps dtrace_dof_maxsize, > but > >>> it's good to have the sysctl as well. > >>> > >>> The drti change looks mostly good to me. The real problem there is that > >>> our linker doesn't know how to merge DOF, so it just concatenates the > >>> tables into one SUNW_dof section. So we should really fix our linker, > >>> but it doesn't hurt to also handle the problem in drti.o. > >>> > >>> There are a couple of bugs in the patch. First, the "break" added after > >>> finding the DOF section causes problems if we haven't yet seen the > >>> symbol table. Second, fixedprobes needs to be reset at the beginning of > >>> each iteration of the while loop that you added, else we may not try > >>> searching the dynamic symbol table when fixing the probe addresses. > I've > >>> pasted a patch below; could you test it and make sure things still work > >>> properly with node? > >>> > >>> Thanks for the detailed blog post and problem description, they were > >>> very helpful. :) > >>> > >>> -Mark > >>> > >>> diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c > b/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c > >>> index e47cfb4d..bb02d8c 100644 > >>> --- a/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c > >>> +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c > >>> @@ -162,7 +162,7 @@ dtrace_dof_init(void) > >>> char *dofstrtabraw; > >>> size_t shstridx, symtabidx = 0, dynsymidx = 0; > >>> unsigned char *buf; > >>> - int fixedprobes = 0; > >>> + int fixedprobes; > >>> #endif > >>> > >>> if (getenv("DTRACE_DOF_INIT_DISABLE") != NULL) > >>> @@ -214,7 +214,6 @@ dtrace_dof_init(void) > >>> if (s && strcmp(s, ".SUNW_dof") == 0) { > >>> dofdata = elf_getdata(scn, NULL); > >>> dof = dofdata->d_buf; > >>> - break; > >>> } > >>> } > >>> } > >>> @@ -226,6 +225,7 @@ dtrace_dof_init(void) > >>> } > >>> > >>> while ((char *) dof < (char *) dofdata->d_buf + > dofdata->d_size) { > >>> + fixedprobes = 0; > >>> dof_next = (void *) ((char *) dof + dof->dofh_filesz); > >>> #endif > >>> >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEv2VfLXmnfAHdXDF9CExVPjX_BVRGQiYhQQ29nnDFnGNhaa-Q>