net: sock: add trace for socket errors

This patch will add tracers to trace inet socket errors only. A user
space monitor application can track connection errors indepedent from
socket lifetime and do additional handling. For example a cluster
manager can fence a node if errors occurs in a specific heuristic.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Alexander Aring 2021-06-27 18:48:22 -04:00 committed by David S. Miller
parent e3ae2365ef
commit e6a3e44340
2 changed files with 70 additions and 0 deletions

View file

@ -334,6 +334,16 @@ EXPORT_SYMBOL(__sk_backlog_rcv);
void sk_error_report(struct sock *sk)
{
sk->sk_error_report(sk);
switch (sk->sk_family) {
case AF_INET:
fallthrough;
case AF_INET6:
trace_inet_sk_error_report(sk);
break;
default:
break;
}
}
EXPORT_SYMBOL(sk_error_report);