From 9b93ff70a329e3a66b918d8194f851a2c8a5e3d1 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Fri, 15 Sep 2017 14:30:47 +0800 Subject: [PATCH] os/bluestore: add "bluestore_read_eio" counter To track down how many EIO errors have been propagated to high level callers. Signed-off-by: xie xingguo (cherry picked from commit d2d989fcc6a194b9374aeea64e45969b08990262) --- src/os/bluestore/BlueStore.cc | 5 +++++ src/os/bluestore/BlueStore.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 395df88374cd0..2a414c1efc0d8 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3966,6 +3966,8 @@ void BlueStore::_init_logger() b.add_u64_counter(l_bluestore_gc_merged, "bluestore_gc_merged", "Sum for extents that have been merged due to garbage " "collection"); + b.add_u64_counter(l_bluestore_read_eio, "bluestore_read_eio", + "Read EIO errors propagated to high level callers"); logger = b.create_perf_counters(); cct->get_perfcounters_collection()->add(logger); } @@ -6452,6 +6454,9 @@ int BlueStore::read( length = o->onode.size; r = _do_read(c, o, offset, length, bl, op_flags); + if (r == -EIO) { + logger->inc(l_bluestore_read_eio); + } } out: diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 06cd60f39a793..580c5aab19834 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -116,6 +116,7 @@ enum { l_bluestore_blob_split, l_bluestore_extent_compress, l_bluestore_gc_merged, + l_bluestore_read_eio, l_bluestore_last }; -- 2.39.5