256
• --print-summary=yes prints a summary on program exit. Why not?
• --log-file=store_log.log logs everything to store_log.log.
The pmreorder tool works with the concept of “engines. ” For example, the ReorderFull
engine checks consistency for all the possible combinations of reorders of stores and
flushes. This engine can be extremely slow for some programs, so you can use other
engines such as ReorderPartial or NoReorderDoCheck. For more information, refer to the
pmreorder page, which has links to the man pages (https://pmem.io/pmdk/pmreorder/).
Before we run pmreorder, we need a program that can walk the list of records
contained within the memory pool and return 0 when the data structure is consistent, or
1 otherwise. This program is similar to the reader shown in Listing 12-42.
Listing 12-42. Checking the consistency of the data structure written in
Listing 12-38
33 #include
34 #include
35 #include
36
37 using namespace std;
38 namespace pobj = pmem::obj;
39
40 struct header_t {
41
uint32_t counter;
42
uint8_t reserved[60];
43 };
44 struct record_t {
45
char name[63];
46
char valid;
47 };
48 struct root {
49
pobj::persistent_ptr header;
50
pobj::persistent_ptr records;
51 };
52
Chapter 12 Debugging persistent MeMory appliCations
• --print-summary=yes prints a summary on program exit. Why not?
• --log-file=store_log.log logs everything to store_log.log.
The pmreorder tool works with the concept of “engines. ” For example, the ReorderFull
engine checks consistency for all the possible combinations of reorders of stores and
flushes. This engine can be extremely slow for some programs, so you can use other
engines such as ReorderPartial or NoReorderDoCheck. For more information, refer to the
pmreorder page, which has links to the man pages (https://pmem.io/pmdk/pmreorder/).
Before we run pmreorder, we need a program that can walk the list of records
contained within the memory pool and return 0 when the data structure is consistent, or
1 otherwise. This program is similar to the reader shown in Listing 12-42.
Listing 12-42. Checking the consistency of the data structure written in
Listing 12-38
33 #include
34 #include
35 #include
36
37 using namespace std;
38 namespace pobj = pmem::obj;
39
40 struct header_t {
41
uint32_t counter;
42
uint8_t reserved[60];
43 };
44 struct record_t {
45
char name[63];
46
char valid;
47 };
48 struct root {
49
pobj::persistent_ptr
50
pobj::persistent_ptr
51 };
52
Chapter 12 Debugging persistent MeMory appliCations
