net/iface: Add PM suspend state statistics

Counting how many times it went suspended, for how long on the last one
and on overage.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2020-04-01 10:21:48 +02:00 committed by Jukka Rissanen
commit 00926e3899
5 changed files with 82 additions and 0 deletions

View file

@ -3636,6 +3636,8 @@ int net_if_suspend(struct net_if *iface)
return -EALREADY;
}
net_stats_add_suspend_start_time(iface, k_cycle_get_32());
return 0;
}
@ -3647,6 +3649,8 @@ int net_if_resume(struct net_if *iface)
net_if_flag_clear(iface, NET_IF_SUSPENDED);
net_stats_add_suspend_end_time(iface, k_cycle_get_32());
return 0;
}