All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] makedumpfile: -v shows if lzo or snappy support enabled or not
@ 2014-01-08  5:40 WANG Chao
  2014-01-08  5:57 ` Zhang Yanfei
  0 siblings, 1 reply; 4+ messages in thread
From: WANG Chao @ 2014-01-08  5:40 UTC (permalink / raw)
  To: kexec

It would be great to have makedumpfile -v to show if lzo or snappy
support is enabled or not, since --help prints too much and we have to
scroll back three screens to check it out.

Using "+lzo" to indicate lzo is enabled and vice versa "-lzo" for lzo is
disabled. Same for snappy.

For exmaple, If lzo and snappy support are enabled,

    $ ./makedumpfile -v
    makedumpfile: version 1.5.5 (released on 18 Dec 2013)
    +lzo +snappy

If both of them are disabled,

    $ ./makedumpfile -v
    makedumpfile: version 1.5.5 (released on 18 Dec 2013)
    -lzo -snappy

Signed-off-by: WANG Chao <chaowang@redhat.com>
---
 print_info.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/print_info.c b/print_info.c
index 90b6cee..242b42c 100644
--- a/print_info.c
+++ b/print_info.c
@@ -26,7 +26,17 @@ void
 show_version(void)
 {
 	MSG("makedumpfile: version " VERSION " (released on " RELEASE_DATE ")\n");
-	MSG("\n");
+#ifdef USELZO
+	MSG("+lzo ");
+#else
+	MSG("-lzo ");
+#endif
+#ifdef USESNAPPY
+	MSG("+snappy ");
+#else
+	MSG("-snappy ");
+#endif
+	MSG("\n\n");
 }
 
 void
-- 
1.8.4.2


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] makedumpfile: -v shows if lzo or snappy support enabled or not
  2014-01-08  5:40 [PATCH] makedumpfile: -v shows if lzo or snappy support enabled or not WANG Chao
@ 2014-01-08  5:57 ` Zhang Yanfei
  2014-01-08  6:32   ` WANG Chao
  0 siblings, 1 reply; 4+ messages in thread
From: Zhang Yanfei @ 2014-01-08  5:57 UTC (permalink / raw)
  To: WANG Chao, kexec

Hello chao

On 01/08/2014 01:40 PM, WANG Chao wrote:
> It would be great to have makedumpfile -v to show if lzo or snappy
> support is enabled or not, since --help prints too much and we have to
> scroll back three screens to check it out.
> 
> Using "+lzo" to indicate lzo is enabled and vice versa "-lzo" for lzo is
> disabled. Same for snappy.
> 
> For exmaple, If lzo and snappy support are enabled,
> 
>     $ ./makedumpfile -v
>     makedumpfile: version 1.5.5 (released on 18 Dec 2013)
>     +lzo +snappy
> 
> If both of them are disabled,
> 
>     $ ./makedumpfile -v
>     makedumpfile: version 1.5.5 (released on 18 Dec 2013)
>     -lzo -snappy

This is weird... we may even think we have lzo/snappy enabled
since an option is always specified with '-'.

My idea is to have "with lzo/snappy enabled" directly appended
when lzo/snappy enabled.

And is it ok to add such info to the version ? I don't know.
kumagai may give the answer.

Thanks.

> 
> Signed-off-by: WANG Chao <chaowang@redhat.com>
> ---
>  print_info.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/print_info.c b/print_info.c
> index 90b6cee..242b42c 100644
> --- a/print_info.c
> +++ b/print_info.c
> @@ -26,7 +26,17 @@ void
>  show_version(void)
>  {
>  	MSG("makedumpfile: version " VERSION " (released on " RELEASE_DATE ")\n");
> -	MSG("\n");
> +#ifdef USELZO
> +	MSG("+lzo ");
> +#else
> +	MSG("-lzo ");
> +#endif
> +#ifdef USESNAPPY
> +	MSG("+snappy ");
> +#else
> +	MSG("-snappy ");
> +#endif
> +	MSG("\n\n");
>  }
>  
>  void
> 


-- 
Thanks.
Zhang Yanfei

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] makedumpfile: -v shows if lzo or snappy support enabled or not
  2014-01-08  5:57 ` Zhang Yanfei
