Skip to content

Commit

Permalink
Change debug! to trace! to reduce logging noise (#2284)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernQ authored Oct 7, 2024
1 parent efe58e9 commit e5bc639
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 34 deletions.
6 changes: 3 additions & 3 deletions esp-wifi/src/ble/btdm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ unsafe extern "C" fn btdm_hus_2_lpcycles(us: u32) -> u32 {

// Converts a duration in half us into a number of low power clock cycles.
let cycles: u64 = (us as u64) << (g_btdm_lpcycle_us_frac as u64 / g_btdm_lpcycle_us as u64);
debug!("*** NOT implemented btdm_hus_2_lpcycles {} {}", us, cycles);
trace!("btdm_hus_2_lpcycles {} {}", us, cycles);
// probably not right ... NX returns half of the values we calculate here

cycles as u32
Expand Down Expand Up @@ -403,13 +403,13 @@ unsafe extern "C" fn btdm_sleep_exit_phase3() {
}

unsafe extern "C" fn coex_schm_status_bit_set(_typ: i32, status: i32) {
debug!("coex_schm_status_bit_set {} {}", _typ, status);
trace!("coex_schm_status_bit_set {} {}", _typ, status);
#[cfg(coex)]
crate::binary::include::coex_schm_status_bit_set(_typ as u32, status as u32);
}

unsafe extern "C" fn coex_schm_status_bit_clear(_typ: i32, status: i32) {
debug!("coex_schm_status_bit_clear {} {}", _typ, status);
trace!("coex_schm_status_bit_clear {} {}", _typ, status);
#[cfg(coex)]
crate::binary::include::coex_schm_status_bit_clear(_typ as u32, status as u32);
}
Expand Down
6 changes: 3 additions & 3 deletions esp-wifi/src/ble/npl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1316,13 +1316,13 @@ fn os_msys_init() {

unsafe extern "C" fn ble_hs_hci_rx_evt(cmd: *const u8, arg: *const c_void) -> i32 {
trace!("ble_hs_hci_rx_evt {:?} {:?}", cmd, arg);
debug!("$ cmd = {:x}", *cmd);
debug!("$ len = {:x}", *(cmd.offset(1)));
trace!("$ cmd = {:x}", *cmd);
trace!("$ len = {:x}", *(cmd.offset(1)));

let event = *cmd;
let len = *(cmd.offset(1)) as usize;
let payload = core::slice::from_raw_parts(cmd.offset(2), len);
debug!("$ pld = {:?}", payload);
trace!("$ pld = {:?}", payload);

critical_section::with(|cs| {
let mut queue = BT_RECEIVE_QUEUE.borrow_ref_mut(cs);
Expand Down
16 changes: 8 additions & 8 deletions esp-wifi/src/ble/os_adapter_esp32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ pub(crate) fn disable_sleep_mode() {
}

pub(crate) unsafe extern "C" fn coex_bt_wakeup_request() -> bool {
debug!("coex_bt_wakeup_request");
trace!("coex_bt_wakeup_request");
#[cfg(coex)]
return async_wakeup_request(BTDM_ASYNC_WAKEUP_REQ_COEX);

Expand All @@ -393,7 +393,7 @@ pub(crate) unsafe extern "C" fn coex_bt_wakeup_request_end() {

#[allow(unused_variables)]
pub(crate) unsafe extern "C" fn coex_bt_request(event: u32, latency: u32, duration: u32) -> i32 {
debug!("coex_bt_request");
trace!("coex_bt_request");
extern "C" {
#[cfg(coex)]
fn coex_bt_request(event: u32, latency: u32, duration: u32) -> i32;
Expand All @@ -408,7 +408,7 @@ pub(crate) unsafe extern "C" fn coex_bt_request(event: u32, latency: u32, durati

#[allow(unused_variables)]
pub(crate) unsafe extern "C" fn coex_bt_release(event: u32) -> i32 {
debug!("coex_bt_release");
trace!("coex_bt_release");
extern "C" {
#[cfg(coex)]
fn coex_bt_release(event: u32) -> i32;
Expand Down Expand Up @@ -438,7 +438,7 @@ pub(crate) unsafe extern "C" fn coex_register_bt_cb_wrapper(
}

pub(crate) unsafe extern "C" fn coex_bb_reset_lock() -> u32 {
debug!("coex_bb_reset_lock");
trace!("coex_bb_reset_lock");
extern "C" {
#[cfg(coex)]
fn coex_bb_reset_lock() -> u32;
Expand All @@ -453,7 +453,7 @@ pub(crate) unsafe extern "C" fn coex_bb_reset_lock() -> u32 {

#[allow(unused_variables)]
pub(crate) unsafe extern "C" fn coex_bb_reset_unlock(event: u32) {
debug!("coex_bb_reset_unlock");
trace!("coex_bb_reset_unlock");
extern "C" {
#[cfg(coex)]
fn coex_bb_reset_unlock(event: u32);
Expand All @@ -480,7 +480,7 @@ pub(crate) unsafe extern "C" fn coex_schm_register_btdm_callback_wrapper(
}

pub(crate) unsafe extern "C" fn coex_schm_interval_get() -> u32 {
debug!("coex_schm_interval_get");
trace!("coex_schm_interval_get");

#[cfg(coex)]
return crate::binary::include::coex_schm_interval_get();
Expand All @@ -490,7 +490,7 @@ pub(crate) unsafe extern "C" fn coex_schm_interval_get() -> u32 {
}

pub(crate) unsafe extern "C" fn coex_schm_curr_period_get() -> u8 {
debug!("coex_schm_curr_period_get");
trace!("coex_schm_curr_period_get");

#[cfg(coex)]
return crate::binary::include::coex_schm_curr_period_get();
Expand All @@ -500,7 +500,7 @@ pub(crate) unsafe extern "C" fn coex_schm_curr_period_get() -> u8 {
}

pub(crate) unsafe extern "C" fn coex_schm_curr_phase_get() -> *const () {
debug!("coex_schm_curr_phase_get");
trace!("coex_schm_curr_phase_get");

#[cfg(coex)]
return crate::binary::include::coex_schm_curr_phase_get() as *const ();
Expand Down
6 changes: 3 additions & 3 deletions esp-wifi/src/ble/os_adapter_esp32c3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ extern "C" fn ets_delay_us_wrapper(us: u32) {
}

extern "C" fn btdm_rom_table_ready_wrapper() {
debug!("btdm_rom_table_ready_wrapper not implemented");
trace!("btdm_rom_table_ready_wrapper not implemented");

// #if BT_BLE_CCA_MODE == 2
// btdm_cca_feature_enable();
Expand Down Expand Up @@ -370,7 +370,7 @@ pub(crate) unsafe extern "C" fn interrupt_handler_set(
}

pub(crate) unsafe extern "C" fn coex_wifi_sleep_set(sleep: i32) {
debug!(
trace!(
"ignored coex_wifi_sleep_set {} - because original implementation does the same",
sleep
);
Expand All @@ -384,7 +384,7 @@ pub(crate) unsafe extern "C" fn coex_core_ble_conn_dyn_prio_get(
extern "C" {
fn coex_core_ble_conn_dyn_prio_get(low: *mut i32, high: *mut i32) -> i32;
}
debug!("coex_core_ble_conn_dyn_prio_get");
trace!("coex_core_ble_conn_dyn_prio_get");

#[cfg(coex)]
return coex_core_ble_conn_dyn_prio_get(low, high);
Expand Down
8 changes: 6 additions & 2 deletions esp-wifi/src/ble/os_adapter_esp32c6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ pub(super) unsafe extern "C" fn esp_intr_alloc(
arg: *mut crate::binary::c_types::c_void,
ret_handle: *mut *mut crate::binary::c_types::c_void,
) -> i32 {
debug!(
trace!(
"esp_intr_alloc {} {} {:?} {:?} {:?}",
source, flags, handler, arg, ret_handle
source,
flags,
handler,
arg,
ret_handle
);

match source {
Expand Down
8 changes: 6 additions & 2 deletions esp-wifi/src/ble/os_adapter_esp32h2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ pub(super) unsafe extern "C" fn esp_intr_alloc(
arg: *mut crate::binary::c_types::c_void,
ret_handle: *mut *mut crate::binary::c_types::c_void,
) -> i32 {
debug!(
trace!(
"esp_intr_alloc {} {} {:?} {:?} {:?}",
source, flags, handler, arg, ret_handle
source,
flags,
handler,
arg,
ret_handle
);

match source {
Expand Down
6 changes: 3 additions & 3 deletions esp-wifi/src/ble/os_adapter_esp32s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ extern "C" fn ets_delay_us_wrapper(us: u32) {
}

extern "C" fn btdm_rom_table_ready_wrapper() {
debug!("btdm_rom_table_ready_wrapper is NOT implemented");
trace!("btdm_rom_table_ready_wrapper is NOT implemented");

// #if BT_BLE_CCA_MODE == 2
// btdm_cca_feature_enable();
Expand Down Expand Up @@ -383,7 +383,7 @@ pub(crate) unsafe extern "C" fn interrupt_handler_set(
}

pub(crate) unsafe extern "C" fn coex_wifi_sleep_set(sleep: i32) {
debug!(
trace!(
"ignored coex_wifi_sleep_set {} - because original implementation does the same",
sleep
);
Expand All @@ -397,7 +397,7 @@ pub(crate) unsafe extern "C" fn coex_core_ble_conn_dyn_prio_get(
extern "C" {
fn coex_core_ble_conn_dyn_prio_get(low: *mut i32, high: *mut i32) -> i32;
}
debug!("coex_core_ble_conn_dyn_prio_get");
trace!("coex_core_ble_conn_dyn_prio_get");

#[cfg(coex)]
return coex_core_ble_conn_dyn_prio_get(low, high);
Expand Down
23 changes: 14 additions & 9 deletions esp-wifi/src/compat/timer_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ pub fn compat_timer_arm_us(ets_timer: *mut ets_timer, us: u32, repeat: bool) {
let systick = crate::timer::get_systimer_count();
let ticks = crate::timer::micros_to_ticks(us as u64);

debug!(
trace!(
"timer_arm_us {:x} current: {} ticks: {} repeat: {}",
ets_timer as usize, systick, ticks, repeat
ets_timer as usize,
systick,
ticks,
repeat
);

critical_section::with(|_| unsafe {
Expand All @@ -65,18 +68,18 @@ pub fn compat_timer_arm_us(ets_timer: *mut ets_timer, us: u32, repeat: bool) {
timer.active = true;
timer.periodic = repeat;
} else {
debug!("timer_arm_us {:x} not found", ets_timer as usize);
trace!("timer_arm_us {:x} not found", ets_timer as usize);
}
})
}

pub fn compat_timer_disarm(ets_timer: *mut ets_timer) {
critical_section::with(|_| unsafe {
if let Some(timer) = TIMERS.iter_mut().find(|t| t.ets_timer == ets_timer) {
debug!("timer_disarm {:x}", timer.id());
trace!("timer_disarm {:x}", timer.id());
timer.active = false;
} else {
debug!("timer_disarm {:x} not found", ets_timer as usize);
trace!("timer_disarm {:x} not found", ets_timer as usize);
}
})
}
Expand All @@ -88,15 +91,15 @@ pub fn compat_timer_done(ets_timer: *mut ets_timer) {
.enumerate()
.find(|(_, t)| t.ets_timer == ets_timer)
{
debug!("timer_done {:x}", timer.id());
trace!("timer_done {:x}", timer.id());
timer.active = false;

(*ets_timer).priv_ = core::ptr::null_mut();
(*ets_timer).expire = 0;

TIMERS.swap_remove(idx);
} else {
debug!("timer_done {:x} not found", ets_timer as usize);
trace!("timer_done {:x} not found", ets_timer as usize);
}
})
}
Expand All @@ -106,9 +109,11 @@ pub fn compat_timer_setfn(
pfunction: unsafe extern "C" fn(*mut c_types::c_void),
parg: *mut c_types::c_void,
) {
debug!(
trace!(
"timer_setfn {:x} {:?} {:?}",
ets_timer as usize, pfunction, parg
ets_timer as usize,
pfunction,
parg
);

let set = critical_section::with(|_| unsafe {
Expand Down
2 changes: 1 addition & 1 deletion esp-wifi/src/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub extern "C" fn timer_task(_param: *mut esp_wifi_sys::c_types::c_void) {
if timer.active
&& crate::timer::time_diff(timer.started, current_timestamp) >= timer.timeout
{
debug!("timer is due.... {:x}", timer.id());
trace!("timer is due.... {:x}", timer.id());

if to_run.enqueue(timer.callback).is_err() {
break;
Expand Down

0 comments on commit e5bc639

Please sign in to comment.