@@ -624,7 +624,7 @@ void ReplicatedBackend::submit_transaction(
624624 pg_committed_to,
625625 true ,
626626 op_t );
627-
627+
628628 op_t .register_on_commit (
629629 parent->bless_context (
630630 new C_OSD_OnOpCommit (this , &op)));
@@ -745,16 +745,17 @@ static uint32_t crc32_netstring(const uint32_t orig_crc, std::string_view data)
745745}
746746
747747int ReplicatedBackend::be_deep_scrub (
748+ const Scrub::ScrubCounterSet& io_counters,
748749 const hobject_t &poid,
749750 ScrubMap &map,
750751 ScrubMapBuilder &pos,
751752 ScrubMap::object &o)
752753{
753754 dout (10 ) << __func__ << " " << poid << " pos " << pos << dendl;
754- int r ;
755- uint32_t fadvise_flags = CEPH_OSD_OP_FLAG_FADVISE_SEQUENTIAL |
756- CEPH_OSD_OP_FLAG_FADVISE_DONTNEED |
757- CEPH_OSD_OP_FLAG_BYPASS_CLEAN_CACHE;
755+ auto & perf_logger = *( get_parent ()-> get_logger ()) ;
756+ const uint32_t fadvise_flags = CEPH_OSD_OP_FLAG_FADVISE_SEQUENTIAL |
757+ CEPH_OSD_OP_FLAG_FADVISE_DONTNEED |
758+ CEPH_OSD_OP_FLAG_BYPASS_CLEAN_CACHE;
758759
759760 utime_t sleeptime;
760761 sleeptime.set_from_double (cct->_conf ->osd_debug_deep_scrub_sleep );
@@ -763,6 +764,7 @@ int ReplicatedBackend::be_deep_scrub(
763764 sleeptime.sleep ();
764765 }
765766
767+ int r{0 };
766768 ceph_assert (poid == pos.ls [pos.pos ]);
767769 if (!pos.data_done ()) {
768770 if (pos.data_pos == 0 ) {
@@ -771,6 +773,7 @@ int ReplicatedBackend::be_deep_scrub(
771773
772774 const uint64_t stride = cct->_conf ->osd_deep_scrub_stride ;
773775
776+ perf_logger.inc (io_counters.read_cnt );
774777 bufferlist bl;
775778 r = store->read (
776779 ch,
@@ -788,6 +791,7 @@ int ReplicatedBackend::be_deep_scrub(
788791 if (r > 0 ) {
789792 pos.data_hash << bl;
790793 }
794+ perf_logger.inc (io_counters.read_bytes , r);
791795 pos.data_pos += r;
792796 if (static_cast <uint64_t >(r) == stride) {
793797 dout (20 ) << __func__ << " " << poid << " more data, digest so far 0x"
@@ -806,6 +810,7 @@ int ReplicatedBackend::be_deep_scrub(
806810 if (pos.omap_pos .empty ()) {
807811 pos.omap_hash = -1 ;
808812
813+ perf_logger.inc (io_counters.omapgetheader_cnt );
809814 bufferlist hdrbl;
810815 r = store->omap_get_header (
811816 ch,
@@ -822,10 +827,13 @@ int ReplicatedBackend::be_deep_scrub(
822827 bool encoded = false ;
823828 dout (25 ) << " CRC header " << cleanbin (hdrbl, encoded, true ) << dendl;
824829 pos.omap_hash = hdrbl.crc32c (pos.omap_hash );
830+ perf_logger.inc (io_counters.omapgetheader_bytes , hdrbl.length ());
825831 }
826832 }
827833
828834 // omap
835+
836+ perf_logger.inc (io_counters.omapget_cnt );
829837 using omap_iter_seek_t = ObjectStore::omap_iter_seek_t ;
830838 auto result = store->omap_iterate (
831839 ch,
@@ -859,6 +867,9 @@ int ReplicatedBackend::be_deep_scrub(
859867 return -EINPROGRESS;
860868 }
861869
870+ // we have the full omap now. Finalize the perf counting
871+ perf_logger.inc (io_counters.omapget_bytes , pos.omap_bytes );
872+
862873 if (pos.omap_keys > cct->_conf ->
863874 osd_deep_scrub_large_omap_object_key_threshold ||
864875 pos.omap_bytes > cct->_conf ->
0 commit comments