245
58
data = &(ptr[1]);
59
flag = &(ptr[0]);
60
61
*data = 1234;
62
flush((void *) data, sizeof(int));
63
*flag = 1;
64
flush((void *) flag, sizeof(int));
65
flush((void *) flag, sizeof(int)); // extra flush
66
67
munmap(ptr, 2 * sizeof(int));
68
return 0;
69 }
Listing 12-36 uses the same reader program from Listing 12-15 to show the analysis
from Persistence Inspector. As before, we first collect data from the writer program,
then the reader program, and finally run the report to identify any issues.
Listing 12-36. Running Intel Inspector – Persistence Inspector with Listing 12-35
(writer) and Listing 12-15 (reader)
$ pmeminsp cb -pmem-file /mnt/pmem/file -- ./listing_12-35
++ Analysis starts
++ Analysis completes
++ Data is stored in folder "/data/.pmeminspdata/data/listing_12-35"
$ pmeminsp ca -pmem-file /mnt/pmem/file -- ./listing_12-15
++ Analysis starts
data = 1234
++ Analysis completes
++ Data is stored in folder "/data/.pmeminspdata/data/listing_12-15"
$ pmeminsp rp -- ./listing_12-35 ./listing_12-15
#=============================================================
# Diagnostic # 1: Redundant cache flush
#------------------Cache flush
Chapter 12 Debugging persistent MeMory appliCations
Précédent

- 269/457

Suivant