Add SkDestroyListener log in dumpsys netstats
When sockets are destroyed, the SkDestroyListener receives a
NETLINK_INET_DIAG message informing it to delete the socket cookie from
the BPF CookieTagMap. However, under unknown conditions, all 10,000
spaces on the map were still observed to be filled. SkDestroyListener
and its parent classes, NetlinkMonitor, and FdEventsReader will log
errors. But due to the time required to fill the 10,000 fields is long,
traces in the device log are likely to have been overwritten and cannot
be observed.
This commit enables dumpsys netstats to print the last 20 traces of the
SkDestroyListener. If the issue is caused by the SkDestroyListener,
this will help in obtaining further clues when the issue is reported
again.
Bug: 306919485
Bug: 319348954
Test: atest FrameworksNetTests:android.net.connectivity.com.android.serv
er.net.NetworkStatsServiceTest#testDumpSkDestroyListenerLogs
Test: manually add mLog.e(...) in
SkDestroyListener#processNetlinkMessage and check dumpsys netstats
Change-Id: I5bbfe07e05cf959f809f28a7633ee5f99e29f641
3 files changed