]> xenbits.xensource.com Git - xen.git/commitdiff
trace: convert init_trace_bufs() to constructor
authorJan Beulich <jbeulich@suse.com>
Mon, 31 Mar 2025 07:20:25 +0000 (09:20 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 31 Mar 2025 07:20:25 +0000 (09:20 +0200)
There's no need for each arch to invoke it directly, and there's no need
for having a stub either. With the present placement of the calls to
init_constructors() it can easily be a constructor itself.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/setup.c
xen/arch/x86/setup.c
xen/common/trace.c
xen/include/xen/trace.h

index ffcae900d72e7da19482515c954441fab443a018..bf39d41e9be2e4397aec0ca650c1536c5e9e4275 100644 (file)
@@ -491,8 +491,6 @@ void asmlinkage __init start_xen(unsigned long fdt_paddr)
 
     heap_init_late();
 
-    init_trace_bufs();
-
     init_constructors();
 
     console_endboot();
index 7d6e52a55f2fbbca301a72621b78131cf6796621..d70abb7e0c96f865ed0fe48a287bb1689c64f51c 100644 (file)
@@ -2145,8 +2145,6 @@ void asmlinkage __init noreturn __start_xen(void)
 
     heap_init_late();
 
-    init_trace_bufs();
-
     init_constructors();
 
     console_endboot();
index 704edef39ff09892e0ed333d65e6a7eede352c7e..cfee6d7977c9568823deaac0d503c7d7f282fa3c 100644 (file)
@@ -335,8 +335,10 @@ int trace_will_trace_event(u32 event)
  * This function is called at start of day in order to initialize the per-cpu
  * trace buffers.  The trace buffers are then available for debugging use, via
  * the %TRACE_xD macros exported in <xen/trace.h>.
+ *
+ * TODO: Try and make this a presmp_initcall() to improve alloc_trace_bufs().
  */
-void __init init_trace_bufs(void)
+static void __init __constructor init_trace_bufs(void)
 {
     cpumask_setall(&tb_cpu_mask);
     register_cpu_notifier(&cpu_nfb);
index 914cecbc18d2db795e83e3d0ebc2402765d883f3..30ebdcc47fdf5fd0cfd7d92724cdf58629eaa630 100644 (file)
@@ -29,9 +29,6 @@
 
 extern bool tb_init_done;
 
-/* Used to initialise trace buffer functionality */
-void init_trace_bufs(void);
-
 /* used to retrieve the physical address of the trace buffers */
 int tb_control(struct xen_sysctl_tbuf_op *tbc);
 
@@ -49,7 +46,6 @@ void __trace_hypercall(uint32_t event, unsigned long op,
 
 #define tb_init_done false
 
-static inline void init_trace_bufs(void) {}
 static inline int tb_control(struct xen_sysctl_tbuf_op *tbc)
 {
     return -ENOSYS;