[DTrace-devel] [PATCH 7/7] modules: support .gz and .xz-compressed modules

Nick Alcock nick.alcock at oracle.com
Tue Oct 5 06:38:51 PDT 2021


The module path ends in .ko.*:, where * depends on the compression
algorithm: so systems with compressed modules would skip all modules on
the incorrect grounds that none existed.

Add a few compression algorithms to make this subsystem work again.
(It is mostly invisible for in-tree modules.)

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
---
 libdtrace/dt_kernel_module.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libdtrace/dt_kernel_module.c b/libdtrace/dt_kernel_module.c
index 0121cfb1c0a0..88b8011697b4 100644
--- a/libdtrace/dt_kernel_module.c
+++ b/libdtrace/dt_kernel_module.c
@@ -162,8 +162,15 @@ dt_kern_path_update(dtrace_hdl_t *dtp)
 		char *p;
 
 		suffix = strstr(line, ".ko:");
+		if (suffix == NULL)
+			suffix = strstr(line, ".ko.gz:");
+
+		if (suffix == NULL)
+			suffix = strstr(line, ".ko.xz:");
+
 		if (suffix == NULL)
 			continue;
+
 		suffix[3] = '\0';		/* chop the dep components */
 
 		modname = strrchr(line, '/');
-- 
2.33.0.256.gb827f06fa9




More information about the DTrace-devel mailing list