Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Aug 2010 11:09:54 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r211614 - head/sys/kern
Message-ID:  <201008221109.o7MB9sD6001840@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Sun Aug 22 11:09:53 2010
New Revision: 211614
URL: http://svn.freebsd.org/changeset/base/211614

Log:
  Bump KDTRACE_THREAD_ZERO and use M_ZERO as a malloc flag instead of
  calling bzero.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/kern_dtrace.c

Modified: head/sys/kern/kern_dtrace.c
==============================================================================
--- head/sys/kern/kern_dtrace.c	Sun Aug 22 11:08:18 2010	(r211613)
+++ head/sys/kern/kern_dtrace.c	Sun Aug 22 11:09:53 2010	(r211614)
@@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/dtrace_bsd.h>
 
 #define KDTRACE_PROC_SIZE	64
-#define KDTRACE_PROC_ZERO	8
 #define	KDTRACE_THREAD_SIZE	256
-#define	KDTRACE_THREAD_ZERO	64
 
 MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTrace hooks");
 
@@ -56,9 +54,8 @@ kdtrace_proc_size()
 static void
 kdtrace_proc_ctor(void *arg __unused, struct proc *p)
 {
-	p->p_dtrace = malloc(KDTRACE_PROC_SIZE, M_KDTRACE, M_WAITOK);
 
-	bzero(p->p_dtrace, KDTRACE_PROC_ZERO);
+	p->p_dtrace = malloc(KDTRACE_PROC_SIZE, M_KDTRACE, M_WAITOK|M_ZERO);
 }
 
 static void
@@ -75,15 +72,15 @@ kdtrace_proc_dtor(void *arg __unused, st
 size_t
 kdtrace_thread_size()
 {
+
 	return (KDTRACE_THREAD_SIZE);
 }
 
 static void
 kdtrace_thread_ctor(void *arg __unused, struct thread *td)
 {
-	td->td_dtrace = malloc(KDTRACE_THREAD_SIZE, M_KDTRACE, M_WAITOK);
 
-	bzero(td->td_dtrace, KDTRACE_THREAD_ZERO);
+	td->td_dtrace = malloc(KDTRACE_THREAD_SIZE, M_KDTRACE, M_WAITOK|M_ZERO);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008221109.o7MB9sD6001840>