alloc: Disable inner loop debugging by default
The current logging statements within the inner loop of find_multi_slots drain quite a lot of CPU resources even if LOGL_DEBUG is not enabled. This might cause issues on the target hardware. This commit disables these LOGP calls unless the ENABLE_TS_ALLOC_DEBUG macro has been set explicitly. This results in a reduction in the CPU usage reported by callgrind for find_multi_slots from 42% to 25% when executing AllocTest. Sponsored-by: On-Waves ehf
This commit is contained in:
parent
20b7ba7501
commit
1653f837e3
|
@ -501,12 +501,14 @@ static int find_multi_slots(struct gprs_rlcmac_bts *bts,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!rx_good) {
|
if (!rx_good) {
|
||||||
|
#ifdef ENABLE_TS_ALLOC_DEBUG
|
||||||
LOGP(DRLCMAC, LOGL_DEBUG,
|
LOGP(DRLCMAC, LOGL_DEBUG,
|
||||||
"- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), "
|
"- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), "
|
||||||
"no DL slots available\n",
|
"no DL slots available\n",
|
||||||
set_flag_chars(set_flag_chars(slot_info,
|
set_flag_chars(set_flag_chars(slot_info,
|
||||||
rx_bad, 'x', '.'),
|
rx_bad, 'x', '.'),
|
||||||
tx_window, 'U'));
|
tx_window, 'U'));
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -520,16 +522,18 @@ static int find_multi_slots(struct gprs_rlcmac_bts *bts,
|
||||||
req_common_slots = OSMO_MIN(req_common_slots, 2);
|
req_common_slots = OSMO_MIN(req_common_slots, 2);
|
||||||
|
|
||||||
if (req_common_slots != common_slot_count) {
|
if (req_common_slots != common_slot_count) {
|
||||||
LOGP(DRLCMAC, LOGL_DEBUG,
|
#ifdef ENABLE_TS_ALLOC_DEBUG
|
||||||
"- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), "
|
LOGP(DRLCMAC, LOGL_DEBUG,
|
||||||
"invalid number of common TS: %d (expected %d)\n",
|
"- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), "
|
||||||
set_flag_chars(set_flag_chars(set_flag_chars(
|
"invalid number of common TS: %d (expected %d)\n",
|
||||||
slot_info,
|
set_flag_chars(set_flag_chars(set_flag_chars(
|
||||||
rx_bad, 'x', '.'),
|
slot_info,
|
||||||
rx_window, 'D'),
|
rx_bad, 'x', '.'),
|
||||||
|
rx_window, 'D'),
|
||||||
tx_window, 'U'),
|
tx_window, 'U'),
|
||||||
common_slot_count,
|
common_slot_count,
|
||||||
req_common_slots);
|
req_common_slots);
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -554,6 +558,7 @@ static int find_multi_slots(struct gprs_rlcmac_bts *bts,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_TS_ALLOC_DEBUG
|
||||||
LOGP(DRLCMAC, LOGL_DEBUG,
|
LOGP(DRLCMAC, LOGL_DEBUG,
|
||||||
"- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), "
|
"- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), "
|
||||||
"capacity = %d\n",
|
"capacity = %d\n",
|
||||||
|
@ -564,6 +569,7 @@ static int find_multi_slots(struct gprs_rlcmac_bts *bts,
|
||||||
tx_window, 'U'),
|
tx_window, 'U'),
|
||||||
rx_window & tx_window, 'C'),
|
rx_window & tx_window, 'C'),
|
||||||
capacity);
|
capacity);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (capacity <= max_capacity)
|
if (capacity <= max_capacity)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue