From owner-p4-projects@FreeBSD.ORG Thu Oct 20 17:28:01 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2E05416A421; Thu, 20 Oct 2005 17:28:01 +0000 (GMT) X-Original-To: perforce@freebsd.org 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 E102C16A41F for ; Thu, 20 Oct 2005 17:28:00 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAA2143D66 for ; Thu, 20 Oct 2005 17:28:00 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j9KHS0pk015920 for ; Thu, 20 Oct 2005 17:28:00 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j9KHS0gu015917 for perforce@freebsd.org; Thu, 20 Oct 2005 17:28:00 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 20 Oct 2005 17:28:00 GMT Message-Id: <200510201728.j9KHS0gu015917@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 85601 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2005 17:28:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=85601 Change 85601 by rwatson@rwatson_zoo on 2005/10/20 17:27:15 Add DDB "show uma" command. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/vm/uma_core.c#6 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/vm/uma_core.c#6 (text+ko) ==== @@ -57,7 +57,9 @@ #define UMA_DEBUG_ALLOC_1 1 */ +#include "opt_ddb.h" #include "opt_param.h" + #include #include #include @@ -86,6 +88,8 @@ #include +#include + /* * This is the zone and keg from which all zones are spawned. The idea is that * even the zone & keg heads are allocated from the allocator, so we use the @@ -3039,3 +3043,35 @@ free(buffer, M_TEMP); return (error); } + +#ifdef DDB +DB_SHOW_COMMAND(uma, db_show_uma) +{ + u_int64_t allocs, frees; + uma_bucket_t bucket; + uma_keg_t kz; + uma_zone_t z; + int cachefree; + + db_printf("%18s %12s %12s %12s %8s\n", "Zone", "Allocs", "Frees", + "Used", "Cache"); + LIST_FOREACH(kz, &uma_kegs, uk_link) { + LIST_FOREACH(z, &kz->uk_zones, uz_link) { + if (kz->uk_flags & UMA_ZFLAG_INTERNAL) { + allocs = z->uz_allocs; + frees = z->uz_frees; + cachefree = 0; + } else + uma_zone_sumstat(z, &cachefree, &allocs, + &frees); + if (!((kz->uk_flags & UMA_ZONE_SECONDARY) && + (LIST_FIRST(&kz->uk_zones) != z))) + cachefree += kz->uk_free; + LIST_FOREACH(bucket, &z->uz_full_bucket, ub_link) + cachefree += bucket->ub_cnt; + db_printf("%18s %12llu %12llu %12llu %8d\n", z->uz_name, + allocs, frees, allocs - frees, cachefree); + } + } +} +#endif