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

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

Change 26495 by jhb@jhb_laptop on 2003/03/07 08:03:51

	Attempt to trim the output of 'show witness' by not displaying
	the children of a given witness more than once.

Affected files ...

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

Differences ...

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

@@ -129,6 +129,7 @@
 	u_char	w_Giant_squawked:1;
 	u_char	w_other_squawked:1;
 	u_char	w_same_squawked:1;
+	u_char	w_displayed:1;
 };
 
 struct witness_child_list_entry {
@@ -521,6 +522,11 @@
 	KASSERT(!witness_cold, ("%s: witness_cold", __func__));
 	witness_levelall();
 
+	/* Clear all the displayed flags. */
+	STAILQ_FOREACH(w, &w_all, w_list) {
+		w->w_displayed = 0;
+	}
+
 	/*
 	 * First, handle sleep locks which have been acquired at least
 	 * once.
@@ -1396,13 +1402,21 @@
 	prnt("%-2d", level);
 	for (i = 0; i < level; i++)
 		prnt(" ");
+	if (parent->w_refcount > 0)
+		prnt("%s", parent->w_name);
+	else
+		prnt("(dead)");
+	if (parent->w_displayed) {
+		prnt(" -- (already displayed)\n");
+		return;
+	}
+	parent->w_displayed = 1;
 	if (parent->w_refcount > 0) {
-		prnt("%s", parent->w_name);
 		if (parent->w_file != NULL)
-			prnt(" -- last acquired @ %s:%d\n", parent->w_file,
+			prnt(" -- last acquired @ %s:%d", parent->w_file,
 			    parent->w_line);
-	} else
-		prnt("(dead)\n");
+	}
+	prnt("\n");
 	for (wcl = parent->w_children; wcl != NULL; wcl = wcl->wcl_next)
 		for (i = 0; i < wcl->wcl_count; i++)
 			    witness_displaydescendants(prnt,

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?200303071604.h27G4e7F054181>