Hi, On 2/27/19 11:12 PM, liaoweixiong wrote: > diff --git a/fs/pstore/Kconfig b/fs/pstore/Kconfig > index defcb75..7dfe00b 100644 > --- a/fs/pstore/Kconfig > +++ b/fs/pstore/Kconfig > @@ -160,3 +160,117 @@ config PSTORE_BLK > help > This enables panic and oops message to be logged to a block dev > where it can be read back at some later point. > + > +config PSTORE_BLKOOPS > + tristate "pstore block with oops logger" > + depends on PSTORE_BLK > + help > + This is a sample for pstore block with oops logger. > + > + It CANNOT record panic log as no read/write apis for panic registered. APIs > + > + It CAN record oops log even power failure if > + "PSTORE_BLKOOPS_BLKDEV" on Kconfig or "block-device" on dts or > + "blkdev" on module parameter is valid. > + > + Otherwise, it can only record data to ram buffer, which will be > + dropped when reboot. dropped on reboot. or dropped when rebooting. > + > + NOTE that, there are three ways to set parameters of blkoops and > + prioritize according to configuration flexibility. That is > + Kconfig < device tree < module parameters. It means that the value can > + be overwritten by higher priority settings. > + 1. Kconfig > + It just sets a default value. > + 2. device tree > + It is set on device tree, which will overwrites value from Kconfig, overwrite the value from Kconfig, > + but can also be overwritten by module parameters. > + 3. module parameters > + It is the first priority. Take care of that blkoops will take lower > + priority settings if higher priority one do not set. > + > +config PSTORE_BLKOOPS_DMESG_SIZE > + int "dmesg size in kbytes for blkoops" > + depends on PSTORE_BLKOOPS > + default 64 > + help > + This just sets size of dmesg (dmesg_size) for pstore/blk. The value > + must be a multiple of 4096. > + > + NOTE that, there are three ways to set parameters of blkoops and > + prioritize according to configuration flexibility. That is > + Kconfig < device tree < module parameters. It means that the value can > + be overwritten by higher priority settings. > + 1. Kconfig > + It just sets a default value. > + 2. device tree > + It is set on device tree, which will overwrites value from Kconfig, overwrite the value from Kconfig, > + but can also be overwritten by module parameters. > + 3. module parameters > + It is the first priority. Take care of that blkoops will take lower > + priority settings if higher priority one do not set. > + > +config PSTORE_BLKOOPS_TOTAL_SIZE > + int "total size in kbytes for blkoops" > + depends on PSTORE_BLKOOPS > + default 0 > + help > + The total size in kbytes pstore/blk can use. It must be less than or > + equal to size of block device if @blkdev valid. If @total_size is zero > + with @blkdev, @total_size will be set to equal to size of @blkdev. set equal to size of @blkdev. > + The value must be a multiple of 4096. > + > + NOTE that, there are three ways to set parameters of blkoops and > + prioritize according to configuration flexibility. That is > + Kconfig < device tree < module parameters. It means that the value can > + be overwritten by higher priority settings. > + 1. Kconfig > + It just sets a default value. > + 2. device tree > + It is set on device tree, which will overwrites value from Kconfig, overwrite the value from Kconfig, > + but can also be overwritten by module parameters. > + 3. module parameters > + It is the first priority. Take care of that blkoops will take lower > + priority settings if higher priority one do not set. > + > +config PSTORE_BLKOOPS_BLKDEV > + string "block device for blkoops" > + depends on PSTORE_BLKOOPS > + default "" > + help > + This just sets block device (blkdev) for pstore/blk. Pstore/blk > + will record data to this block device to avoid losing data due to > + power failure. So, If it is not set, pstore/blk will drop all data if > + when reboot. on reboot. > + > + It accpet the following variants: accepts > + 1) <hex_major><hex_minor> device number in hexadecimal represents > + itself no leading 0x, for example b302. > + 2) /dev/<disk_name> represents the device number of disk > + 3) /dev/<disk_name><decimal> represents the device number > + of partition - device number of disk plus the partition number > + 4) /dev/<disk_name>p<decimal> - same as the above, that form is above; this form is > + used when disk name of partitioned disk ends on a digit. ends with a digit. > + 5) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the > + unique id of a partition if the partition table provides it. > + The UUID may be either an EFI/GPT UUID, or refer to an MSDOS > + partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero- > + filled hex representation of the 32-bit "NT disk signature", and PP > + is a zero-filled hex representation of the 1-based partition number. > + 6) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation > + to a partition with a known unique id. > + 7) <major>:<minor> major and minor number of the device separated by > + a colon. > + > + NOTE that, there are three ways to set parameters of blkoops and > + prioritize according to configuration flexibility. That is > + Kconfig < device tree < module parameters. It means that the value can > + be overwritten by higher priority settings. > + 1. Kconfig > + It just sets a default value. > + 2. device tree > + It is set on device tree, which will overwrites value from Kconfig, overwrite the value from Kconfig, > + but can also be overwritten by module parameters. > + 3. module parameters > + It is the first priority. Take care of that blkoops will take lower > + priority settings if higher priority one do not set. -- ~Randy