From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Volodymyr Babchuk" <volodymyr_babchuk@epam.com>
Subject: [PATCH] trace: convert init_trace_bufs() to constructor
Date: Thu, 13 Mar 2025 14:38:22 +0100 [thread overview]
Message-ID: <e1e556c4-ed71-41f7-acfc-b7fa866a0d3e@suse.com> (raw)
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;
next reply other threads:[~2025-03-13 13:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 13:38 Jan Beulich [this message]
2025-03-13 13:58 ` [PATCH] trace: convert init_trace_bufs() to constructor 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e1e556c4-ed71-41f7-acfc-b7fa866a0d3e@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bertrand.marquis@arm.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=volodymyr_babchuk@epam.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.