Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jan 2008 05:36:31 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 134442 for review
Message-ID:  <200801300536.m0U5aVu3086466@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=134442

Change 134442 by jb@jb_freebsd1 on 2008/01/30 05:36:18

	IFdtrace

Affected files ...

.. //depot/projects/dtrace7/src/sys/kern/kern_fork.c#3 edit

Differences ...

==== //depot/projects/dtrace7/src/sys/kern/kern_fork.c#3 (text+ko) ====

@@ -37,6 +37,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD: src/sys/kern/kern_fork.c,v 1.282.2.2 2008/01/18 10:02:51 kib Exp $");
 
+#include "opt_kdtrace.h"
 #include "opt_ktrace.h"
 #include "opt_mac.h"
 
@@ -63,6 +64,7 @@
 #include <sys/ktr.h>
 #include <sys/ktrace.h>
 #include <sys/unistd.h>	
+#include <sys/sdt.h>
 #include <sys/sx.h>
 #include <sys/signalvar.h>
 
@@ -75,7 +77,17 @@
 #include <vm/vm_extern.h>
 #include <vm/uma.h>
 
+#ifdef KDTRACE_HOOKS
+#include <sys/dtrace_bsd.h>
+dtrace_fork_func_t	dtrace_fasttrap_fork;
+#endif
 
+SDT_PROVIDER_DECLARE(proc);
+SDT_PROBE_DEFINE(proc, kernel, , create);
+SDT_PROBE_ARGTYPE(proc, kernel, , create, 0, "struct proc *");
+SDT_PROBE_ARGTYPE(proc, kernel, , create, 1, "struct proc *");
+SDT_PROBE_ARGTYPE(proc, kernel, , create, 2, "int");
+
 #ifndef _SYS_SYSPROTO_H_
 struct fork_args {
 	int     dummy;
@@ -621,6 +633,13 @@
 	}
 
 	/*
+	 * Tell the DTrace fasttrap provider about the new process
+	 * if it has registered an interest.
+	 */
+	if (dtrace_fasttrap_fork)
+		dtrace_fasttrap_fork(p1, p2);
+
+	/*
 	 * This begins the section where we must prevent the parent
 	 * from being swapped.
 	 */
@@ -707,6 +726,8 @@
 	 */
 	KNOTE_LOCKED(&p1->p_klist, NOTE_FORK | p2->p_pid);
 
+	SDT_PROBE(proc, kernel, , create, p2, p1, flags, 0, 0);
+
 	PROC_UNLOCK(p1);
 
 	/*



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