37 #if defined(LIBC_SCCS) && !defined(lint) 38 static char sccsid[] =
"@(#)bt_debug.c 8.5 (Berkeley) 8/17/94";
42 #include <sys/param.h> 48 #include "../include/db.h" 67 (void)fprintf(stderr,
"%s: pgsz %d",
70 (
void)fprintf(stderr,
" keys %lu", t->
bt_nrecs);
72 #define X(flag, name) \ 73 if (F_ISSET(t, flag)) { \ 74 (void)fprintf(stderr, "%s%s", sep, name); \ 85 (void)fprintf(stderr,
")\n");
109 (void)fprintf(stderr,
"magic %lx\n", m->
magic);
110 (void)fprintf(stderr,
"version %lu\n", m->
version);
111 (void)fprintf(stderr,
"psize %lu\n", m->
psize);
112 (void)fprintf(stderr,
"free %lu\n", m->
free);
113 (void)fprintf(stderr,
"nrecs %lu\n", m->
nrecs);
114 (void)fprintf(stderr,
"flags %lu", m->
flags);
116 #define X(flag, name) \ 117 if (m->flags & flag) { \ 118 (void)fprintf(stderr, "%s%s", sep, name); \ 125 (void)fprintf(stderr,
")");
136 __bt_dnpage(
dbp, pgno)
167 (void)fprintf(stderr,
" page %d: (", h->pgno);
169 #define X(flag, name) \ 170 if (h->flags & flag) { \ 171 (void)fprintf(stderr, "%s%s", sep, name); \ 181 (
void)fprintf(stderr, ")\n");
184 (void)fprintf(stderr,
"\tprev %2d next %2d", h->prevpg, h->nextpg);
185 if (h->flags & P_OVERFLOW)
189 (void)fprintf(stderr,
" lower %3d upper %3d nextind %d\n",
190 h->lower, h->upper, top);
191 for (cur = 0; cur < top; cur++) {
192 (void)fprintf(stderr,
"\t[%03d] %4d ", cur, h->linp[cur]);
193 switch (h->flags &
P_TYPE) {
196 (void)fprintf(stderr,
197 "size %03d pgno %03d", bi->
ksize, bi->
pgno);
199 (void)fprintf(stderr,
" (indirect)");
201 (void)fprintf(stderr,
206 (void)fprintf(stderr,
"entries %03d pgno %03d",
212 (void)fprintf(stderr,
213 "big key page %lu size %u/",
217 (void)fprintf(stderr,
"%s/", bl->
bytes);
219 (void)fprintf(stderr,
220 "big data page %lu size %u",
225 (void)fprintf(stderr,
"%.*s",
231 (void)fprintf(stderr,
232 "big data page %lu size %u",
236 (void)fprintf(stderr,
240 (void)fprintf(stderr,
"\n");
256 extern u_long bt_cache_hit, bt_cache_miss, bt_pfxsaved, bt_rootsplit;
257 extern u_long bt_sortsplit, bt_split;
260 pgno_t i, pcont, pinternal, pleaf;
261 u_long ifree, lfree, nkeys;
265 pcont = pinternal = pleaf = 0;
266 nkeys = ifree = lfree = 0;
290 if (h->
flags & (P_BLEAF|P_RLEAF)) {
302 (void)fprintf(stderr,
"%d level%s with %ld keys",
303 levels, levels == 1 ?
"" :
"s", nkeys);
305 (
void)fprintf(stderr,
" (%ld header count)", t->
bt_nrecs);
306 (void)fprintf(stderr,
307 "\n%lu pages (leaf %ld, internal %ld, overflow %ld)\n",
308 pinternal + pleaf + pcont, pleaf, pinternal, pcont);
309 (void)fprintf(stderr,
"%ld cache hits, %ld cache misses\n",
310 bt_cache_hit, bt_cache_miss);
311 (void)fprintf(stderr,
"%ld splits (%ld root splits, %ld sort splits)\n",
312 bt_split, bt_rootsplit, bt_sortsplit);
315 (void)fprintf(stderr,
316 "%.0f%% leaf fill (%ld bytes used, %ld bytes free)\n",
317 ((
double)(pleaf - lfree) / pleaf) * 100,
318 pleaf - lfree, lfree);
321 (void)fprintf(stderr,
322 "%.0f%% internal fill (%ld bytes used, %ld bytes free\n",
323 ((
double)(pinternal - ifree) / pinternal) * 100,
324 pinternal - ifree, ifree);
326 (void)fprintf(stderr,
"prefix checking removed %lu bytes.\n",
#define GETBLEAF(pg, indx)
#define GETRLEAF(pg, indx)
int mpool_put(MPOOL *mp, void *page, u_int flags)
static char * levels[NUMLOGLEVELS]
Logging channels used in the Asterisk logging system.
#define GETBINTERNAL(pg, indx)
#define GETRINTERNAL(pg, indx)
void * mpool_get(MPOOL *mp, pgno_t pgno, u_int flags)