]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Implement a function to list the subsystems to stdout.
authorNick Mathewson <nickm@torproject.org>
Mon, 30 Sep 2019 14:05:42 +0000 (10:05 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 26 Mar 2020 15:20:20 +0000 (11:20 -0400)
src/app/main/subsysmgr.c
src/app/main/subsysmgr.h

index 5807cbbaa48cc8996b0a13c8bc70887f1b34b7bc..4913949e2c446a9b6cfac9e8eede221c188b6d9c 100644 (file)
@@ -293,6 +293,19 @@ subsystems_thread_cleanup(void)
   }
 }
 
+/**
+ * Dump a human- and machine-readable list of all the subsystems to stdout,
+ * in their initialization order, prefixed with their level.
+ **/
+void
+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);
+  }
+}
+
 /**
  * Register all subsystem-declared options formats in <b>mgr</b>.
  *
index 35635a756eaf3c30e0084549e2e47892fab9d47f..ae0b3df46920d95f3549de1dc397338796893c0a 100644 (file)
@@ -31,6 +31,8 @@ void subsystems_prefork(void);
 void subsystems_postfork(void);
 void subsystems_thread_cleanup(void);
 
+void subsystems_dump_list(void);
+
 struct config_mgr_t;
 int subsystems_register_options_formats(struct config_mgr_t *mgr);
 int subsystems_register_state_formats(struct config_mgr_t *mgr);