summaryrefslogtreecommitdiff
path: root/source3/tdb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-08-05 04:32:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:00:25 -0500
commit1a2316f6445e7dde953a2b5f1fb5931edf704b98 (patch)
tree0bcca0aab273b46cdf7195ef7ea6ac0b2f962097 /source3/tdb
parent21a6af31d93b628b9485d6f95ad8ee6099749980 (diff)
downloadsamba-1a2316f6445e7dde953a2b5f1fb5931edf704b98.tar.gz
samba-1a2316f6445e7dde953a2b5f1fb5931edf704b98.tar.bz2
samba-1a2316f6445e7dde953a2b5f1fb5931edf704b98.zip
r9095: Add crude chainlength statistics to the crude tdbtool.
Volker (This used to be commit 5e6fef32b372e20cb570c578e2044e89f9ee45b3)
Diffstat (limited to 'source3/tdb')
-rw-r--r--source3/tdb/tdb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index 2c94f94587..d68df03776 100644
--- a/source3/tdb/tdb.c
+++ b/source3/tdb/tdb.c
@@ -560,6 +560,7 @@ static tdb_off tdb_dump_record(TDB_CONTEXT *tdb, tdb_off offset)
static int tdb_dump_chain(TDB_CONTEXT *tdb, int i)
{
tdb_off rec_ptr, top;
+ int hash_length = 0;
top = TDB_HASH_TOP(i);
@@ -574,8 +575,11 @@ static int tdb_dump_chain(TDB_CONTEXT *tdb, int i)
while (rec_ptr) {
rec_ptr = tdb_dump_record(tdb, rec_ptr);
+ hash_length += 1;
}
+ printf("chain %d length %d\n", i, hash_length);
+
return tdb_unlock(tdb, i, F_WRLCK);
}