Re: [PATCH 2/3] pstore: Add pstore back-end choice method in kconfig

From: 赵振国
Date: Mon Nov 01 2021 - 05:29:57 EST


Dear Kees Cook,

Thank you very much for your reply.

I had tested Kconfig,

1: "Persistent store support" set Y, it will build in kernel ,pstore
device select one device only,default is ram.it can be select block
device
because only one device as backend,so select choice ,it should be reasonable。

2: "Persistent store support" set m. it will build modules,we can
select one or all pstore devices.

-----------------------------------test result as follows:
1.1: build in

<*> Persistent store support // select build in
<*> DEFLATE (ZLIB) compression
< > LZO compression
< > LZ4 compression
< > LZ4HC compression
[ ] 842 compression
[ ] zstd compression
Default pstore compression algorithm (deflate) --->
[*] Log kernel console messages
[*] Log user space messages
<*> Choice pstore device (Log panic/oops to a RAM buffer) --->
// default select ram.you can select block device
[
(X) Log panic/oops to a RAM buffer)
( ) Log panic/oops to a block device
]

defconfig:

CONFIG_PSTORE=y
CONFIG_PSTORE_DEFLATE_COMPRESS=y
# CONFIG_PSTORE_LZO_COMPRESS is not set
# CONFIG_PSTORE_LZ4_COMPRESS is not set
# CONFIG_PSTORE_LZ4HC_COMPRESS is not set
# CONFIG_PSTORE_842_COMPRESS is not set
# CONFIG_PSTORE_ZSTD_COMPRESS is not set
CONFIG_PSTORE_COMPRESS=y
CONFIG_PSTORE_DEFLATE_COMPRESS_DEFAULT=y
CONFIG_PSTORE_COMPRESS_DEFAULT="deflate"
CONFIG_PSTORE_CONSOLE=y
CONFIG_PSTORE_PMSG=y
CONFIG_PSTORE_RAM=y
# CONFIG_PSTORE_BLK is not set


2.1 select "Persistent store support" is M, default pstore is ram.

<M> Persistent store support
<M> DEFLATE (ZLIB) compression
< > LZO compression
< > LZ4 compression
< > LZ4HC compression
[ ] 842 compression
[ ] zstd compression
Default pstore compression algorithm (deflate) --->
[*] Log kernel console messages
[*] Log user space messages
Choice pstore device
<M> Log panic/oops to a RAM buffer // ram device
< > Log panic/oops to a block device

2.2 select "Persistent store support" is M, select block device

<M> Persistent store support
<M> DEFLATE (ZLIB) compression
< > LZO compression
< > LZ4 compression
< > LZ4HC compression
[ ] 842 compression
[ ] zstd compression
Default pstore compression algorithm (deflate) --->
[*] Log kernel console messages
[*] Log user space messages
Choice pstore device
< > Log panic/oops to a RAM buffer
<M> Log panic/oops to a block device
() block device identifier (NEW)
(64) Size in Kbytes of kmsg dump log to store (NEW)
(2) Maximum kmsg dump reason to store (NEW)
(64) Size in Kbytes of pmsg to store (NEW)
(64) Size in Kbytes of console log to store (NEW)

2.3 select "Persistent store support" is M, it can select all pstore device

<M> Persistent store support
<M> DEFLATE (ZLIB) compression
< > LZO compression
< > LZ4 compression
< > LZ4HC compression
[ ] 842 compression
[ ] zstd compression
Default pstore compression algorithm (deflate) --->
[*] Log kernel console messages
[*] Log user space messages
Choice pstore device
<M> Log panic/oops to a RAM buffer // ram set M
<M> Log panic/oops to a block device // block set M
() block device identifier (NEW)
(64) Size in Kbytes of kmsg dump log to store (NEW)
(2) Maximum kmsg dump reason to store (NEW)
(64) Size in Kbytes of pmsg to store (NEW)
(64) Size in Kbytes of console log to store (NEW)

defconfig

-CONFIG_PSTORE=y
-CONFIG_PSTORE_DEFLATE_COMPRESS=y
+CONFIG_PSTORE=m
+CONFIG_PSTORE_DEFLATE_COMPRESS=m
# CONFIG_PSTORE_LZO_COMPRESS is not set
# CONFIG_PSTORE_LZ4_COMPRESS is not set
# CONFIG_PSTORE_LZ4HC_COMPRESS is not set
@@ -5536,8 +5536,14 @@ CONFIG_PSTORE_DEFLATE_COMPRESS_DEFAULT=y
CONFIG_PSTORE_COMPRESS_DEFAULT="deflate"
CONFIG_PSTORE_CONSOLE=y
CONFIG_PSTORE_PMSG=y
-CONFIG_PSTORE_RAM=y
-# CONFIG_PSTORE_BLK is not set
+CONFIG_PSTORE_RAM=m
+CONFIG_PSTORE_BLK=m
+CONFIG_PSTORE_ZONE=m
+CONFIG_PSTORE_BLK_BLKDEV=""
+CONFIG_PSTORE_BLK_KMSG_SIZE=64
+CONFIG_PSTORE_BLK_MAX_REASON=2
+CONFIG_PSTORE_BLK_PMSG_SIZE=64
+CONFIG_PSTORE_BLK_CONSOLE_SIZE=64

Thanks!
振国