nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message
@ 2018-10-05  0:00 Vishal Verma
  2018-10-05  0:00 ` [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found Vishal Verma
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Vishal Verma @ 2018-10-05  0:00 UTC (permalink / raw)
  To: linux-nvdimm; +Cc: Andreas Hasenack

The above message was printed as an error, but it is just an
informational message. Change it to dbg().

Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 ndctl/monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ndctl/monitor.c b/ndctl/monitor.c
index d29e378..b44f946 100644
--- a/ndctl/monitor.c
+++ b/ndctl/monitor.c
@@ -660,7 +660,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
 			err((struct ndctl_ctx *)ctx, "daemon start failed\n");
 			goto out;
 		}
-		err((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
+		dbg((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
 	}
 
 	if (parse_monitor_event(&monitor, (struct ndctl_ctx *)ctx))
-- 
2.17.1

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found
  2018-10-05  0:00 [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message Vishal Verma
@ 2018-10-05  0:00 ` Vishal Verma
  2018-10-05  0:05   ` Williams, Dan J
  2018-10-05  5:15   ` Qi, Fuli
  2018-10-05  0:04 ` [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message Williams, Dan J
  2018-10-05  4:08 ` Yasunori Goto
  2 siblings, 2 replies; 9+ messages in thread
From: Vishal Verma @ 2018-10-05  0:00 UTC (permalink / raw)
  To: linux-nvdimm; +Cc: Andreas Hasenack

When we are running as a daemon, it is preferred to exit successfully
when no DIMMs are found. When running in the foreground, retain an error
return so that the user can be notified that nothing was found to
monitor.

In the longer term, replace this with a libudev uevent monitor that will
look for DIMM addition/removal events, and update the running monitor(s)
if the DIMMs match the active filter spec.

Link: https://bugs.launchpad.net/ubuntu/+source/ndctl/+bug/1781268
Reported-by: Andreas Hasenack <andreas@canonical.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 ndctl/monitor.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ndctl/monitor.c b/ndctl/monitor.c
index b44f946..7bf2ba7 100644
--- a/ndctl/monitor.c
+++ b/ndctl/monitor.c
@@ -681,8 +681,9 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
 		goto out;
 
 	if (!mfa.num_dimm) {
-		err((struct ndctl_ctx *)ctx, "no dimms to monitor\n");
-		rc = -ENXIO;
+		dbg((struct ndctl_ctx *)ctx, "no dimms to monitor\n");
+		if (!monitor.daemon)
+			rc = -ENXIO;
 		goto out;
 	}
 
