From: Howard Chu Date: Mon, 1 Jan 2007 11:17:13 +0000 (+0000) Subject: Tweak cache_lru_print X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~282 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6074f48fa78a41f785ca5979ce73f4d7d3dc4306;p=openldap Tweak cache_lru_print --- diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index 1962778208..b85ed6c8e2 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -1288,15 +1288,22 @@ bdb_lru_print( Cache *cache ) { EntryInfo *e; - fprintf( stderr, "LRU queue (head to tail):\n" ); - for ( e = cache->c_lruhead; e != NULL; e = e->bei_lrunext ) { - fprintf( stderr, "\trdn \"%20s\" id %ld\n", - e->bei_nrdn.bv_val, e->bei_id ); + fprintf( stderr, "LRU circle head: %p\n", cache->c_lruhead ); + fprintf( stderr, "LRU circle (tail forward):\n" ); + for ( e = cache->c_lrutail; ; ) { + fprintf( stderr, "\t%p, %p id %ld rdn \"%s\"\n", + e, e->bei_e, e->bei_id, e->bei_nrdn.bv_val ); + e = e->bei_lrunext; + if ( e == cache->c_lrutail ) + break; } - fprintf( stderr, "LRU queue (tail to head):\n" ); - for ( e = cache->c_lrutail; e != NULL; e = e->bei_lruprev ) { - fprintf( stderr, "\trdn \"%20s\" id %ld\n", - e->bei_nrdn.bv_val, e->bei_id ); + fprintf( stderr, "LRU circle (tail backward):\n" ); + for ( e = cache->c_lrutail; ; ) { + fprintf( stderr, "\t%p, %p id %ld rdn \"%s\"\n", + e, e->bei_e, e->bei_id, e->bei_nrdn.bv_val ); + e = e->bei_lruprev; + if ( e == cache->c_lrutail ) + break; } } #endif