]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Also display ECS module memory stats in stats_shm
authorRalph Dolmans <ralph@nlnetlabs.nl>
Tue, 11 Apr 2017 13:37:39 +0000 (13:37 +0000)
committerRalph Dolmans <ralph@nlnetlabs.nl>
Tue, 11 Apr 2017 13:37:39 +0000 (13:37 +0000)
git-svn-id: file:///svn/unbound/trunk@4107 be551aaa-1e26-0410-a405-d3ace91eadb9

smallapp/unbound-control.c
util/shm_side/shm_main.c
util/shm_side/shm_main.h

index 3f00525b641b1ce222f55dcabb48b795e2bca703..6cd4e70861f043ee9b03fef67503511c6f698305 100644 (file)
@@ -238,6 +238,9 @@ static void print_mem(struct shm_stat_info* shm_stat)
        PR_LL("mem.cache.message", shm_stat->mem.msg);
        PR_LL("mem.cache.iterator", shm_stat->mem.iter);
        PR_LL("mem.cache.validator", shm_stat->mem.val);
+#ifdef CLIENT_SUBNET
+       PR_LL("mem.cache.subnet", shm_stat->mem.subnet);
+#endif
 }
 
 /** print histogram */
index 1753b15e22a8944f5b790bacc4dce2fdab051a56..32ba73f1ea0cc7fb5efacefc4741d8cd8a7222c2 100644 (file)
@@ -262,6 +262,13 @@ void shm_main_run(struct worker *worker)
                        fptr_ok(fptr_whitelist_mod_get_mem(worker->env.mesh->mods.mod[modstack]->get_mem));
                        shm_stat->mem.iter = (*worker->env.mesh->mods.mod[modstack]->get_mem)(&worker->env, modstack);
                }
+#ifdef CLIENT_SUBNET
+               modstack = modstack_find(&worker->env.mesh->mods, "subnet");
+               if(modstack != -1) {
+                       fptr_ok(fptr_whitelist_mod_get_mem(worker->env.mesh->mods.mod[modstack]->get_mem));
+                       shm_stat->mem.subnet = (*worker->env.mesh->mods.mod[modstack]->get_mem)(&worker->env, modstack);
+               }
+#endif
        }
 
        server_stats_add(stat_total, stat_info);
index c45519306cddc793db4c49fbb78070fe77cd8d19..1ecac5560056ff6c527e83bf430fb8c5651bb52f 100644 (file)
@@ -61,6 +61,9 @@ struct shm_stat_info {
                size_t rrset;
                size_t val;
                size_t iter;
+#ifdef CLIENT_SUBNET
+               size_t subnet;
+#endif
        } mem;
 };