Skip to contentSkip to conversation

makedumpfile: -v shows if lzo or snappy support enabled or not

PATCH Superseded WANG Chao 2 participants 3 messages Jan 8, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

WANG Chao

author
#0 lore raw

PATCH 1/1 makedumpfile: -v shows if lzo or snappy support enabled or not

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
---
 print_info.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
print_info.c +11 -1
index 90b6cee..242b42c 100644
@@ -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
Signature · 7 lines
1.8.4.2


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw

Hello chao

Quoted 13 lines · WANG Chao

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
Quoted 5 lines

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.

Quoted 30 lines
---
 print_info.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
print_info.c +11 -1
index 90b6cee..242b42c 100644
@@ -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
Signature · 7 lines
Thanks.
Zhang Yanfei

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
author
#2 lore raw
Quoted 16 lines · Zhang Yanfei

Hello chao

Quoted 13 lines · WANG Chao

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
Quoted 8 lines
Quoted 5 lines

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.

Quoted 3 lines

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.

Quoted 3 lines

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

Quoted 31 lines

Thanks.

Quoted 28 lines
---
 print_info.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
print_info.c +11 -1
index 90b6cee..242b42c 100644
@@ -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");
 }
 
Quoted 7 lines
Quoted 2 lines
print_info.c +0 -0
 void
Signature · 2 lines
Thanks.
Zhang Yanfei

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec