From b280b57c851ef932d49b9fb1c4df2f235e80e219 Mon Sep 17 00:00:00 2001 From: emaste Date: Fri, 27 Oct 2017 16:23:45 +0000 Subject: [PATCH] libdtrace: replace "DOODAD" with more descriptive string Previously some unimplemented libdtrace routines printed the function, file and line number, followed by "DOODAD." That is not particularly informative, so replace it with a message reporting the actual issue. Sponsored by: The FreeBSD Foundation --- .../lib/libdtrace/common/dt_link.c | 24 ++++++++++++------- .../lib/libdtrace/common/dt_proc.c | 3 ++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c index bfd5ec15cc9e..e5d30f0e037d 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c @@ -229,10 +229,12 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf32_t *dep) for (j = 0; j < nrel; j++) { #if defined(__aarch64__) /* XXX */ -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); + printf("%s:%s(%d): aarch64 not implemented\n", + __FUNCTION__, __FILE__, __LINE__); #elif defined(__arm__) /* XXX */ -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); + printf("%s:%s(%d): arm not implemented\n", + __FUNCTION__, __FILE__, __LINE__); #elif defined(__i386) || defined(__amd64) rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; @@ -240,7 +242,8 @@ printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); R_386_PC32); #elif defined(__mips__) /* XXX */ -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); + printf("%s:%s(%d): MIPS not implemented\n", + __FUNCTION__, __FILE__, __LINE__); #elif defined(__powerpc__) /* * Add 4 bytes to hit the low half of this 64-bit @@ -252,7 +255,8 @@ printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); R_PPC_REL32); #elif defined(__riscv) /* XXX */ -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); + printf("%s:%s(%d): RISC-V not implemented\n", + __FUNCTION__, __FILE__, __LINE__); #else #error unknown ISA #endif @@ -802,7 +806,8 @@ static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) { -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); + printf("%s:%s(%d): aarch64 not implemented\n", __FUNCTION__, __FILE__, + __LINE__); return (0); } #elif defined(__arm__) @@ -811,7 +816,8 @@ static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) { -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); + printf("%s:%s(%d): arm not implemented\n", __FUNCTION__, __FILE__, + __LINE__); return (0); } #elif defined(__mips__) @@ -820,7 +826,8 @@ static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) { -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); + printf("%s:%s(%d): MIPS not implemented\n", __FUNCTION__, __FILE__, + __LINE__); return (0); } #elif defined(__powerpc__) @@ -910,7 +917,8 @@ static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) { -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); + printf("%s:%s(%d): RISC-V implementation required\n", __FUNCTION__, + __FILE__, __LINE__); return (0); } #elif defined(__sparc) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c index 79c187140de9..9215b438a40f 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c @@ -426,7 +426,8 @@ dt_proc_attach(dt_proc_t *dpr, int exec) static void dt_proc_waitrun(dt_proc_t *dpr) { -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); + printf("%s:%s(%d): not implemented\n", __FUNCTION__, __FILE__, + __LINE__); #ifdef DOODAD struct ps_prochandle *P = dpr->dpr_proc; const lwpstatus_t *psp = &Pstatus(P)->pr_lwp;