Module Name:    src
Committed By:   christos
Date:           Sun May  8 20:00:21 UTC 2016

Modified Files:
        src/sys/kern: kern_exec.c

Log Message:
Enable DEBUG_EXEC, if we have DEBUG (since it only fires on errors) and
disable the super verbose printing by protecting it against TRACE_EXEC.


To generate a diff of this commit:
cvs rdiff -u -r1.427 -r1.428 src/sys/kern/kern_exec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.427 src/sys/kern/kern_exec.c:1.428
--- src/sys/kern/kern_exec.c:1.427	Sat May  7 21:28:09 2016
+++ src/sys/kern/kern_exec.c	Sun May  8 16:00:21 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.427 2016/05/08 01:28:09 christos Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.428 2016/05/08 20:00:21 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.427 2016/05/08 01:28:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.428 2016/05/08 20:00:21 christos Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -133,6 +133,9 @@ static int copyinargstrs(struct execve_d
     execve_fetch_element_t, char **, size_t *, void (*)(const void *, size_t));
 static int exec_sigcode_map(struct proc *, const struct emul *);
 
+#ifdef DEBUG
+#define DEBUG_EXEC
+#endif
 #ifdef DEBUG_EXEC
 #define DPRINTF(a) printf a
 #define COPYPRINTF(s, a, b) printf("%s, %d: copyout%s @%p %zu\n", __func__, \
@@ -850,7 +853,9 @@ execve_dovmcmds(struct lwp *l, struct ex
 	/* create the new process's VM space by running the vmcmds */
 	KASSERTMSG(epp->ep_vmcmds.evs_used != 0, "%s: no vmcmds", __func__);
 
+#ifdef TRACE_EXEC
 	DUMPVMCMDS(epp, 0, 0);
+#endif
 
 	base_vcp = NULL;
 
@@ -1318,7 +1323,9 @@ execve_runproc(struct lwp *l, struct exe
 	pathbuf_stringcopy_put(data->ed_pathbuf, data->ed_pathstring);
 	pathbuf_destroy(data->ed_pathbuf);
 	PNBUF_PUT(data->ed_resolvedpathbuf);
+#ifdef TRACE_EXEC
 	DPRINTF(("%s finished\n", __func__));
+#endif
 	return EJUSTRETURN;
 
  exec_abort:

Reply via email to