From owner-p4-projects Fri Mar 7 8:14:57 2003 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DCFED37B406; Fri, 7 Mar 2003 08:14:54 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 72B8137B401 for ; Fri, 7 Mar 2003 08:14:54 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09B0743FCB for ; Fri, 7 Mar 2003 08:14:54 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h27GEr0U054903 for ; Fri, 7 Mar 2003 08:14:53 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h27GErTD054900 for perforce@freebsd.org; Fri, 7 Mar 2003 08:14:53 -0800 (PST) Date: Fri, 7 Mar 2003 08:14:53 -0800 (PST) Message-Id: <200303071614.h27GErTD054900@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 26496 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=26496 Change 26496 by jhb@jhb_laptop on 2003/03/07 08:14:28 Try a more efficient (O(n) rather than O(n^2)) way of deciding when to start displaying a hierarchy for witness_display_list(). Display a hierarchy for each witness with a level of 0. Affected files ... .. //depot/projects/smpng/sys/kern/subr_witness.c#86 edit Differences ... ==== //depot/projects/smpng/sys/kern/subr_witness.c#86 (text+ko) ==== @@ -492,12 +492,20 @@ witness_display_list(void(*prnt)(const char *fmt, ...), struct witness_list *list) { +#if 1 + struct witness *w; +#else struct witness *w, *w1; int found; +#endif STAILQ_FOREACH(w, list, w_typelist) { if (w->w_file == NULL) continue; +#if 1 + if (w->w_level > 0) + continue; +#else found = 0; STAILQ_FOREACH(w1, list, w_typelist) { if (isitmychild(w1, w)) { @@ -507,6 +515,7 @@ } if (found) continue; +#endif /* * This lock has no anscestors, display its descendants. */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message