Commit 07e53c77 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

inet: More readable content in show methods

This generates more readable data in logs.

 | (00.002930) inet:       Collected: ino 0xc3f15b family AF_INET    type SOCK_DGRAM     port     8081 state TCP_CLOSE       src_addr 127.0.0.10
 | (00.002980) inet:       Collected: ino 0xc3f159 family AF_INET    type SOCK_RAW       port        1 state TCP_CLOSE       src_addr 127.0.0.14
 | (00.002984) inet:       Collected: ino 0xc3f158 family AF_INET    type SOCK_RAW       port       17 state TCP_CLOSE       src_addr 127.0.0.12
 | (00.002988) inet:       Collected: ino 0xc3f156 family AF_INET    type SOCK_RAW       port      255 state TCP_CLOSE       src_addr 0.0.0.0
 | (00.003439) inet:       Collected: ino 0xc3f15a family AF_INET6   type SOCK_RAW       port       58 state TCP_CLOSE       src_addr ::
 | (00.003449) inet:       Collected: ino 0xc3f157 family AF_INET6   type SOCK_RAW       port      255 state TCP_CLOSE       src_addr ::
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@gmail.com>
parent e238854f
...@@ -84,10 +84,11 @@ static void show_one_inet(const char *act, const struct inet_sk_desc *sk) ...@@ -84,10 +84,11 @@ static void show_one_inet(const char *act, const struct inet_sk_desc *sk)
pr_perror("Failed to translate address"); pr_perror("Failed to translate address");
} }
pr_debug("\t%s: ino %#8x family %4d type %4d port %8d " pr_debug("\t%s: ino %#8x family %-10s type %-14s port %8d "
"state %2d src_addr %s\n", "state %-16s src_addr %s\n", act, sk->sd.ino,
act, sk->sd.ino, sk->sd.family, sk->type, sk->src_port, ___socket_family_name(sk->sd.family),
sk->state, src_addr); ___socket_type_name(sk->type), sk->src_port,
___tcp_state_name(sk->state), src_addr);
} }
static void show_one_inet_img(const char *act, const InetSkEntry *e) static void show_one_inet_img(const char *act, const InetSkEntry *e)
...@@ -99,10 +100,13 @@ static void show_one_inet_img(const char *act, const InetSkEntry *e) ...@@ -99,10 +100,13 @@ static void show_one_inet_img(const char *act, const InetSkEntry *e)
pr_perror("Failed to translate address"); pr_perror("Failed to translate address");
} }
pr_debug("\t%s: family %d type %d proto %d port %d " pr_debug("\t%s: family %-10s type %-14s proto %-16s port %d "
"state %d src_addr %s\n", "state %-16s src_addr %s\n", act,
act, e->family, e->type, e->proto, e->src_port, ___socket_family_name(e->family),
e->state, src_addr); ___socket_type_name(e->type),
___socket_proto_name(e->proto),
e->src_port, ___tcp_state_name(e->state),
src_addr);
} }
static int can_dump_ipproto(int ino, int proto) static int can_dump_ipproto(int ino, int proto)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment