Skip to contentSkip to conversation

mm/zsmalloc: add log for module load/unload

PATCH In review Ganesh Mahendran 3 participants 4 messages Jan 24, 2015 – Jan 27, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/zsmalloc: add log for module load/unload

Sometimes, we want to know whether a module is loaded or unloaded from the log.

This patch adds some log.

---
 mm/zsmalloc.c |    7 +++++++
 1 file changed, 7 insertions(+)
mm/zsmalloc.c +7 -0
index 2d5f5be..16617e9 100644
@@ -72,6 +72,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #ifdef CONFIG_ZSMALLOC_DEBUG
 #define DEBUG
 #endif
@@ -1460,6 +1462,8 @@ static int __init zs_init(void)
 {
 	int ret = zs_register_cpu_notifier();
 
+	pr_info("loaded\n");
+
 	if (ret)
 		goto notifier_fail;
 
@@ -1474,6 +1478,7 @@ static int __init zs_init(void)
 		pr_err("zs stat initialization failed\n");
 		goto stat_fail;
 	}
+
 	return 0;
 
 stat_fail:
@@ -1483,6 +1488,8 @@ stat_fail:
 notifier_fail:
 	zs_unregister_cpu_notifier();
 
+	pr_info("unloaded\n");
+
 	return ret;
 }
 
Signature · 7 lines
1.7.9.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
maintainer
#1 lore raw
Quoted 2 lines · On Sat, 24 Jan 2015 21:48:41 +0800 Ganesh Mahendran…

Sometimes, we want to know whether a module is loaded or unloaded from the log.

Why? What's special about zsmalloc?

Please provide much better justification than this.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw

Hello, Andrew

2015-01-27 7:19 GMT+08:00 Andrew Morton <[email protected]>:

Quoted 8 lines · On Sat, 24 Jan 2015 21:48:41 +0800 Ganesh Mahendran…
Quoted 3 lines

Sometimes, we want to know whether a module is loaded or unloaded from the log.

Why? What's special about zsmalloc?

Please provide much better justification than this.

When I debug with the zsmalloc module built in kernel. After system boots up, I did not see:
/sys/kernel/debug/zsmalloc dir.

Although the reason for this is that I made a mistake. I forgot to add debugfs entry in /etc/fstab.
But I think it is suitable to add information for a module load/unload. Then we can get this by:
dmesg | grep zsmalloc.

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

maintainer
#3 lore raw

Hello Ganesh,

Quoted 16 lines · Ganesh Mahendran

Hello, Andrew

2015-01-27 7:19 GMT+08:00 Andrew Morton <[email protected]>:

Quoted 8 lines · On Sat, 24 Jan 2015 21:48:41 +0800 Ganesh Mahendran…
Quoted 3 lines

Sometimes, we want to know whether a module is loaded or unloaded from the log.

Why? What's special about zsmalloc?

Please provide much better justification than this.

When I debug with the zsmalloc module built in kernel. After system boots up, I did not see:
/sys/kernel/debug/zsmalloc dir.

Quoted 5 lines

Although the reason for this is that I made a mistake. I forgot to add debugfs entry in /etc/fstab.
But I think it is suitable to add information for a module load/unload. Then we can get this by:
dmesg | grep zsmalloc.

I understand your trouble but it's general problem, not zsmalloc specific. Then, if you really want to fix, you should approach more generic ways.

Thanks.

Signature · 8 lines
Kind regards,
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>