Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): add debug logging for OpenDirs_Done



details:   https://anonhg.NetBSD.org/src/rev/37fed66bd1d3
branches:  trunk
changeset: 957479:37fed66bd1d3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 29 14:29:19 2020 +0000

description:
make(1): add debug logging for OpenDirs_Done

diffstat:

 usr.bin/make/dir.c               |  8 ++++++--
 usr.bin/make/unit-tests/Makefile |  3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diffs (49 lines):

diff -r dc3ef9b3dd63 -r 37fed66bd1d3 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Sun Nov 29 12:38:44 2020 +0000
+++ b/usr.bin/make/dir.c        Sun Nov 29 14:29:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.235 2020/11/29 12:30:40 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.236 2020/11/29 14:29:19 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -136,7 +136,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.235 2020/11/29 12:30:40 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.236 2020/11/29 14:29:19 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -332,9 +332,13 @@
 OpenDirs_Done(OpenDirs *odirs)
 {
        CachedDirListNode *ln = odirs->list.first;
+       DIR_DEBUG1("OpenDirs_Done: %u entries to remove\n",
+           odirs->table.numEntries);
        while (ln != NULL) {
                CachedDirListNode *next = ln->next;
                CachedDir *dir = ln->datum;
+               DIR_DEBUG2("OpenDirs_Done: refCount %d for \"%s\"\n",
+                   dir->refCount, dir->name);
                CachedDir_Destroy(dir); /* removes the dir from odirs->list */
                ln = next;
        }
diff -r dc3ef9b3dd63 -r 37fed66bd1d3 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Sun Nov 29 12:38:44 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Sun Nov 29 14:29:19 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.227 2020/11/29 10:57:16 rillig Exp $
+# $NetBSD: Makefile,v 1.228 2020/11/29 14:29:19 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -439,6 +439,7 @@
 
 # Some tests need extra postprocessing.
 SED_CMDS.dir=          ${:D remove output from -DCLEANUP mode }
+SED_CMDS.dir+=         -e '/^OpenDirs_Done:/d'
 SED_CMDS.dir+=         -e '/^CachedDir refCount/d'
 SED_CMDS.export=       -e '/^[^=_A-Za-z0-9]*=/d'
 SED_CMDS.export-all=   ${SED_CMDS.export}



Home | Main Index | Thread Index | Old Index