trace_sys.c (647B)
1 /* Copyright (c) 2018-2021, The Tor Project, Inc. */ 2 /* See LICENSE for licensing information */ 3 4 /** 5 * \file log_sys.c 6 * \brief Setup and tear down the tracing module. 7 **/ 8 9 #include "lib/subsys/subsys.h" 10 11 #include "lib/trace/trace.h" 12 #include "lib/trace/trace_sys.h" 13 14 static int 15 subsys_tracing_initialize(void) 16 { 17 tor_trace_init(); 18 return 0; 19 } 20 21 static void 22 subsys_tracing_shutdown(void) 23 { 24 tor_trace_free_all(); 25 } 26 27 const subsys_fns_t sys_tracing = { 28 SUBSYS_DECLARE_LOCATION(), 29 30 .name = "tracing", 31 .supported = true, 32 .level = TRACE_SUBSYS_LEVEL, 33 34 .initialize = subsys_tracing_initialize, 35 .shutdown = subsys_tracing_shutdown, 36 };