258
Listing 12-43. First, a pool is created for Listing 12-38. Then, pmemcheck is run
to get a detailed log of all the stores and flushes issued by Listing 12-38. Finally,
pmreorder is run with engine ReorderFull
$ pmempool create obj --size=100M --layout=RECORDS /mnt/pmem/file
$ valgrind --tool=pmemcheck -q --log-stores=yes --log-storesstacktraces=yes --log-stores-stacktraces-depth=2 --print-summary=yes
--log-file=store.log ./listing_12-38
$ pmreorder -l store.log -o output_file.log -x PMREORDER_
TAG=NoReorderNoCheck -r ReorderFull -c prog -p ./listing_12-38
The meaning of each pmreorder option is as follows:
• -l store_log.log is the input file generated by pmemcheck with all
the stores and flushes issued by the application.
• -o output_file.log is the output file with the out-of-order analysis
results.
• -x PMREORDER_TAG=NoReorderNoCheck assigns the engine
NoReorderNoCheck to the code enclosed by the tag PMREORDER_TAG
(see lines 66-87 from Listing 12-38). This is done to focus the analysis
on the loop only (lines 89-105 from Listing 12-38).
• -r ReorderFull sets the initial reorder engine. In our case, ReorderFull.
• -c prog is the consistency checker type. It can be prog (program) or
lib (library).
• -p ./checker is the consistency checker.
Opening the generated file output_file.log, you should see entries similar to those
in Listing 12-44 that highlight detected inconsistencies and problems within the code.
Listing 12-44. Content from “output_file.log” generated by pmreorder showing a
detected inconsistency during the out-of-order analysis
WARNING:pmreorder:File /mnt/pmem/file inconsistent
WARNING:pmreorder:Call trace:
Store [0]:
by 0x401D0C: main (listing_12-38.cpp:91)
Chapter 12 Debugging persistent MeMory appliCations
Listing 12-43. First, a pool is created for Listing 12-38. Then, pmemcheck is run
to get a detailed log of all the stores and flushes issued by Listing 12-38. Finally,
pmreorder is run with engine ReorderFull
$ pmempool create obj --size=100M --layout=RECORDS /mnt/pmem/file
$ valgrind --tool=pmemcheck -q --log-stores=yes --log-storesstacktraces=yes --log-stores-stacktraces-depth=2 --print-summary=yes
--log-file=store.log ./listing_12-38
$ pmreorder -l store.log -o output_file.log -x PMREORDER_
TAG=NoReorderNoCheck -r ReorderFull -c prog -p ./listing_12-38
The meaning of each pmreorder option is as follows:
• -l store_log.log is the input file generated by pmemcheck with all
the stores and flushes issued by the application.
• -o output_file.log is the output file with the out-of-order analysis
results.
• -x PMREORDER_TAG=NoReorderNoCheck assigns the engine
NoReorderNoCheck to the code enclosed by the tag PMREORDER_TAG
(see lines 66-87 from Listing 12-38). This is done to focus the analysis
on the loop only (lines 89-105 from Listing 12-38).
• -r ReorderFull sets the initial reorder engine. In our case, ReorderFull.
• -c prog is the consistency checker type. It can be prog (program) or
lib (library).
• -p ./checker is the consistency checker.
Opening the generated file output_file.log, you should see entries similar to those
in Listing 12-44 that highlight detected inconsistencies and problems within the code.
Listing 12-44. Content from “output_file.log” generated by pmreorder showing a
detected inconsistency during the out-of-order analysis
WARNING:pmreorder:File /mnt/pmem/file inconsistent
WARNING:pmreorder:Call trace:
Store [0]:
by 0x401D0C: main (listing_12-38.cpp:91)
Chapter 12 Debugging persistent MeMory appliCations
