return buffer_cached_crc_adjusted.read();
}
+ atomic_t buffer_c_str_accesses;
+ bool buffer_track_c_str = get_env_bool("CEPH_BUFFER_TRACK");
+
+ void buffer::track_c_str(bool b) {
+ buffer_track_c_str = b;
+ }
+ int buffer::get_c_str_accesses() {
+ return buffer_c_str_accesses.read();
+ }
+
atomic_t buffer_max_pipe_size;
int update_max_pipe_size() {
#ifdef CEPH_HAVE_SETPIPE_SZ
const char *buffer::ptr::c_str() const {
assert(_raw);
+ if (buffer_track_c_str)
+ buffer_c_str_accesses.inc();
return _raw->get_data() + _off;
}
char *buffer::ptr::c_str() {
assert(_raw);
+ if (buffer_track_c_str)
+ buffer_c_str_accesses.inc();
return _raw->get_data() + _off;
}
/// enable/disable tracking of cached crcs
static void track_cached_crc(bool b);
+ /// count of calls to buffer::ptr::c_str()
+ static int get_c_str_accesses();
+ /// enable/disable tracking of buffer::ptr::c_str() calls
+ static void track_c_str(bool b);
private: