From owner-svn-src-head@FreeBSD.ORG Sun Aug 22 11:08:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B0DF1065694; Sun, 22 Aug 2010 11:08:19 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 005C48FC08; Sun, 22 Aug 2010 11:08:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MB8IFQ001773; Sun, 22 Aug 2010 11:08:18 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MB8I8w001771; Sun, 22 Aug 2010 11:08:18 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008221108.o7MB8I8w001771@svn.freebsd.org> From: Rui Paulo Date: Sun, 22 Aug 2010 11:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211613 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 11:08:19 -0000 Author: rpaulo Date: Sun Aug 22 11:08:18 2010 New Revision: 211613 URL: http://svn.freebsd.org/changeset/base/211613 Log: Fix style issues. 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:07:46 2010 (r211612) +++ head/sys/kern/kern_dtrace.c Sun Aug 22 11:08:18 2010 (r211613) @@ -49,7 +49,8 @@ MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTr size_t kdtrace_proc_size() { - return(KDTRACE_PROC_SIZE); + + return (KDTRACE_PROC_SIZE); } static void @@ -63,6 +64,7 @@ kdtrace_proc_ctor(void *arg __unused, st static void kdtrace_proc_dtor(void *arg __unused, struct proc *p) { + if (p->p_dtrace != NULL) { free(p->p_dtrace, M_KDTRACE); p->p_dtrace = NULL; @@ -73,7 +75,7 @@ kdtrace_proc_dtor(void *arg __unused, st size_t kdtrace_thread_size() { - return(KDTRACE_THREAD_SIZE); + return (KDTRACE_THREAD_SIZE); } static void @@ -87,6 +89,7 @@ kdtrace_thread_ctor(void *arg __unused, static void kdtrace_thread_dtor(void *arg __unused, struct thread *td) { + if (td->td_dtrace != NULL) { free(td->td_dtrace, M_KDTRACE); td->td_dtrace = NULL; @@ -99,10 +102,15 @@ kdtrace_thread_dtor(void *arg __unused, static void init_dtrace(void *dummy __unused) { - EVENTHANDLER_REGISTER(process_ctor, kdtrace_proc_ctor, NULL, EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(process_dtor, kdtrace_proc_dtor, NULL, EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(thread_ctor, kdtrace_thread_ctor, NULL, EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(thread_dtor, kdtrace_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); + + EVENTHANDLER_REGISTER(process_ctor, kdtrace_proc_ctor, NULL, + EVENTHANDLER_PRI_ANY); + EVENTHANDLER_REGISTER(process_dtor, kdtrace_proc_dtor, NULL, + EVENTHANDLER_PRI_ANY); + EVENTHANDLER_REGISTER(thread_ctor, kdtrace_thread_ctor, NULL, + EVENTHANDLER_PRI_ANY); + EVENTHANDLER_REGISTER(thread_dtor, kdtrace_thread_dtor, NULL, + EVENTHANDLER_PRI_ANY); } SYSINIT(kdtrace, SI_SUB_KDTRACE, SI_ORDER_FIRST, init_dtrace, NULL);