log buf.len()
This commit is contained in:
parent
6cc7fa7ae0
commit
fdc9243a41
1 changed files with 6 additions and 2 deletions
|
|
@ -46,23 +46,27 @@ macro_rules! timeit {
|
||||||
impl TorrentStorage for TimingStorage {
|
impl TorrentStorage for TimingStorage {
|
||||||
fn pread_exact(&self, file_id: usize, offset: u64, buf: &mut [u8]) -> anyhow::Result<()> {
|
fn pread_exact(&self, file_id: usize, offset: u64, buf: &mut [u8]) -> anyhow::Result<()> {
|
||||||
let storage = &self.name;
|
let storage = &self.name;
|
||||||
|
let len = buf.len();
|
||||||
timeit!(
|
timeit!(
|
||||||
"pread_exact",
|
"pread_exact",
|
||||||
self.underlying.pread_exact(file_id, offset, buf),
|
self.underlying.pread_exact(file_id, offset, buf),
|
||||||
file_id,
|
file_id,
|
||||||
offset,
|
offset,
|
||||||
storage
|
storage,
|
||||||
|
len
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pwrite_all(&self, file_id: usize, offset: u64, buf: &[u8]) -> anyhow::Result<()> {
|
fn pwrite_all(&self, file_id: usize, offset: u64, buf: &[u8]) -> anyhow::Result<()> {
|
||||||
let storage = &self.name;
|
let storage = &self.name;
|
||||||
|
let len = buf.len();
|
||||||
timeit!(
|
timeit!(
|
||||||
"pwrite_all",
|
"pwrite_all",
|
||||||
self.underlying.pwrite_all(file_id, offset, buf),
|
self.underlying.pwrite_all(file_id, offset, buf),
|
||||||
file_id,
|
file_id,
|
||||||
offset,
|
offset,
|
||||||
storage
|
storage,
|
||||||
|
len
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue