crash/0027-zram-Add-warning-messa...

38 lines
1.2 KiB
Diff

From dc2cb5f9256ec2bc118cb34c610e2c62c20aab6e Mon Sep 17 00:00:00 2001
From: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
Date: Fri, 25 Dec 2020 15:48:49 +0900
Subject: [PATCH 08/11] zram: Add warning message when crash is built without
lzo library
Now there is no warning message when we encounter zram pages using
crash utility that is built without lzo library. We need to provide
any hint to users what is going on. Let's add a warning message to
indicate the hint as:
crash> rd -u 0x7f520626e000
WARNING: zram decompress error: this executable needs to be built with lzo library
rd: invalid user virtual address: 7f520626e000 type: "64-bit UVADDR"
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
---
diskdump.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/diskdump.c b/diskdump.c
index 17094f126f25..a4ca38f6c732 100644
--- a/diskdump.c
+++ b/diskdump.c
@@ -2780,6 +2780,9 @@ try_zram_decompress(ulonglong pte_val, unsigned char *buf, ulong len, ulonglong
}
decompressor = (void *)lzo1x_decompress_safe;
#else
+ error(WARNING,
+ "zram decompress error: this executable needs to be built"
+ " with lzo library\n");
return 0;
#endif
} else { /* todo: support more compressor */
--
2.29.2