All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] trace: convert init_trace_bufs() to constructor
@ 2025-03-13 13:38 Jan Beulich
  2025-03-13 13:58 ` Andrew Cooper
  2025-03-27 14:49 ` Julien Grall
  0 siblings, 2 replies; 13+ messages in thread
From: Jan Beulich @ 2025-03-13 13:38 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Anthony PERARD,
	Michal Orzel, Roger Pau Monné, Bertrand Marquis,
	Volodymyr Babchuk

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>
---
Same could then apparently be done for heap_init_late(). Thoughts?

--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -491,8 +491,6 @@ void asmlinkage __init start_xen(unsigne
 
     heap_init_late();
 
-    init_trace_bufs();
-
     init_constructors();
 
     console_endboot();
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -2143,8 +2143,6 @@ void asmlinkage __init noreturn __start_
 
     heap_init_late();
 
-    init_trace_bufs();
-
     init_constructors();
 
     console_endboot();
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -336,7 +336,7 @@ int trace_will_trace_event(u32 event)
  * trace buffers.  The trace buffers are then available for debugging use, via
  * the %TRACE_xD macros exported in <xen/trace.h>.
  */
-void __init init_trace_bufs(void)
+static void __init __constructor init_trace_bufs(void)
 {
     cpumask_setall(&tb_cpu_mask);
     register_cpu_notifier(&cpu_nfb);
--- a/xen/include/xen/trace.h
+++ b/xen/include/xen/trace.h
@@ -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, u
 
 #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;


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-03-27 21:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-13 13:38 [PATCH] trace: convert init_trace_bufs() to constructor Jan Beulich
2025-03-13 13:58 ` Andrew Cooper
2025-03-13 14:19   ` Jan Beulich
2025-03-13 16:28     ` Andrew Cooper
2025-03-13 16:37       ` Jan Beulich
2025-03-13 17:03         ` Andrew Cooper
2025-03-14  6:49           ` Jan Beulich
2025-03-14 11:35             ` Andrew Cooper
2025-03-27 14:49 ` Julien Grall
2025-03-27 15:08   ` Jan Beulich
2025-03-27 15:49     ` Julien Grall
2025-03-27 16:10       ` Jan Beulich
2025-03-27 21:48         ` Julien Grall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.