]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add --dbg-dump-subsystem-list command to list the subsystems.
authorNick Mathewson <nickm@torproject.org>
Mon, 30 Sep 2019 14:07:20 +0000 (10:07 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 26 Mar 2020 16:17:28 +0000 (12:17 -0400)
I'm prefixing this with --dbg-* because it is not meant to be used
externally.

src/app/config/config.c
src/app/main/subsysmgr.c

index 4becae4756419e4a2c8440b432cc5cbd2aad3c7a..0ae650eb084fcf9be1ebf153eca5f0ec63ca0d49 100644 (file)
@@ -2498,6 +2498,9 @@ static const struct {
     .command=CMD_IMMEDIATE },
   { .name="--nt-service" },
   { .name="-nt-service" },
+  { .name="--dbg-dump-subsystem-list",
+    .command=CMD_IMMEDIATE,
+    .quiet=QUIET_HUSH },
   { .name=NULL },
 };
 
@@ -4604,6 +4607,10 @@ options_init_from_torrc(int argc, char **argv)
     list_deprecated_options();
     return 1;
   }
+  if (config_line_find(cmdline_only_options, "--dbg-dump-subsystem-list")) {
+    subsystems_dump_list();
+    return 1;
+  }
 
   if (config_line_find(cmdline_only_options, "--version")) {
     printf("Tor version %s.\n",get_version());
index 4913949e2c446a9b6cfac9e8eede221c188b6d9c..de601d28cdb4feec917e33bbf49283d73aa63a1f 100644 (file)
@@ -302,7 +302,8 @@ subsystems_dump_list(void)
 {
   for (unsigned i = 0; i < n_tor_subsystems - 1; ++i) {
     const subsys_fns_t *sys = tor_subsystems[i];
-    printf("% 4d\t%s\n", sys->level, sys->name);
+    printf("% 4d\t%16s\t%s\n", sys->level, sys->name,
+           sys->location?sys->location:"");
   }
 }