diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2013-07-06 03:39:40 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2013-07-06 03:39:40 +0000 |
| commit | be4200eaa2af0909183f27c2ab8ae6092887a3e5 (patch) | |
| tree | 32d1187f6dbe4ac835bdbfddb3c96dff9d5c2bc4 /sys/cddl | |
| parent | 08474b2c69237028f892ddd7f1c0c14d0bbc3f9f (diff) | |
Notes
Diffstat (limited to 'sys/cddl')
| -rw-r--r-- | sys/cddl/dev/dtmalloc/dtmalloc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/cddl/dev/dtmalloc/dtmalloc.c b/sys/cddl/dev/dtmalloc/dtmalloc.c index ca822f988668..81ff43f92131 100644 --- a/sys/cddl/dev/dtmalloc/dtmalloc.c +++ b/sys/cddl/dev/dtmalloc/dtmalloc.c @@ -28,6 +28,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/conf.h> +#include <sys/ctype.h> #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/module.h> @@ -111,8 +112,17 @@ dtmalloc_type_cb(struct malloc_type *mtp, void *arg __unused) { char name[DTRACE_FUNCNAMELEN]; struct malloc_type_internal *mtip = mtp->ks_handle; + int i; + /* + * malloc_type descriptions are allowed to contain whitespace, but + * DTrace probe identifiers are not, so replace the whitespace with + * underscores. + */ strlcpy(name, mtp->ks_shortdesc, sizeof(name)); + for (i = 0; name[i] != 0; i++) + if (isspace(name[i])) + name[i] = '_'; if (dtrace_probe_lookup(dtmalloc_id, NULL, name, "malloc") != 0) return; |
