]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
More logging.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 13 Aug 2007 12:23:49 +0000 (12:23 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 13 Aug 2007 12:23:49 +0000 (12:23 +0000)
git-svn-id: file:///svn/unbound/trunk@511 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
services/mesh.c
services/mesh.h

index b4448653daf931f4950e44b1f5f3eb99bb487898..3db371724bb8c8ee7c04becceee74b432ff15885 100644 (file)
@@ -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.
index 308f1d38f92e2be19371ddf72747e7d5c291df06..6c085207ac9b76abf6dec83941071c05f15b3490 100644 (file)
@@ -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 
index f0818e26d3ccbd67a5876fedbfbaca8bbd45318a..7bc505b07b47b8da7b99bc65fbb8c99c863e34ca 100644 (file)
@@ -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.