Rename dprintf into dbg_printf to avoid collision with dprintf(3)

When dprintf(3) in 2009 was added a _WITH_DPRINTF guard has also been added.
This rename is made in preparation for the removal of this guard
This commit is contained in:
Baptiste Daroussin 2016-05-10 07:52:17 +00:00
parent a05f81bfa3
commit 25fac4a635
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299343

View File

@ -65,7 +65,7 @@ extern dof_hdr_t __SUNW_dof; /* DOF defined in the .SUNW_dof section */
static boolean_t dof_init_debug = B_FALSE; /* From DTRACE_DOF_INIT_DEBUG */ static boolean_t dof_init_debug = B_FALSE; /* From DTRACE_DOF_INIT_DEBUG */
static void static void
dprintf(int debug, const char *fmt, ...) dbg_printf(int debug, const char *fmt, ...)
{ {
va_list ap; va_list ap;
@ -119,13 +119,13 @@ dtrace_dof_init(void)
dof_init_debug = B_TRUE; dof_init_debug = B_TRUE;
if (dlinfo(RTLD_SELF, RTLD_DI_LINKMAP, &lmp) == -1 || lmp == NULL) { if (dlinfo(RTLD_SELF, RTLD_DI_LINKMAP, &lmp) == -1 || lmp == NULL) {
dprintf(1, "couldn't discover module name or address\n"); dbg_printf(1, "couldn't discover module name or address\n");
return; return;
} }
#ifdef illumos #ifdef illumos
if (dlinfo(RTLD_SELF, RTLD_DI_LMID, &lmid) == -1) { if (dlinfo(RTLD_SELF, RTLD_DI_LMID, &lmid) == -1) {
dprintf(1, "couldn't discover link map ID\n"); dbg_printf(1, "couldn't discover link map ID\n");
return; return;
} }
#endif #endif
@ -139,7 +139,7 @@ dtrace_dof_init(void)
dof->dofh_ident[DOF_ID_MAG1] != DOF_MAG_MAG1 || dof->dofh_ident[DOF_ID_MAG1] != DOF_MAG_MAG1 ||
dof->dofh_ident[DOF_ID_MAG2] != DOF_MAG_MAG2 || dof->dofh_ident[DOF_ID_MAG2] != DOF_MAG_MAG2 ||
dof->dofh_ident[DOF_ID_MAG3] != DOF_MAG_MAG3) { dof->dofh_ident[DOF_ID_MAG3] != DOF_MAG_MAG3) {
dprintf(0, ".SUNW_dof section corrupt\n"); dbg_printf(0, ".SUNW_dof section corrupt\n");
return; return;
} }
@ -163,7 +163,7 @@ dtrace_dof_init(void)
devnamep = p; devnamep = p;
if ((fd = open64(devnamep, O_RDWR)) < 0) { if ((fd = open64(devnamep, O_RDWR)) < 0) {
dprintf(1, "failed to open helper device %s", devnamep); dbg_printf(1, "failed to open helper device %s", devnamep);
#ifdef illumos #ifdef illumos
/* /*
* If the device path wasn't explicitly set, try again with * If the device path wasn't explicitly set, try again with
@ -175,7 +175,7 @@ dtrace_dof_init(void)
devnamep = olddevname; devnamep = olddevname;
if ((fd = open64(devnamep, O_RDWR)) < 0) { if ((fd = open64(devnamep, O_RDWR)) < 0) {
dprintf(1, "failed to open helper device %s", devnamep); dbg_printf(1, "failed to open helper device %s", devnamep);
return; return;
} }
#else #else
@ -183,9 +183,9 @@ dtrace_dof_init(void)
#endif #endif
} }
if ((gen = ioctl(fd, DTRACEHIOC_ADDDOF, &dh)) == -1) if ((gen = ioctl(fd, DTRACEHIOC_ADDDOF, &dh)) == -1)
dprintf(1, "DTrace ioctl failed for DOF at %p", dof); dbg_printf(1, "DTrace ioctl failed for DOF at %p", dof);
else { else {
dprintf(1, "DTrace ioctl succeeded for DOF at %p\n", dof); dbg_printf(1, "DTrace ioctl succeeded for DOF at %p\n", dof);
#ifdef __FreeBSD__ #ifdef __FreeBSD__
gen = dh.dofhp_gen; gen = dh.dofhp_gen;
#endif #endif
@ -206,14 +206,14 @@ dtrace_dof_fini(void)
int fd; int fd;
if ((fd = open64(devnamep, O_RDWR)) < 0) { if ((fd = open64(devnamep, O_RDWR)) < 0) {
dprintf(1, "failed to open helper device %s", devnamep); dbg_printf(1, "failed to open helper device %s", devnamep);
return; return;
} }
if ((gen = ioctl(fd, DTRACEHIOC_REMOVE, &gen)) == -1) if ((gen = ioctl(fd, DTRACEHIOC_REMOVE, &gen)) == -1)
dprintf(1, "DTrace ioctl failed to remove DOF (%d)\n", gen); dbg_printf(1, "DTrace ioctl failed to remove DOF (%d)\n", gen);
else else
dprintf(1, "DTrace ioctl removed DOF (%d)\n", gen); dbg_printf(1, "DTrace ioctl removed DOF (%d)\n", gen);
(void) close(fd); (void) close(fd);
} }