-- 
2.17.1

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message
  2018-10-05  0:00 [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message Vishal Verma
  2018-10-05  0:00 ` [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found Vishal Verma
@ 2018-10-05  0:04 ` Williams, Dan J
  2018-10-05  4:08 ` Yasunori Goto
  2 siblings, 0 replies; 9+ messages in thread
From: Williams, Dan J @ 2018-10-05  0:04 UTC (permalink / raw)
  To: linux-nvdimm, Verma, Vishal L; +Cc: andreas

On Thu, 2018-10-04 at 18:00 -0600, Vishal Verma wrote:
> The above message was printed as an error, but it is just an
> informational message. Change it to dbg().
> 
> Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
> Cc: Dan Williams <dan.j.williams@intel.com>

Reviewed-by: Dan Williams <dan.j.williams@intel.com>

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found
  2018-10-05  0:00 ` [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found Vishal Verma
@ 2018-10-05  0:05   ` Williams, Dan J
  2018-10-05  5:15   ` Qi, Fuli
  1 sibling, 0 replies; 9+ messages in thread
From: Williams, Dan J @ 2018-10-05  0:05 UTC (permalink / raw)
  To: linux-nvdimm, Verma, Vishal L; +Cc: andreas

On Thu, 2018-10-04 at 18:00 -0600, Vishal Verma wrote:
> When we are running as a daemon, it is preferred to exit successfully
> when no DIMMs are found. When running in the foreground, retain an
> error
> return so that the user can be notified that nothing was found to
> monitor.
> 
> In the longer term, replace this with a libudev uevent monitor that
> will
> look for DIMM addition/removal events, and update the running
> monitor(s)
> if the DIMMs match the active filter spec.
> 
> Link: https://bugs.launchpad.net/ubuntu/+source/ndctl/+bug/1781268
> Reported-by: Andreas Hasenack <andreas@canonical.com>
> Cc: Dan Williams <dan.j.williams@intel.com>

Looks good to me, if no one is sticking around to reap the error might
as well claim success.

Reviewed-by: Dan Williams <dan.j.williams@intel.com>

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message
  2018-10-05  0:00 [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message Vishal Verma
  2018-10-05  0:00 ` [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found Vishal Verma
  2018-10-05  0:04 ` [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message Williams, Dan J
@ 2018-10-05  4:08 ` Yasunori Goto
  2018-10-05  4:23   ` Dan Williams
  2 siblings, 1 reply; 9+ messages in thread
From: Yasunori Goto @ 2018-10-05  4:08 UTC (permalink / raw)
  To: Vishal Verma; +Cc: Andreas Hasenack, linux-nvdimm

Hi, Vishal-san,

> The above message was printed as an error, but it is just an
> informational message. Change it to dbg().

Hmmmmmmm.

When I was a engineer for trouble-shooting of customer's Linux system,
the starting time and the ending time of any daemon was very helpful
for investigating their trouble.

So, I think it is not only for developer, but also it is essential for
trouble-shooter for custmer support. 
(It may be also same with system operator)


> 
> Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
>  ndctl/monitor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ndctl/monitor.c b/ndctl/monitor.c
> index d29e378..b44f946 100644
> --- a/ndctl/monitor.c
> +++ b/ndctl/monitor.c
> @@ -660,7 +660,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
>  			err((struct ndctl_ctx *)ctx, "daemon start failed\n");
>  			goto out;
>  		}
> -		err((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
> +		dbg((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");

Though I agree its message is not "error" certainly,
I would like to keep it as normal status level message.

Thanks,
---
Yasunori Goto



_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message
  2018-10-05  4:08 ` Yasunori Goto
@ 2018-10-05  4:23   ` Dan Williams
  2018-10-05  4:59     ` Qi, Fuli
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Williams @ 2018-10-05  4:23 UTC (permalink / raw)
  To: Yasunori Goto; +Cc: andreas, linux-nvdimm

On Thu, Oct 4, 2018 at 9:09 PM Yasunori Goto <y-goto@jp.fujitsu.com> wrote:
>
> Hi, Vishal-san,
>
> > The above message was printed as an error, but it is just an
> > informational message. Change it to dbg().
>
> Hmmmmmmm.
>
> When I was a engineer for trouble-shooting of customer's Linux system,
> the starting time and the ending time of any daemon was very helpful
> for investigating their trouble.
>
> So, I think it is not only for developer, but also it is essential for
> trouble-shooter for custmer support.
> (It may be also same with system operator)
>
>
> >
> > Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> > ---
> >  ndctl/monitor.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/ndctl/monitor.c b/ndctl/monitor.c
> > index d29e378..b44f946 100644
> > --- a/ndctl/monitor.c
> > +++ b/ndctl/monitor.c
> > @@ -660,7 +660,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
> >                       err((struct ndctl_ctx *)ctx, "daemon start failed\n");
> >                       goto out;
> >               }
> > -             err((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
> > +             dbg((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
>
> Though I agree its message is not "error" certainly,
> I would like to keep it as normal status level message.
>

Sounds good to me.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* RE: [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message
  2018-10-05  4:23   ` Dan Williams
@ 2018-10-05  4:59     ` Qi, Fuli
       [not found]       ` <4adb62046776c34d28172a94aa95157774e41644.camel@intel.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Qi, Fuli @ 2018-10-05  4:59 UTC (permalink / raw)
  To: 'Dan Williams', Gotou, Yasunori, 'Vishal Verma'
  Cc: andreas, linux-nvdimm

> -----Original Message-----
> From: Linux-nvdimm [mailto:linux-nvdimm-bounces@lists.01.org] On Behalf Of Dan
> Williams
> Sent: Friday, October 5, 2018 1:24 PM
> To: Gotou, Yasunori/五島 康文 <y-goto@jp.fujitsu.com>
> Cc: andreas@canonical.com; linux-nvdimm <linux-nvdimm@lists.01.org>
> Subject: Re: [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon
> started" message
> 
> On Thu, Oct 4, 2018 at 9:09 PM Yasunori Goto <y-goto@jp.fujitsu.com> wrote:
> >
> > Hi, Vishal-san,
> >
> > > The above message was printed as an error, but it is just an
> > > informational message. Change it to dbg().
> >
> > Hmmmmmmm.
> >
> > When I was a engineer for trouble-shooting of customer's Linux system,
> > the starting time and the ending time of any daemon was very helpful
> > for investigating their trouble.
> >
> > So, I think it is not only for developer, but also it is essential for
> > trouble-shooter for custmer support.
> > (It may be also same with system operator)
> >
> >
> > >
> > > Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
> > > Cc: Dan Williams <dan.j.williams@intel.com>
> > > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> > > ---
> > >  ndctl/monitor.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/ndctl/monitor.c b/ndctl/monitor.c index
> > > d29e378..b44f946 100644
> > > --- a/ndctl/monitor.c
> > > +++ b/ndctl/monitor.c
> > > @@ -660,7 +660,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
> > >                       err((struct ndctl_ctx *)ctx, "daemon start failed\n");
> > >                       goto out;
> > >               }
> > > -             err((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
> > > +             dbg((struct ndctl_ctx *)ctx, "ndctl monitor daemon
> > > + started\n");
> >
> > Though I agree its message is not "error" certainly, I would like to
> > keep it as normal status level message.
> >
> 
> Sounds good to me.

In my original idea, I just wanted to log the "daemon started" message.
After thinking more about it, I agree that the message is not at "error" level.
However, considering this message will be helpful for some users like system operators,
how about changing this message level to "info" and meanwhile changing the default log level to "LOG_INFO" as following?

diff --git a/ndctl/monitor.c b/ndctl/monitor.c
index d29e378..10866b6 100644
--- a/ndctl/monitor.c
+++ b/ndctl/monitor.c
@@ -628,7 +628,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
        if (monitor.verbose)
                ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_DEBUG);
        else
-               ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_NOTICE);
+               ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_INFO);

        rc = read_config_file((struct ndctl_ctx *)ctx, &monitor, &param);
        if (rc)
@@ -657,7 +657,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
                if (!monitor.log || strncmp(monitor.log, "./", 2) == 0)
                        ndctl_set_log_fn((struct ndctl_ctx *)ctx, log_syslog);
                if (daemon(0, 0) != 0) {
-                       err((struct ndctl_ctx *)ctx, "daemon start failed\n");
+                       info((struct ndctl_ctx *)ctx, "daemon start failed\n");
                        goto out;
                }
                err((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");

Thank you very much,
QI Fuli
> _______________________________________________
> Linux-nvdimm mailing list
> Linux-nvdimm@lists.01.org
> https://lists.01.org/mailman/listinfo/linux-nvdimm


_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* RE: [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found
  2018-10-05  0:00 ` [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found Vishal Verma
  2018-10-05  0:05   ` Williams, Dan J
@ 2018-10-05  5:15   ` Qi, Fuli
  1 sibling, 0 replies; 9+ messages in thread
From: Qi, Fuli @ 2018-10-05  5:15 UTC (permalink / raw)
  To: 'Vishal Verma', linux-nvdimm; +Cc: Andreas Hasenack

> -----Original Message-----
> From: Vishal Verma [mailto:vishal.l.verma@intel.com]
> Sent: Friday, October 5, 2018 9:01 AM
> To: linux-nvdimm@lists.01.org
> Cc: Qi, Fuli/斉 福利 <qi.fuli@jp.fujitsu.com>; Andreas Hasenack
> <andreas@canonical.com>; Vishal Verma <vishal.l.verma@intel.com>; Dan
> Williams <dan.j.williams@intel.com>
> Subject: [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no
> DIMMs are found
> 
> When we are running as a daemon, it is preferred to exit successfully when no DIMMs
> are found. When running in the foreground, retain an error return so that the user can
> be notified that nothing was found to monitor.
> 
> In the longer term, replace this with a libudev uevent monitor that will look for DIMM
> addition/removal events, and update the running monitor(s) if the DIMMs match the
> active filter spec.
> 
> Link: https://bugs.launchpad.net/ubuntu/+source/ndctl/+bug/1781268
> Reported-by: Andreas Hasenack <andreas@canonical.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
>  ndctl/monitor.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/ndctl/monitor.c b/ndctl/monitor.c index b44f946..7bf2ba7 100644
> --- a/ndctl/monitor.c
> +++ b/ndctl/monitor.c
> @@ -681,8 +681,9 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
>  		goto out;
> 
>  	if (!mfa.num_dimm) {
> -		err((struct ndctl_ctx *)ctx, "no dimms to monitor\n");
> -		rc = -ENXIO;
> +		dbg((struct ndctl_ctx *)ctx, "no dimms to monitor\n");
> +		if (!monitor.daemon)
> +			rc = -ENXIO;
>  		goto out;
>  	}
> 
> --
> 2.17.1
> 

Looks good to me.

Thank you very much,
QI Fuli

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* RE: [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message
       [not found]       ` <4adb62046776c34d28172a94aa95157774e41644.camel@intel.com>
@ 2018-10-05  6:15         ` Qi, Fuli
  0 siblings, 0 replies; 9+ messages in thread
From: Qi, Fuli @ 2018-10-05  6:15 UTC (permalink / raw)
  To: 'Verma, Vishal L', Williams, Dan J, Gotou, Yasunori
  Cc: andreas, linux-nvdimm

> > > >
> > >
> > > Sounds good to me.
> >
> > In my original idea, I just wanted to log the "daemon started" message.
> > After thinking more about it, I agree that the message is not at "error" level.
> > However, considering this message will be helpful for some users like system
> operators,
> > how about changing this message level to "info" and meanwhile changing the
> default log level to "LOG_INFO" as following?
> >
> > diff --git a/ndctl/monitor.c b/ndctl/monitor.c
> > index d29e378..10866b6 100644
> > --- a/ndctl/monitor.c
> > +++ b/ndctl/monitor.c
> > @@ -628,7 +628,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
> >         if (monitor.verbose)
> >                 ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_DEBUG);
> >         else
> > -               ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_NOTICE);
> > +               ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_INFO);
> >
> >         rc = read_config_file((struct ndctl_ctx *)ctx, &monitor, &param);
> >         if (rc)
> > @@ -657,7 +657,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
> >                 if (!monitor.log || strncmp(monitor.log, "./", 2) == 0)
> >                         ndctl_set_log_fn((struct ndctl_ctx *)ctx, log_syslog);
> >                 if (daemon(0, 0) != 0) {
> > -                       err((struct ndctl_ctx *)ctx, "daemon start failed\n");
> > +                       info((struct ndctl_ctx *)ctx, "daemon start failed\n");
> >                         goto out;
> >                 }
> >                 err((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
> 
> Yes, this looks good to me. Will you send a proper patch for this, and I
> can replace my patch with yours.
> 
> Thanks,
> 	-Vishal
> 

Ok, I will send a patch.

> >
> > Thank you very much,
> > QI Fuli
> > > _______________________________________________
> > > Linux-nvdimm mailing list
> > > Linux-nvdimm@lists.01.org
> > > https://lists.01.org/mailman/listinfo/linux-nvdimm
> >
> >
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

end of thread, other threads:[~2018-10-05  6:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-05  0:00 [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message Vishal Verma
2018-10-05  0:00 ` [ndctl PATCH 2/2] ndctl, monitor: in daemon mode, exit successfully if no DIMMs are found Vishal Verma
2018-10-05  0:05   ` Williams, Dan J
2018-10-05  5:15   ` Qi, Fuli
2018-10-05  0:04 ` [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon started" message Williams, Dan J
2018-10-05  4:08 ` Yasunori Goto
2018-10-05  4:23   ` Dan Williams
2018-10-05  4:59     ` Qi, Fuli
     [not found]       ` <4adb62046776c34d28172a94aa95157774e41644.camel@intel.com>
2018-10-05  6:15         ` Qi, Fuli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).