Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Mar 2003 08:28:11 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 26499 for review
Message-ID:  <200303071628.h27GSB3Z055751@repoman.freebsd.org>

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

Change 26499 by jhb@jhb_laptop on 2003/03/07 08:27:42

	Don't use the tree-wide level for the indent, instead, always indent
	direct children of a lock only one space from the parent.

Affected files ...

.. //depot/projects/smpng/sys/kern/subr_witness.c#89 edit

Differences ...

==== //depot/projects/smpng/sys/kern/subr_witness.c#89 (text+ko) ====

@@ -167,7 +167,7 @@
 static int	reparentchildren(struct witness *newparent,
 		    struct witness *oldparent);
 static void	witness_displaydescendants(void(*)(const char *fmt, ...),
-					   struct witness *);
+					   struct witness *, int indent);
 static const char *fixup_filename(const char *file);
 static void	witness_leveldescendents(struct witness *parent, int level);
 static void	witness_levelall(void);
@@ -519,7 +519,7 @@
 		/*
 		 * This lock has no anscestors, display its descendants. 
 		 */
-		witness_displaydescendants(prnt, w);
+		witness_displaydescendants(prnt, w, 0);
 	}
 }
 	
@@ -564,10 +564,10 @@
 
 #if 1
 	/* Extra check from Sanity Clause. */
-	prnt("\nLocks which weren't displayed!\n");
+	prnt("\nLocks which weren't displayed:\n");
 	STAILQ_FOREACH(w, &w_all, w_list) {
 		if (w->w_displayed == 0)
-			witness_displaydescendants(prnt, w);
+			witness_displaydescendants(prnt, w, 0);
 	}
 #endif
 }
@@ -1414,14 +1414,14 @@
 
 static void
 witness_displaydescendants(void(*prnt)(const char *fmt, ...),
-			   struct witness *parent)
+			   struct witness *parent, int indent)
 {
 	struct witness_child_list_entry *wcl;
 	int i, level;
 
 	level = parent->w_level;
 	prnt("%-2d", level);
-	for (i = 0; i < level; i++)
+	for (i = 0; i < indent; i++)
 		prnt(" ");
 	if (parent->w_refcount > 0)
 		prnt("%s", parent->w_name);
@@ -1441,7 +1441,7 @@
 	for (wcl = parent->w_children; wcl != NULL; wcl = wcl->wcl_next)
 		for (i = 0; i < wcl->wcl_count; i++)
 			    witness_displaydescendants(prnt,
-				wcl->wcl_children[i]);
+				wcl->wcl_children[i], indent + 1);
 }
 
 #ifdef BLESSING

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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