| 1 |
Persistent Memory Development Kit |
| 2 |
|
| 3 |
This is src/test/tools/pmemspoil/README. |
| 4 |
|
| 5 |
This directory contains a simple application for corrupting pool files. |
| 6 |
|
| 7 |
This application may be used for testing purposes. It allows one to modify |
| 8 |
every single field in all structures used by Persistent Memory Development Kit. |
| 9 |
|
| 10 |
Usage: |
| 11 |
$ pmemspoil <file> <field>=<value>... |
| 12 |
|
| 13 |
<file> - pool file |
| 14 |
<field> - name of field in structure to modify |
| 15 |
<value> - new value, for numerical fields you can use either decimal or |
| 16 |
hexadecimal format with 0x prefix. |
| 17 |
|
| 18 |
You can specify more than one field to modify at single call. |
| 19 |
|
| 20 |
The format of <field> may contain multiple levels of structure fields and may |
| 21 |
contain index of specified structure if there is more than one in a pool file. |
| 22 |
|
| 23 |
The pmemspoil supports the following structures: |
| 24 |
- pool_hdr - see util.h for details |
| 25 |
- pmemlog - see log.h for details |
| 26 |
- pmemblk - see blk.h for details |
| 27 |
- arena - specify arena index |
| 28 |
- btt_info - see btt_layout.h for details |
| 29 |
- btt_info_backup - the same as btt_info but refers to BTT Info |
| 30 |
backup header |
| 31 |
- btt_flog - see btt_layout.h for details |
| 32 |
- btt_flog_prime - the same as btt_flog but refers to second |
| 33 |
instance of FLOG entry |
| 34 |
- btt_map - BTT Map entries, see btt_layout.h for details |
| 35 |
- bttdevice - analogical to pmemblk but for BTT device |
| 36 |
|
| 37 |
Examples: |
| 38 |
|
| 39 |
In order to change pool_hdr's signature and start offset of pmemlog pool: |
| 40 |
$ pmemspoil /path/to/file pool_hdr.signature=ERROR\ |
| 41 |
pmemlog.start_offset=0x0 |
| 42 |
|
| 43 |
For pmemblk pool file you can modify a signature in BTT Info header of second |
| 44 |
arena using the following command: |
| 45 |
$ pmemspoil /path/to/file "pmemblk.arena(1).btt_info.sig=ERROR" |
| 46 |
|
| 47 |
In order to change BTT Map entry number 20 and 5th flog sequence number in 3rd |
| 48 |
arena: |
| 49 |
$ pmemspoil /path/to/file "pmemblk.arena(3).btt_map(20)=0x0"\ |
| 50 |
"pmemblk.arena(3).btt_flog(5).seq=0xff" |