7 event_avg_counter dbtuple::g_evt_avg_dbtuple_stable_version_spins
8 ("avg_dbtuple_stable_version_spins");
9 event_avg_counter dbtuple::g_evt_avg_dbtuple_lock_acquire_spins
10 ("avg_dbtuple_lock_acquire_spins");
11 event_avg_counter dbtuple::g_evt_avg_dbtuple_read_retries
12 ("avg_dbtuple_read_retries");
14 event_counter dbtuple::g_evt_dbtuple_creates("dbtuple_creates");
15 event_counter dbtuple::g_evt_dbtuple_logical_deletes("dbtuple_logical_deletes");
16 event_counter dbtuple::g_evt_dbtuple_physical_deletes("dbtuple_physical_deletes");
17 event_counter dbtuple::g_evt_dbtuple_bytes_allocated("dbtuple_bytes_allocated");
18 event_counter dbtuple::g_evt_dbtuple_bytes_freed("dbtuple_bytes_freed");
19 event_counter dbtuple::g_evt_dbtuple_spills("dbtuple_spills");
20 event_counter dbtuple::g_evt_dbtuple_inplace_buf_insufficient("dbtuple_inplace_buf_insufficient");
21 event_counter dbtuple::g_evt_dbtuple_inplace_buf_insufficient_on_spill("dbtuple_inplace_buf_insufficient_on_spill");
23 event_avg_counter dbtuple::g_evt_avg_record_spill_len("avg_record_spill_len");
24 static event_avg_counter evt_avg_dbtuple_chain_length("avg_dbtuple_chain_len");
29 INVARIANT(!is_locked());
30 INVARIANT(!is_latest());
31 INVARIANT(!is_write_intent());
32 INVARIANT(!is_modifying());
34 VERBOSE(cerr << "dbtuple: " << hexify(intptr_t(this)) << " is being deleted" << endl);
36 // only free this instance
39 ++g_evt_dbtuple_physical_deletes;
40 g_evt_dbtuple_bytes_freed += (alloc_size + sizeof(dbtuple));
47 INVARIANT(rcu::s_instance.in_rcu_region());
48 INVARIANT(!is_latest());
53 dbtuple::VersionInfoStr(version_t v)
57 buf << (IsLocked(v) ? "LOCKED" : "-") << " | ";
58 buf << (IsDeleting(v) ? "DEL" : "-") << " | ";
59 buf << (IsWriteIntent(v) ? "WR" : "-") << " | ";
60 buf << (IsModifying(v) ? "MOD" : "-") << " | ";
61 buf << (IsLatest(v) ? "LATEST" : "-") << " | ";
68 format_tuple(ostream &o, const dbtuple &t)
70 string truncated_contents(
71 (const char *) &t.value_start[0], min(static_cast<size_t>(t.size), 16UL));
72 o << &t << " [tid=" << g_proto_version_str(t.version)
73 << ", size=" << t.size
74 << ", contents=0x" << hexify(truncated_contents) << (t.size > 16 ? "..." : "")
75 << ", next=" << t.next << "]";
80 dbtuple::print(ostream &o, unsigned len) const
82 o << "dbtuple:" << endl
83 << " hdr=" << VersionInfoStr(unstable_version())
84 #ifdef TUPLE_CHECK_KEY
85 << endl << " key=" << hexify(key)
86 << endl << " tree=" << tree
91 for (const dbtuple *p = this;
93 p = p->get_next(), ++n) {
101 operator<<(ostream &o, const dbtuple &t)