From: Wouter Wijngaards Date: Mon, 13 Aug 2007 12:23:49 +0000 (+0000) Subject: More logging. X-Git-Tag: release-0.5~130 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86723bd03234c0008ee20bf98d1eb1246aa11772;p=thirdparty%2Funbound.git More logging. git-svn-id: file:///svn/unbound/trunk@511 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index b4448653d..3db371724 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -3,6 +3,7 @@ mess up the dependencies. - canonical compare routine updated. - canonical hinfo compare. + - printout list of the queries that the mesh is working on. 10 August 2007: Wouter - malloc and free overrides that track total allocation and frees. diff --git a/services/mesh.c b/services/mesh.c index 308f1d38f..6c085207a 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -602,8 +602,28 @@ void mesh_run(struct mesh_area* mesh, struct mesh_state* mstate, (void)rbtree_delete(&mesh->run, mstate); } else mstate = NULL; } - if(verbosity >= VERB_ALGO) + if(verbosity >= VERB_ALGO) { mesh_stats(mesh, "mesh_run: end"); + mesh_log_list(mesh); + } +} + +void +mesh_log_list(struct mesh_area* mesh) +{ + char buf[30]; + struct mesh_state* m; + int num = 0; + RBTREE_FOR(m, struct mesh_state*, &mesh->all) { + snprintf(buf, sizeof(buf), "%d%s%s%s%s%s mod%d %s", + num++, (m->s.is_priming)?"p":"", /* prime */ + (m->s.query_flags&BIT_RD)?"RD":"", + (m->s.query_flags&BIT_CD)?"CD":"", + (m->super_set.count==0)?"d":"", /* detached */ + (m->sub_set.count!=0)?"c":"", /* children */ + m->s.curmod, (m->reply_list)?"hr":"nr"); /*hasreply*/ + log_query_info(VERB_ALGO, buf, &m->s.qinfo); + } } void diff --git a/services/mesh.h b/services/mesh.h index f0818e26d..7bc505b07 100644 --- a/services/mesh.h +++ b/services/mesh.h @@ -343,6 +343,12 @@ void mesh_run(struct mesh_area* mesh, struct mesh_state* mstate, */ void mesh_stats(struct mesh_area* mesh, const char* str); +/** + * Print all the states in the mesh to the log. + * @param mesh: the mesh to print all states of. + */ +void mesh_log_list(struct mesh_area* mesh); + /** * Calculate memory size in use by mesh and all queries inside it. * @param mesh: the mesh to examine.