Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Enable DEBUG_EXEC, if we have DEBUG (since it only ...



details:   https://anonhg.NetBSD.org/src/rev/d9f8fe3fd938
branches:  trunk
changeset: 345123:d9f8fe3fd938
user:      christos <christos%NetBSD.org@localhost>
date:      Sun May 08 20:00:21 2016 +0000

description:
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.

diffstat:

 sys/kern/kern_exec.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (48 lines):

diff -r 55c944e16338 -r d9f8fe3fd938 sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c      Sun May 08 10:13:01 2016 +0000
+++ b/sys/kern/kern_exec.c      Sun May 08 20:00:21 2016 +0000
@@ -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 @@
     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 @@
        /* 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 @@
        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:



Home | Main Index | Thread Index | Old Index