Linux DTrace development list
 help / color / mirror / Atom feed
* [PATCH v2] btf: ensure BTF-to-CTF conversion works for modules
@ 2024-07-25 16:46 Kris Van Hees
  2024-07-25 16:50 ` [DTrace-devel] " Nick Alcock
  0 siblings, 1 reply; 2+ messages in thread
From: Kris Van Hees @ 2024-07-25 16:46 UTC (permalink / raw)
  To: dtrace, dtrace-devel

The recent introduction of code to always load BTF data for modules
broke the BTF-to-CTF conversion for modules.  This patch ensures that
the BTF-to-CTF convertor code is called from any module that does not
contain CTF data.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
 libdtrace/dt_module.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libdtrace/dt_module.c b/libdtrace/dt_module.c
index 5e608446..dc00aa88 100644
--- a/libdtrace/dt_module.c
+++ b/libdtrace/dt_module.c
@@ -963,7 +963,6 @@ dt_kern_module_find_ctf(dtrace_hdl_t *dtp, dt_module_t *dmp)
 				   "looking for in-module CTF instead.\n",
 				   ctfa_name, ctf_errmsg(dtp->dt_ctferr));
 #endif
-			return;
 		}
 
 		if (dtp->dt_ctfa_path == NULL)
@@ -1018,6 +1017,11 @@ dt_kern_module_find_ctf(dtrace_hdl_t *dtp, dt_module_t *dmp)
 
 		dmp->dm_flags |= DT_DM_CTF_ARCHIVED;
 		ctf_setspecific(dmp->dm_ctfp, dmp);
+#ifdef HAVE_LIBCTF
+	} else {
+		/* Generate CTF from BTF for the module. */
+		dt_kern_module_ctf_from_btf(dtp, dmp);
+#endif
 	}
 
 	/*
-- 
2.42.0


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

* Re: [DTrace-devel] [PATCH v2] btf: ensure BTF-to-CTF conversion works for modules
  2024-07-25 16:46 [PATCH v2] btf: ensure BTF-to-CTF conversion works for modules Kris Van Hees
@ 2024-07-25 16:50 ` Nick Alcock
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Alcock @ 2024-07-25 16:50 UTC (permalink / raw)
  To: Kris Van Hees; +Cc: dtrace

On 25 Jul 2024, Kris Van Hees via DTrace-devel stated:

> The recent introduction of code to always load BTF data for modules
> broke the BTF-to-CTF conversion for modules.  This patch ensures that
> the BTF-to-CTF convertor code is called from any module that does not
> contain CTF data.
>
> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>

Reviewed-by: Nick Alcock <nick.alcock@oracle.com>

(I've added testing against my standard victim tiny out-of-tree module
to the tests I'll run at the next release, just to be sure...)

(btw, converter is spelled, uh, converter.)

-- 
NULL && (void)

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

end of thread, other threads:[~2024-07-25 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25 16:46 [PATCH v2] btf: ensure BTF-to-CTF conversion works for modules Kris Van Hees
2024-07-25 16:50 ` [DTrace-devel] " Nick Alcock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox