From 6074f48fa78a41f785ca5979ce73f4d7d3dc4306 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 1 Jan 2007 11:17:13 +0000 Subject: [PATCH] Tweak cache_lru_print --- servers/slapd/back-bdb/cache.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) 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 -- 2.39.5