224
in /lib64/libc.so.6!__libc_start_main at:
line> - 0x223D3
in /data/listing_12-16!_start at: - 0x534
is not flushed before
memory is unmapped
in /data/listing_12-16!main at listing_12-16.c:54 - 0x699
in /lib64/libc.so.6!__libc_start_main at:
line> - 0x223D3
in /data/listing_12-16!_start at: - 0x534
Analysis complete. 2 diagnostic(s) reported.
The output is very verbose, but it is easy to follow. We get two missing cache flushes
(diagnostics 1 and 2) corresponding to lines 51 and 52 of listing_12-16.c. We do these
writes to the locations in the mapped persistent memory pointed by variables flag
and data. The first diagnostic says that the first memory store is not flushed before the
second store, while, at the same time, there is a load dependency of the first store to the
second. This is exactly what we intended.
The second diagnostic says that the second store (to the flag) itself is never actually
flushed before ending. Even if we flush the first store correctly before we write the flag,
we must still flush the flag to make sure the dependency works.
To open the results in the Intel Inspector GUI, you can use the -insp option when
generating the report, for example:
$ pmeminsp rp -insp -- listing_12-16 listing_12-17
This generates a directory called r000pmem inside the analysis directory
(.pmeminspdata by default). Launch the GUI running inspxe-gui and open the result
file by going to File ➤ Open ➤ Result and selecting the file r000pmem/r000pmem.inspxe.
You should see something similar to what is shown in Figure 12-3.
Chapter 12 Debugging persistent MeMory appliCations
in /lib64/libc.so.6!__libc_start_main at
in /data/listing_12-16!_start at
is not flushed before
memory is unmapped
in /data/listing_12-16!main at listing_12-16.c:54 - 0x699
in /lib64/libc.so.6!__libc_start_main at
in /data/listing_12-16!_start at
Analysis complete. 2 diagnostic(s) reported.
The output is very verbose, but it is easy to follow. We get two missing cache flushes
(diagnostics 1 and 2) corresponding to lines 51 and 52 of listing_12-16.c. We do these
writes to the locations in the mapped persistent memory pointed by variables flag
and data. The first diagnostic says that the first memory store is not flushed before the
second store, while, at the same time, there is a load dependency of the first store to the
second. This is exactly what we intended.
The second diagnostic says that the second store (to the flag) itself is never actually
flushed before ending. Even if we flush the first store correctly before we write the flag,
we must still flush the flag to make sure the dependency works.
To open the results in the Intel Inspector GUI, you can use the -insp option when
generating the report, for example:
$ pmeminsp rp -insp -- listing_12-16 listing_12-17
This generates a directory called r000pmem inside the analysis directory
(.pmeminspdata by default). Launch the GUI running inspxe-gui and open the result
file by going to File ➤ Open ➤ Result and selecting the file r000pmem/r000pmem.inspxe.
You should see something similar to what is shown in Figure 12-3.
Chapter 12 Debugging persistent MeMory appliCations
