]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
remove --memstats from cfg_test
authorColin Vidal <colin@isc.org>
Fri, 7 Nov 2025 17:56:39 +0000 (18:56 +0100)
committerColin Vidal <colin@isc.org>
Thu, 4 Dec 2025 15:09:40 +0000 (16:09 +0100)
The `--memstats` option from cfg_test is unused, and even if used, does
nothing because `--memstats` relies on `isc_mem_stats` which dump memory
pools statistics, which are not used at all for configuration.

Also, dropping the option avoid to add a parser API to get the memory
stats (as the parser now uses the global memory context).

doc/misc/cfg_test.c

index cb17b35e1b9db9cb74467f5533a960bca7c2e33c..5ef29e45fcfdea2917978f1f6ba3fbd697fb42ac 100644 (file)
@@ -35,7 +35,7 @@ static void
 usage(void) {
        fprintf(stderr, "usage: cfg_test --rndc|--named "
                        "[--grammar] [--zonegrammar] [--active] "
-                       "[--memstats] conffile\n");
+                       "conffile\n");
        exit(EXIT_FAILURE);
 }
 
@@ -55,7 +55,6 @@ main(int argc, char **argv) {
        cfg_obj_t *cfg = NULL;
        cfg_type_t *type = NULL;
        bool grammar = false;
-       bool memstats = false;
        char *filename = NULL;
        unsigned int zonetype = 0;
        unsigned int pflags = 0;
@@ -108,8 +107,6 @@ main(int argc, char **argv) {
                        } else {
                                usage();
                        }
-               } else if (strcmp(argv[1], "--memstats") == 0) {
-                       memstats = true;
                } else if (strcmp(argv[1], "--named") == 0) {
                        type = &cfg_type_namedconf;
                } else if (strcmp(argv[1], "--rndc") == 0) {
@@ -146,13 +143,6 @@ main(int argc, char **argv) {
                cfg_obj_detach(&cfg);
        }
 
-       if (memstats) {
-               /*
-                * TODO: this is memstat of config that we are interested in
-                * here, right?
-                */
-               isc_mem_stats(mctx, stderr);
-       }
        isc_mem_detach(&mctx);
 
        fflush(stdout);