From 576a41c16aee55a5bb2f51784484b65d9ed8e76c Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 6 Dec 2018 19:04:37 +0100 Subject: [PATCH] common: eradicate buffer_track_c_str in bufferlist. Signed-off-by: Radoslaw Zarzynski --- src/common/buffer.cc | 19 ------------------- src/include/buffer.h | 5 ----- 2 files changed, 24 deletions(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index f48f865028a..2012c8d2724 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -107,17 +107,6 @@ using namespace ceph; return buffer_missed_crc; } - static std::atomic buffer_c_str_accesses { 0 }; - - static 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; - } - #ifdef CEPH_HAVE_SETPIPE_SZ static std::atomic buffer_max_pipe_size { 0 }; int update_max_pipe_size() { @@ -676,26 +665,18 @@ using namespace ceph; const char *buffer::ptr::c_str() const { ceph_assert(_raw); - if (unlikely(buffer_track_c_str)) - buffer_c_str_accesses++; return _raw->get_data() + _off; } char *buffer::ptr::c_str() { ceph_assert(_raw); - if (unlikely(buffer_track_c_str)) - buffer_c_str_accesses++; return _raw->get_data() + _off; } const char *buffer::ptr::end_c_str() const { ceph_assert(_raw); - if (unlikely(buffer_track_c_str)) - buffer_c_str_accesses++; return _raw->get_data() + _off + _len; } char *buffer::ptr::end_c_str() { ceph_assert(_raw); - if (unlikely(buffer_track_c_str)) - buffer_c_str_accesses++; return _raw->get_data() + _off + _len; } diff --git a/src/include/buffer.h b/src/include/buffer.h index 56c5e8154e2..c563aff5ff3 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -134,11 +134,6 @@ namespace buffer CEPH_BUFFER_API { /// enable/disable tracking of cached crcs void track_cached_crc(bool b); - /// count of calls to buffer::ptr::c_str() - int get_c_str_accesses(); - /// enable/disable tracking of buffer::ptr::c_str() calls - void track_c_str(bool b); - /* * an abstract raw buffer. with a reference count. */ -- 2.39.5