dt_dbg_dof(" Creating provider %s for PID %d\n",
strtab + prov->dofpv_name, pid);
- if ((parg = mops->dtms_provide_pid(meta->dtm_arg, &dhpv, pid)) == NULL)
+ /*
+ * This used to just 'return;' when parg is NULL, but that causes the
+ * cleanup code (dtrace_helper_provider_remove[_one]) to make a call
+ * to dtms_remove_pid() for a provider that never got created.
+ *
+ * If we fail to provide this provider, mark it as something to ignore,
+ * so we don't try to process it during cleanup.
+ */
+ parg = mops->dtms_provide_pid(meta->dtm_arg, &dhpv, pid);
+ if (parg == NULL) {
+ sec->dofs_type = DOF_SECT_NONE;
return;
+ }
meta->dtm_count++;
#include "dtrace_dev.h"
#include "fasttrap_impl.h"
+#define FIX_FORCE_UNIQUE_PROVNAME_PER_PID
+
#define FASTTRAP_MAX_DEFAULT 250000
static uint32_t fasttrap_max;
static uint64_t fasttrap_pid_count;
for (fp = bucket->ftb_data; fp != NULL; fp = fp->ftp_next) {
if (fp->ftp_pid == pid && strcmp(fp->ftp_name, name) == 0 &&
!fp->ftp_retired) {
+#ifdef FIX_FORCE_UNIQUE_PROVNAME_PER_PID
+ /*
+ * We disallow multiple providers with the same name
+ * for a given PID.
+ */
+ mutex_unlock(&bucket->ftb_mtx);
+ return NULL;
+#else
mutex_lock(&fp->ftp_mtx);
mutex_unlock(&bucket->ftb_mtx);
return fp;
+#endif
}
}