Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Aug 2006 01:45:41 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 103933 for review
Message-ID:  <200608150145.k7F1jfR9079665@repoman.freebsd.org>

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

Change 103933 by jb@jb_freebsd2 on 2006/08/15 01:45:38

	Conditional compilation based on the KDTRACE kernel option.

Affected files ...

.. //depot/projects/dtrace/src/sys/kern/kern_exec.c#9 edit
.. //depot/projects/dtrace/src/sys/kern/kern_exit.c#7 edit
.. //depot/projects/dtrace/src/sys/kern/kern_fork.c#6 edit

Differences ...

==== //depot/projects/dtrace/src/sys/kern/kern_exec.c#9 (text+ko) ====

@@ -54,7 +54,9 @@
 #include <sys/namei.h>
 #include <sys/resourcevar.h>
 #include <sys/sf_buf.h>
+#ifdef KDTRACE
 #include <sys/sdt.h>
+#endif
 #include <sys/syscallsubr.h>
 #include <sys/sysent.h>
 #include <sys/shm.h>
@@ -346,7 +348,9 @@
 	if (error)
 		goto exec_fail;
 #endif
+#ifdef KDTRACE
 	DTRACE_PROBE1(__proc_exec, char *, imgp->interpreter_name);
+#endif
 
 	imgp->image_header = NULL;
 
@@ -787,12 +791,14 @@
 	VFS_UNLOCK_GIANT(vfslocked);
 	exec_free_args(args);
 
+#ifdef KDTRACE
 	if (error == 0) {
 		DTRACE_PROBE1(__proc_exec__success, proc *, p);
 	}
 	else {
 		DTRACE_PROBE1(__proc_exec__failure, int, error); 
 	}	
+#endif
 	if (error && imgp->vmspace_destroyed) {
 		/* sorry, no more process anymore. exit gracefully */
 		exit1(td, W_EXITCODE(0, SIGABRT));

==== //depot/projects/dtrace/src/sys/kern/kern_exit.c#7 (text+ko) ====

@@ -59,7 +59,9 @@
 #include <sys/sbuf.h>
 #include <sys/signalvar.h>
 #include <sys/sched.h>
+#ifdef KDTRACE
 #include <sys/sdt.h>
+#endif
 #include <sys/sx.h>
 #include <sys/syscallsubr.h>
 #include <sys/syslog.h>
@@ -236,7 +238,9 @@
 	 */
 	EVENTHANDLER_INVOKE(process_exit, p);
 
+#ifdef KDTRACE
 	DTRACE_PROBE1(__proc_exit, int, WTERMSIG(rv));
+#endif
 
 	MALLOC(p->p_ru, struct rusage *, sizeof(struct rusage),
 		M_ZOMBIE, M_WAITOK);

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

@@ -65,7 +65,9 @@
 #include <sys/unistd.h>	
 #include <sys/sx.h>
 #include <sys/signalvar.h>
+#ifdef KDTRACE
 #include <sys/sdt.h>
+#endif
 #include <security/audit/audit.h>
 
 #include <vm/vm.h>
@@ -694,7 +696,10 @@
 	mtx_lock_spin(&sched_lock);
 	p2->p_state = PRS_NORMAL;
 
+#ifdef KDTRACE
 	DTRACE_PROBE1(__proc_create, proc *, p2);
+#endif
+
 	/*
 	 * If RFSTOPPED not requested, make child runnable and add to
 	 * run queue.



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