Skip logging state change of I/F not managed by SM

Skip logging state changes of interfaces that are not being
monitored by SM. This is to reduce the noise in the sm.log.

Closes-Bug: 1910770
Change-Id: I6e3d78255dc41c03f10af2fd5d778e2398ea8816
Signed-off-by: Bin Qian <bin.qian@windriver.com>
This commit is contained in:
Bin Qian 2021-01-08 10:18:13 -05:00
parent f0b1eaf618
commit df3a96d807
1 changed files with 16 additions and 2 deletions

View File

@ -1138,6 +1138,8 @@ SmFailoverInterfaceStateT sm_failover_get_interface_info(SmInterfaceTypeT interf
static void sm_failover_interface_change_callback(
SmHwInterfaceChangeDataT* if_change )
{
SmFailoverInterfaceInfo* iter;
SmServiceDomainInterfaceT* interface;
switch ( if_change->interface_state )
{
case SM_INTERFACE_STATE_DISABLED:
@ -1147,8 +1149,20 @@ static void sm_failover_interface_change_callback(
sm_failover_interface_up(if_change->interface_name);
break;
default:
DPRINTFI("Interface %s state changed to %d",
if_change->interface_name, if_change->interface_state);
// skip logging the state change of interfaces that are not monitored
// by SM.
for(iter = _my_if_list; iter < _my_if_list + _total_interfaces; iter ++)
{
interface = iter->get_interface();
if(strncmp(interface->interface_name, if_change->interface_name,
sizeof(if_change->interface_name)) == 0)
{
DPRINTFI("Interface %s state changed to %d",
if_change->interface_name, if_change->interface_state);
break;
}
}
break;
}
}