From ebcde0c185e9760d321a755628b117d89fbab68c Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Tue, 5 Mar 2024 02:30:18 +0000 Subject: [PATCH] libublk: loglevel: adjust log level All logging in uring_async.rs should be log::trace!(). Signed-off-by: Ming Lei --- examples/loop.rs | 3 +-- src/ctrl.rs | 2 +- src/io.rs | 4 ++-- src/uring_async.rs | 10 +++++----- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/examples/loop.rs b/examples/loop.rs index 32a9d33..4685cc8 100644 --- a/examples/loop.rs +++ b/examples/loop.rs @@ -7,7 +7,6 @@ use libublk::helpers::IoBuf; use libublk::io::{UblkDev, UblkIOCtx, UblkQueue}; use libublk::uring_async::ublk_wait_and_handle_ios; use libublk::{ctrl::UblkCtrl, sys, UblkError, UblkFlags, UblkIORes}; -use log::trace; use serde::Serialize; use std::os::unix::fs::FileTypeExt; use std::os::unix::io::AsRawFd; @@ -82,7 +81,7 @@ fn lo_file_size(f: &std::fs::File) -> Result<(u64, u8, u8)> { // setup loop target fn lo_init_tgt(dev: &mut UblkDev, lo: &LoopTgt) -> Result<(), UblkError> { - trace!("loop: init_tgt {}", dev.dev_info.dev_id); + log::info!("loop: init_tgt {}", dev.dev_info.dev_id); if lo.direct_io != 0 { unsafe { libc::fcntl(lo.back_file.as_raw_fd(), libc::F_SETFL, libc::O_DIRECT); diff --git a/src/ctrl.rs b/src/ctrl.rs index 663c885..04e93cf 100644 --- a/src/ctrl.rs +++ b/src/ctrl.rs @@ -343,7 +343,7 @@ impl UblkCtrlInner { dev.read_dev_info()?; } - trace!( + log::info!( "ctrl: device {} flags {:x} created", dev.dev_info.dev_id, dev.dev_flags diff --git a/src/io.rs b/src/io.rs index 358acb8..3b5771b 100644 --- a/src/io.rs +++ b/src/io.rs @@ -1006,7 +1006,7 @@ impl UblkQueue<'_> { let empty = self.q_ring.borrow_mut().submission().is_empty(); if empty && state.get_nr_cmd_inflight() == self.q_depth && !state.is_idle() { - log::trace!( + log::debug!( "dev {} queue {} becomes idle", self.dev.dev_info.dev_id, self.q_id @@ -1021,7 +1021,7 @@ impl UblkQueue<'_> { let idle = { self.state.borrow().is_idle() }; if idle { - log::trace!( + log::debug!( "dev {} queue {} becomes busy", self.dev.dev_info.dev_id, self.q_id diff --git a/src/uring_async.rs b/src/uring_async.rs index 572e527..3ec8a49 100644 --- a/src/uring_async.rs +++ b/src/uring_async.rs @@ -35,7 +35,7 @@ impl UblkUringOpFuture { result: None, }); let user_data = ((key as u32) << 16) as u64 | tgt_io; - log::debug!("uring: new future {:x}", user_data); + log::trace!("uring: new future {:x}", user_data); UblkUringOpFuture { user_data } }) } @@ -49,18 +49,18 @@ impl Future for UblkUringOpFuture { let key = ((self.user_data & !(1_u64 << 63)) >> 16) as usize; match map.get_mut(key) { None => { - log::debug!("uring: null slab {:x}", self.user_data); + log::trace!("uring: null slab {:x}", self.user_data); Poll::Pending } Some(fd) => match fd.result { Some(result) => { map.remove(key); - log::debug!("uring: uring io ready userdata {:x} ready", self.user_data); + log::trace!("uring: uring io ready userdata {:x} ready", self.user_data); Poll::Ready(result) } None => { fd.waker = Some(cx.waker().clone()); - log::debug!("uring: uring io pending userdata {:x}", self.user_data); + log::trace!("uring: uring io pending userdata {:x}", self.user_data); Poll::Pending } }, @@ -77,7 +77,7 @@ pub fn ublk_wake_task(data: u64, cqe: &cqueue::Entry) { MY_SLAB.with(|refcell| { let mut map = refcell.borrow_mut(); - log::debug!( + log::trace!( "ublk_wake_task: data {:x} user_data {:x} result {:x}", data, cqe.user_data(),