From owner-svn-src-all@FreeBSD.ORG Sat Jul 6 03:40:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8995D887; Sat, 6 Jul 2013 03:40:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7735D133F; Sat, 6 Jul 2013 03:40:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r663e0LU098445; Sat, 6 Jul 2013 03:40:00 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r663e0Jh098444; Sat, 6 Jul 2013 03:40:00 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307060340.r663e0Jh098444@svn.freebsd.org> From: Mark Johnston Date: Sat, 6 Jul 2013 03:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252861 - stable/8/sys/cddl/dev/dtmalloc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 03:40:00 -0000 Author: markj Date: Sat Jul 6 03:40:00 2013 New Revision: 252861 URL: http://svnweb.freebsd.org/changeset/base/252861 Log: MFC r252325: The dtmalloc provider uses the short description of a malloc type as the function name of its corresponding DTrace probes. These descriptions may contain whitespace, but probe names cannot, so just replace any whitespace with underscores when creating probes. Modified: stable/8/sys/cddl/dev/dtmalloc/dtmalloc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/dev/dtmalloc/dtmalloc.c ============================================================================== --- stable/8/sys/cddl/dev/dtmalloc/dtmalloc.c Sat Jul 6 03:39:40 2013 (r252860) +++ stable/8/sys/cddl/dev/dtmalloc/dtmalloc.c Sat Jul 6 03:40:00 2013 (r252861) @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -111,8 +112,17 @@ dtmalloc_type_cb(struct malloc_type *mtp { 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;