From 591e7e1675f9b474df4100f0aa32418f8a08c585 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 9 Dec 2014 13:43:53 -0800 Subject: [PATCH] osd: clean up scrub method debug output Use __func__ instead of (usually inaccurate) names. Signed-off-by: Sage Weil --- src/osd/PG.cc | 14 ++++++-------- src/osd/PGBackend.cc | 12 +++++++----- src/osd/ReplicatedBackend.cc | 9 +++++---- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 197abcf941ca7..f202b8dfc47bc 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3564,8 +3564,7 @@ int PG::build_scrub_map_chunk( hobject_t start, hobject_t end, bool deep, ThreadPool::TPHandle &handle) { - dout(10) << "build_scrub_map" << dendl; - dout(20) << "scrub_map_chunk [" << start << "," << end << ")" << dendl; + dout(10) << __func__ << " [" << start << "," << end << ")" << dendl; map.valid_through = info.last_update; @@ -3588,8 +3587,7 @@ int PG::build_scrub_map_chunk( _scan_rollback_obs(rollback_obs, handle); _scan_snaps(map); - dout(10) << __func__ << " done." << dendl; - + dout(20) << __func__ << " done" << dendl; return 0; } @@ -4156,13 +4154,13 @@ bool PG::scrub_gather_replica_maps() void PG::scrub_compare_maps() { - dout(10) << "scrub_compare_maps has maps, analyzing" << dendl; + dout(10) << __func__ << " has maps, analyzing" << dendl; // construct authoritative scrub map for type specific scrubbing ScrubMap authmap(scrubber.primary_scrubmap); if (acting.size() > 1) { - dout(10) << "scrub comparing replica scrub maps" << dendl; + dout(10) << __func__ << " comparing replica scrub maps" << dendl; stringstream ss; @@ -4170,7 +4168,7 @@ void PG::scrub_compare_maps() map authoritative; map maps; - dout(2) << "scrub osd." << acting[0] << " has " + dout(2) << __func__ << " osd." << acting[0] << " has " << scrubber.primary_scrubmap.objects.size() << " items" << dendl; maps[pg_whoami] = &scrubber.primary_scrubmap; @@ -4178,7 +4176,7 @@ void PG::scrub_compare_maps() i != actingbackfill.end(); ++i) { if (*i == pg_whoami) continue; - dout(2) << "scrub replica " << *i << " has " + dout(2) << __func__ << " replica " << *i << " has " << scrubber.received_maps[*i].objects.size() << " items" << dendl; maps[*i] = &scrubber.received_maps[*i]; diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index fd5ba5ce10f7a..3c50d895e27cd 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -323,7 +323,7 @@ void PGBackend::be_scan_list( ScrubMap &map, const vector &ls, bool deep, ThreadPool::TPHandle &handle) { - dout(10) << "_scan_list scanning " << ls.size() << " objects" + dout(10) << __func__ << " scanning " << ls.size() << " objects" << (deep ? " deeply" : "") << dendl; int i = 0; for (vector::const_iterator p = ls.begin(); @@ -354,15 +354,17 @@ void PGBackend::be_scan_list( be_deep_scrub(*p, o, handle); } - dout(25) << "_scan_list " << poid << dendl; + dout(25) << __func__ << " " << poid << dendl; } else if (r == -ENOENT) { - dout(25) << "_scan_list " << poid << " got " << r << ", skipping" << dendl; + dout(25) << __func__ << " " << poid << " got " << r + << ", skipping" << dendl; } else if (r == -EIO) { - dout(25) << "_scan_list " << poid << " got " << r << ", read_error" << dendl; + dout(25) << __func__ << " " << poid << " got " << r + << ", read_error" << dendl; ScrubMap::object &o = map.objects[poid]; o.read_error = true; } else { - derr << "_scan_list got: " << cpp_strerror(r) << dendl; + derr << __func__ << " got: " << cpp_strerror(r) << dendl; assert(0); } } diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 34a4db448d7e5..e19ad4b0465ee 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -694,7 +694,8 @@ void ReplicatedBackend::sub_op_modify_reply(OpRequestRef op) void ReplicatedBackend::be_deep_scrub( const hobject_t &poid, ScrubMap::object &o, - ThreadPool::TPHandle &handle) { + ThreadPool::TPHandle &handle) +{ bufferhash h, oh; bufferlist bl, hdrbl; int r; @@ -712,7 +713,7 @@ void ReplicatedBackend::be_deep_scrub( bl.clear(); } if (r == -EIO) { - dout(25) << "_scan_list " << poid << " got " + dout(25) << __func__ << " " << poid << " got " << r << " on read, read_error" << dendl; o.read_error = true; } @@ -732,7 +733,7 @@ void ReplicatedBackend::be_deep_scrub( oh << bl; bl.clear(); } else if (r == -EIO) { - dout(25) << "_scan_list " << poid << " got " + dout(25) << __func__ << " " << poid << " got " << r << " on omap header read, read_error" << dendl; o.read_error = true; } @@ -759,7 +760,7 @@ void ReplicatedBackend::be_deep_scrub( bl.clear(); } if (iter->status() == -EIO) { - dout(25) << "_scan_list " << poid << " got " + dout(25) << __func__ << " " << poid << " got " << r << " on omap scan, read_error" << dendl; o.read_error = true; } -- 2.39.5