Re: svn commit: r364438 - in head/cddl: contrib/opensolaris/lib/libdtrace/common usr.sbin/dtrace/tests/tools
On 22 Aug 2020, at 16:27, Mark Johnston wrote: > > On Sat, Aug 22, 2020 at 12:40:49PM +0200, Antoine Brodin wrote: >> On Thu, Aug 20, 2020 at 9:28 PM Mark Johnston wrote: >>> >>> Author: markj >>> Date: Thu Aug 20 19:28:19 2020 >>> New Revision: 364438 >>> URL: https://svnweb.freebsd.org/changeset/base/364438 >>> >>> Log: >>> Enable creation of static userspace probes in incremental builds. >>> >>> To define USDT probes, dtrace -G makes use of relocations for undefined >>> symbols: the target address is overwritten with NOPs and the location is >>> recorded in the DOF section of the output object file. To avoid link >>> errors, the original relocation is destroyed. However, this means that >>> the same input object file cannot be processed multiple times, as >>> happens during incremental rebuilds. Instead, only set the relocation >>> type to NONE, so that all information required to reconstruct USDT >>> probes is preserved. >>> >>> Reported by: bdrewery >>> MFC after:3 weeks >>> Sponsored by: The FreeBSD Foundation >>> >>> Modified: >>> head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c >>> head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c >>> head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h >>> head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh >> >> Hi, >> >> This change seems broken on i386: >> >> http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5-devel-5.33.0.262.log >> http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5.28-5.28.3.log >> http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5.30-5.30.3.log >> http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5-5.32.0.log > > The links are dead, but I think the problem should be fixed by r364483. They work, but only over IPv6, unfortunately. :-) -Dimitry signature.asc Description: Message signed with OpenPGP
Re: svn commit: r364438 - in head/cddl: contrib/opensolaris/lib/libdtrace/common usr.sbin/dtrace/tests/tools
On Sat, Aug 22, 2020 at 12:40:49PM +0200, Antoine Brodin wrote: > On Thu, Aug 20, 2020 at 9:28 PM Mark Johnston wrote: > > > > Author: markj > > Date: Thu Aug 20 19:28:19 2020 > > New Revision: 364438 > > URL: https://svnweb.freebsd.org/changeset/base/364438 > > > > Log: > > Enable creation of static userspace probes in incremental builds. > > > > To define USDT probes, dtrace -G makes use of relocations for undefined > > symbols: the target address is overwritten with NOPs and the location is > > recorded in the DOF section of the output object file. To avoid link > > errors, the original relocation is destroyed. However, this means that > > the same input object file cannot be processed multiple times, as > > happens during incremental rebuilds. Instead, only set the relocation > > type to NONE, so that all information required to reconstruct USDT > > probes is preserved. > > > > Reported by: bdrewery > > MFC after:3 weeks > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c > > head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c > > head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h > > head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh > > Hi, > > This change seems broken on i386: > > http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5-devel-5.33.0.262.log > http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5.28-5.28.3.log > http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5.30-5.30.3.log > http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5-5.32.0.log The links are dead, but I think the problem should be fixed by r364483. > > Cheers, > > Antoine ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r364438 - in head/cddl: contrib/opensolaris/lib/libdtrace/common usr.sbin/dtrace/tests/tools
On Thu, Aug 20, 2020 at 9:28 PM Mark Johnston wrote: > > Author: markj > Date: Thu Aug 20 19:28:19 2020 > New Revision: 364438 > URL: https://svnweb.freebsd.org/changeset/base/364438 > > Log: > Enable creation of static userspace probes in incremental builds. > > To define USDT probes, dtrace -G makes use of relocations for undefined > symbols: the target address is overwritten with NOPs and the location is > recorded in the DOF section of the output object file. To avoid link > errors, the original relocation is destroyed. However, this means that > the same input object file cannot be processed multiple times, as > happens during incremental rebuilds. Instead, only set the relocation > type to NONE, so that all information required to reconstruct USDT > probes is preserved. > > Reported by: bdrewery > MFC after:3 weeks > Sponsored by: The FreeBSD Foundation > > Modified: > head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c > head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c > head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h > head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Hi, This change seems broken on i386: http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5-devel-5.33.0.262.log http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5.28-5.28.3.log http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5.30-5.30.3.log http://beefy17.nyi.freebsd.org/data/head-i386-default/p545731_s364466/logs/perl5-5.32.0.log Cheers, Antoine ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r364438 - in head/cddl: contrib/opensolaris/lib/libdtrace/common usr.sbin/dtrace/tests/tools
Author: markj Date: Thu Aug 20 19:28:19 2020 New Revision: 364438 URL: https://svnweb.freebsd.org/changeset/base/364438 Log: Enable creation of static userspace probes in incremental builds. To define USDT probes, dtrace -G makes use of relocations for undefined symbols: the target address is overwritten with NOPs and the location is recorded in the DOF section of the output object file. To avoid link errors, the original relocation is destroyed. However, this means that the same input object file cannot be processed multiple times, as happens during incremental rebuilds. Instead, only set the relocation type to NONE, so that all information required to reconstruct USDT probes is preserved. Reported by: bdrewery MFC after:3 weeks Sponsored by: The FreeBSD Foundation Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c == --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cThu Aug 20 19:27:49 2020(r364437) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cThu Aug 20 19:28:19 2020(r364438) @@ -773,6 +773,7 @@ dt_symtab_lookup(Elf_Data *data_sym, int start, int en #defineDT_OP_RET 0xd65f03c0 #defineDT_OP_CALL260x9400 #defineDT_OP_JUMP260x1400 +#defineDT_REL_NONE R_AACH64_NONE static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, @@ -831,7 +832,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, return (0); } #elif defined(__arm__) -/* XXX */ +#defineDT_REL_NONE R_ARM_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -841,7 +843,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, return (-1); } #elif defined(__mips__) -/* XXX */ +#defineDT_REL_NONE R_MIPS_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -861,7 +864,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, #define DT_IS_BRANCH(inst) ((inst & 0xfc00) == 0x4800) #define DT_IS_BL(inst) (DT_IS_BRANCH(inst) && (inst & 0x01)) -/* XXX */ +#defineDT_REL_NONE R_PPC_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -878,7 +882,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, * We only know about some specific relocation types. */ if (GELF_R_TYPE(rela->r_info) != R_PPC_REL24 && - GELF_R_TYPE(rela->r_info) != R_PPC_PLTREL24) + GELF_R_TYPE(rela->r_info) != R_PPC_PLTREL24 && + GELF_R_TYPE(rela->r_info) != R_PPC_NONE) return (-1); /* @@ -932,7 +937,7 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, return (0); } #elif defined(__riscv) -/* XXX */ +#defineDT_REL_NONE R_RISCV_NONE static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -952,6 +957,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, #defineDT_OP_XOR_EAX_0 0x33 #defineDT_OP_XOR_EAX_1 0xc0 +#defineDT_REL_NONE R_386_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -974,7 +981,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, * x86 architectures. */ if (GELF_R_TYPE(rela->r_info) != R_386_PC32 && - GELF_R_TYPE(rela->r_info) != R_386_PLT32) + GELF_R_TYPE(rela->r_info) != R_386_PLT32 && + GELF_R_TYPE(rela->r_info) != R_386_NONE) return (-1); /* @@ -1273,6 +1281,11 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e * We take a first pass through all the relocations to * populate our string table and count the number of extra * symbols we'll require. +* +* We also handle the case where the object has already been +* processed, to support incremental rebuilds. Relocations +* of interest are converted to type NONE, but all information +* needed to reconstruct the output DOF is retained. */ strtab = dt_strtab_create(1); nsym = 0; @@ -1280,7 +1293,6 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e istr = data_str->d_size;