@ 2014-01-08  6:32   ` WANG Chao
  0 siblings, 0 replies; 4+ messages in thread
From: WANG Chao @ 2014-01-08  6:32 UTC (permalink / raw)
  To: Zhang Yanfei; +Cc: kexec, Atsushi Kumagai

On 01/08/14 at 01:57pm, Zhang Yanfei wrote:
> Hello chao
> 
> On 01/08/2014 01:40 PM, WANG Chao wrote:
> > It would be great to have makedumpfile -v to show if lzo or snappy
> > support is enabled or not, since --help prints too much and we have to
> > scroll back three screens to check it out.
> > 
> > Using "+lzo" to indicate lzo is enabled and vice versa "-lzo" for lzo is
> > disabled. Same for snappy.
> > 
> > For exmaple, If lzo and snappy support are enabled,
> > 
> >     $ ./makedumpfile -v
> >     makedumpfile: version 1.5.5 (released on 18 Dec 2013)
> >     +lzo +snappy
> > 
> > If both of them are disabled,
> > 
> >     $ ./makedumpfile -v
> >     makedumpfile: version 1.5.5 (released on 18 Dec 2013)
> >     -lzo -snappy
> 
> This is weird... we may even think we have lzo/snappy enabled
> since an option is always specified with '-'.

I took this idea from `vim --version`. But it seems like vim has too
many features that there's always +xxx out there to distinguish them
from -xxx. I think you make a good point.

> 
> My idea is to have "with lzo/snappy enabled" directly appended
> when lzo/snappy enabled.

That works for me either as long as -v has the information about
lzo/snappy is enabled or not. But to simplify the code, I prefer
something like this:
" lzo    enabled
  snappy enabled"
and also display "lzo disabled" explicitly.

> 
> And is it ok to add such info to the version ? I don't know.
> kumagai may give the answer.

Yeah, let's wait.

Thanks
WANG Chao

> 
> Thanks.
> 
> > 
> > Signed-off-by: WANG Chao <chaowang@redhat.com>
> > ---
> >  print_info.c | 12 +++++++++++-
> >  1 file changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/print_info.c b/print_info.c
> > index 90b6cee..242b42c 100644
> > --- a/print_info.c
> > +++ b/print_info.c
> > @@ -26,7 +26,17 @@ void
> >  show_version(void)
> >  {
> >  	MSG("makedumpfile: version " VERSION " (released on " RELEASE_DATE ")\n");
> > -	MSG("\n");
> > +#ifdef USELZO
> > +	MSG("+lzo ");
> > +#else
> > +	MSG("-lzo ");
> > +#endif
> > +#ifdef USESNAPPY
> > +	MSG("+snappy ");
> > +#else
> > +	MSG("-snappy ");
> > +#endif
> > +	MSG("\n\n");
> >  }
> >  
> >  void
> > 
> 
> 
> -- 
> Thanks.
> Zhang Yanfei

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] makedumpfile: -v shows if lzo or snappy support enabled or not
@ 2014-01-09  1:24 Atsushi Kumagai
  0 siblings, 0 replies; 4+ messages in thread
From: Atsushi Kumagai @ 2014-01-09  1:24 UTC (permalink / raw)
  To: WANG Chao, Zhang Yanfei; +Cc: kexec@lists.infradead.org

On 2014/01/08 15:32:51, kexec <kexec-bounces@lists.infradead.org> wrote:
> On 01/08/14 at 01:57pm, Zhang Yanfei wrote:
> > Hello chao
> >
> > On 01/08/2014 01:40 PM, WANG Chao wrote:
> > > It would be great to have makedumpfile -v to show if lzo or snappy
> > > support is enabled or not, since --help prints too much and we have to
> > > scroll back three screens to check it out.
> > >
> > > Using "+lzo" to indicate lzo is enabled and vice versa "-lzo" for lzo is
> > > disabled. Same for snappy.
> > >
> > > For exmaple, If lzo and snappy support are enabled,
> > >
> > >     $ ./makedumpfile -v
> > >     makedumpfile: version 1.5.5 (released on 18 Dec 2013)
> > >     +lzo +snappy
> > >
> > > If both of them are disabled,
> > >
> > >     $ ./makedumpfile -v
> > >     makedumpfile: version 1.5.5 (released on 18 Dec 2013)
> > >     -lzo -snappy
> >
> > This is weird... we may even think we have lzo/snappy enabled
> > since an option is always specified with '-'.
>
> I took this idea from `vim --version`. But it seems like vim has too
> many features that there's always +xxx out there to distinguish them
> from -xxx. I think you make a good point.
>
> >
> > My idea is to have "with lzo/snappy enabled" directly appended
> > when lzo/snappy enabled.
>
> That works for me either as long as -v has the information about
> lzo/snappy is enabled or not. But to simplify the code, I prefer
> something like this:
> " lzo    enabled
>   snappy enabled"
> and also display "lzo disabled" explicitly.

I agree with this idea.

> >
> > And is it ok to add such info to the version ? I don't know.
> > kumagai may give the answer.
>
> Yeah, let's wait.

I think it's good, I'm tired of that scroll back :-(
Could you post a v2 patch ?


Thanks
Atsushi Kumagai

>
> Thanks
> WANG Chao
>
> >
> > Thanks.
> >
> > >
> > > Signed-off-by: WANG Chao <chaowang@redhat.com>
> > > ---
> > >  print_info.c | 12 +++++++++++-
> > >  1 file changed, 11 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/print_info.c b/print_info.c
> > > index 90b6cee..242b42c 100644
> > > --- a/print_info.c
> > > +++ b/print_info.c
> > > @@ -26,7 +26,17 @@ void
> > >  show_version(void)
> > >  {
> > >   MSG("makedumpfile: version " VERSION " (released on " RELEASE_DATE ")\n");
> > > - MSG("\n");
> > > +#ifdef USELZO
> > > + MSG("+lzo ");
> > > +#else
> > > + MSG("-lzo ");
> > > +#endif
> > > +#ifdef USESNAPPY
> > > + MSG("+snappy ");
> > > +#else
> > > + MSG("-snappy ");
> > > +#endif
> > > + MSG("\n\n");
> > >  }
> > >
> > >  void
> > >
> >
> >
> > --
> > Thanks.
> > Zhang Yanfei
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

end of thread, other threads:[~2014-01-09  1:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08  5:40 [PATCH] makedumpfile: -v shows if lzo or snappy support enabled or not WANG Chao
2014-01-08  5:57 ` Zhang Yanfei
2014-01-08  6:32   ` WANG Chao
  -- strict thread matches above, loose matches on Subject: below --
2014-01-09  1:24 Atsushi Kumagai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.