231
$ pmeminsp rp -- ./listing_12-21
#=============================================================
# Diagnostic # 1: Store without undo log
#------------------Memory store
of size 4 at address 0x7FAA84DC0554 (offset 0x3C0554 in /mnt/pmem/pool)
in /data/listing_12-21!main at listing_12-21.c:60 - 0xC2D
in /lib64/libc.so.6!__libc_start_main at : line> - 0x223D3
in /data/listing_12-21!_start at : - 0x954
is not undo logged in
transaction
in /data/listing_12-21!main at listing_12-21.c:52 - 0xB67
in /lib64/libc.so.6!__libc_start_main at : line> - 0x223D3
in /data/listing_12-21!_start at : - 0x954
Analysis complete. 1 diagnostic(s) reported.
We do not perform an after-unfortunate-event phase analysis here because we are
only concerned about transactions.
We can fix the problem reported in Listing 12-23 by adding the whole root object to
the transaction using TX_ADD(root), as shown on line 53 in Listing 12-24.
Listing 12-24. Example of adding an object and writing it within a transaction
32 #include
33
34 struct my_root {
35
int value;
36
int is_odd;
37 };
38
39 POBJ_LAYOUT_BEGIN(example);
40 POBJ_LAYOUT_ROOT(example, struct my_root);
41 POBJ_LAYOUT_END(example);
42
Chapter 12 Debugging persistent MeMory appliCations
Précédent

- 255/457

Suivant