Skip to contentSkip to conversation

ndctl/monitor: make the daemon exit message 'info' level

PATCH In review Vishal Verma 2 participants 2 messages Aug 1, 2019 – Aug 2, 2019 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 ndctl/monitor: make the daemon exit message 'info' level

The 'ndctl monitor daemon started' message is at an 'info' log level, but the corresponding exit message (if no DIMMs are found for monitoring) was only at a 'debug' level. As a result, on a system without NVDIMMs, the sysadmin might see a 'monitor started' message, but a monitor wouldn't actually be running. Making the exit message the same log level ensures that no confusion arises out of this.

---
 ndctl/monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ndctl/monitor.c +1 -1
index 6829a6b..6e7f038 100644
@@ -646,7 +646,7 @@ int cmd_monitor(int argc, const char **argv, struct ndctl_ctx *ctx)
 		goto out;
 
 	if (!mfa.num_dimm) {
-		dbg(&monitor, "no dimms to monitor\n");
+		info(&monitor, "no dimms to monitor, exiting\n");
 		if (!monitor.daemon)
 			rc = -ENXIO;
 		goto out;
Signature · 6 lines
2.20.1

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
#1 lore raw
Quoted 38 lines

-----Original Message-----
From: Vishal Verma [mailto:[email protected]]
Sent: Friday, August 2, 2019 6:19 AM
To: [email protected]
Cc: Vishal Verma <[email protected]>; Qi, Fuli/斉 福利 <[email protected]>; Dan Williams <[email protected]>; Adam Borowski <[email protected]>
Subject: [ndctl PATCH] ndctl/monitor: make the daemon exit message 'info' level

The 'ndctl monitor daemon started' message is at an 'info' log level, but the corresponding exit message (if no DIMMs are found for monitoring) was only at a 'debug' level. As a result, on a system without NVDIMMs, the sysadmin might see a 'monitor started' message, but a monitor wouldn't actually be running. Making the exit message the same log level ensures that no confusion arises out of this.

---
 ndctl/monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ndctl/monitor.c +1 -1
index 6829a6b..6e7f038 100644
@@ -646,7 +646,7 @@ int cmd_monitor(int argc, const char **argv, struct
 ndctl_ctx *ctx)
 		goto out;
 
 	if (!mfa.num_dimm) {
-		dbg(&monitor, "no dimms to monitor\n");
+		info(&monitor, "no dimms to monitor, exiting\n");
 		if (!monitor.daemon)
 			rc = -ENXIO;
Quoted 3 lines

goto out;
--
2.20.1

Hi Vishal,

This looks good to me.

Thank you very much.
QI Fuli

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm