From fdc9243a41332f56037a157dc6852317aa7e1275 Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Wed, 1 May 2024 21:17:05 +0100 Subject: [PATCH] log buf.len() --- crates/librqbit/src/storage/timing.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/librqbit/src/storage/timing.rs b/crates/librqbit/src/storage/timing.rs index 4511dcd..db50745 100644 --- a/crates/librqbit/src/storage/timing.rs +++ b/crates/librqbit/src/storage/timing.rs @@ -46,23 +46,27 @@ macro_rules! timeit { impl TorrentStorage for TimingStorage { fn pread_exact(&self, file_id: usize, offset: u64, buf: &mut [u8]) -> anyhow::Result<()> { let storage = &self.name; + let len = buf.len(); timeit!( "pread_exact", self.underlying.pread_exact(file_id, offset, buf), file_id, offset, - storage + storage, + len ) } fn pwrite_all(&self, file_id: usize, offset: u64, buf: &[u8]) -> anyhow::Result<()> { let storage = &self.name; + let len = buf.len(); timeit!( "pwrite_all", self.underlying.pwrite_all(file_id, offset, buf), file_id, offset, - storage + storage, + len ) }