From 2125e11bfd9aff6eafba657f059b2974dc3761f1 Mon Sep 17 00:00:00 2001 From: rillig Date: Mon, 7 Dec 2020 23:59:59 +0000 Subject: [PATCH] make(1): clean up debug logging --- usr.bin/make/job.c | 10 ++++------ usr.bin/make/targ.c | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 15e1f85fb7f5..c83a9131bec7 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.342 2020/12/07 23:53:09 rillig Exp $ */ +/* $NetBSD: job.c,v 1.343 2020/12/07 23:59:59 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -143,7 +143,7 @@ #include "trace.h" /* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: job.c,v 1.342 2020/12/07 23:53:09 rillig Exp $"); +MAKE_RCSID("$NetBSD: job.c,v 1.343 2020/12/07 23:59:59 rillig Exp $"); /* * A shell defines how the commands are run. All commands for a target are @@ -626,8 +626,7 @@ JobPassSig_suspend(int signo) act.sa_flags = 0; (void)sigaction(signo, &act, NULL); - if (DEBUG(JOB)) - debug_printf("JobPassSig passing signal %d to self.\n", signo); + DEBUG1(JOB, "JobPassSig passing signal %d to self.\n", signo); (void)kill(getpid(), signo); @@ -719,8 +718,7 @@ EscapeShellDblQuot(const char *cmd) static void JobPrintf(Job *job, const char *fmt, const char *arg) { - if (DEBUG(JOB)) - debug_printf(fmt, arg); + DEBUG1(JOB, fmt, arg); (void)fprintf(job->cmdFILE, fmt, arg); (void)fflush(job->cmdFILE); diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index da0466339671..a6aca3b684d4 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,4 +1,4 @@ -/* $NetBSD: targ.c,v 1.153 2020/12/06 10:49:02 rillig Exp $ */ +/* $NetBSD: targ.c,v 1.154 2020/12/07 23:59:59 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -119,7 +119,7 @@ #include "dir.h" /* "@(#)targ.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: targ.c,v 1.153 2020/12/06 10:49:02 rillig Exp $"); +MAKE_RCSID("$NetBSD: targ.c,v 1.154 2020/12/07 23:59:59 rillig Exp $"); /* * All target nodes that appeared on the left-hand side of one of the @@ -452,7 +452,7 @@ Targ_PrintType(int type) switch (tbit) { #define PRINTBIT(bit, attr) case bit: debug_printf(" " attr); break -#define PRINTDBIT(bit, attr) case bit: if (DEBUG(TARG)) debug_printf(" " attr); break +#define PRINTDBIT(bit, attr) case bit: DEBUG0(TARG, " " attr); break PRINTBIT(OP_OPTIONAL, ".OPTIONAL"); PRINTBIT(OP_USE, ".USE"); PRINTBIT(OP_EXEC, ".EXEC");