net/ipv4/proc.c
changeset 2 d1f6d8b6f81c
parent 0 aa628870c1d3
equal deleted inserted replaced
1:0056487c491e 2:d1f6d8b6f81c
    36 #include <net/icmp.h>
    36 #include <net/icmp.h>
    37 #include <net/protocol.h>
    37 #include <net/protocol.h>
    38 #include <net/tcp.h>
    38 #include <net/tcp.h>
    39 #include <net/udp.h>
    39 #include <net/udp.h>
    40 #include <net/udplite.h>
    40 #include <net/udplite.h>
       
    41 #include <linux/bottom_half.h>
    41 #include <linux/inetdevice.h>
    42 #include <linux/inetdevice.h>
    42 #include <linux/proc_fs.h>
    43 #include <linux/proc_fs.h>
    43 #include <linux/seq_file.h>
    44 #include <linux/seq_file.h>
    44 #include <net/sock.h>
    45 #include <net/sock.h>
    45 #include <net/raw.h>
    46 #include <net/raw.h>
    48  *	Report socket allocation statistics [mea@utu.fi]
    49  *	Report socket allocation statistics [mea@utu.fi]
    49  */
    50  */
    50 static int sockstat_seq_show(struct seq_file *seq, void *v)
    51 static int sockstat_seq_show(struct seq_file *seq, void *v)
    51 {
    52 {
    52 	struct net *net = seq->private;
    53 	struct net *net = seq->private;
       
    54 	int orphans, sockets;
       
    55 
       
    56 	local_bh_disable();
       
    57 	orphans = percpu_counter_sum_positive(&tcp_orphan_count),
       
    58 	sockets = percpu_counter_sum_positive(&tcp_sockets_allocated),
       
    59 	local_bh_enable();
    53 
    60 
    54 	socket_seq_show(seq);
    61 	socket_seq_show(seq);
    55 	seq_printf(seq, "TCP: inuse %d orphan %d tw %d alloc %d mem %d\n",
    62 	seq_printf(seq, "TCP: inuse %d orphan %d tw %d alloc %d mem %d\n",
    56 		   sock_prot_inuse_get(net, &tcp_prot),
    63 		   sock_prot_inuse_get(net, &tcp_prot), orphans,
    57 		   atomic_read(&tcp_orphan_count),
    64 		   tcp_death_row.tw_count, sockets,
    58 		   tcp_death_row.tw_count, atomic_read(&tcp_sockets_allocated),
       
    59 		   atomic_read(&tcp_memory_allocated));
    65 		   atomic_read(&tcp_memory_allocated));
    60 	seq_printf(seq, "UDP: inuse %d mem %d\n",
    66 	seq_printf(seq, "UDP: inuse %d mem %d\n",
    61 		   sock_prot_inuse_get(net, &udp_prot),
    67 		   sock_prot_inuse_get(net, &udp_prot),
    62 		   atomic_read(&udp_memory_allocated));
    68 		   atomic_read(&udp_memory_allocated));
    63 	seq_printf(seq, "UDPLITE: inuse %d\n",
    69 	seq_printf(seq, "UDPLITE: inuse %d\n",
   232 	SNMP_MIB_ITEM("TCPDSACKIgnoredOld", LINUX_MIB_TCPDSACKIGNOREDOLD),
   238 	SNMP_MIB_ITEM("TCPDSACKIgnoredOld", LINUX_MIB_TCPDSACKIGNOREDOLD),
   233 	SNMP_MIB_ITEM("TCPDSACKIgnoredNoUndo", LINUX_MIB_TCPDSACKIGNOREDNOUNDO),
   239 	SNMP_MIB_ITEM("TCPDSACKIgnoredNoUndo", LINUX_MIB_TCPDSACKIGNOREDNOUNDO),
   234 	SNMP_MIB_ITEM("TCPSpuriousRTOs", LINUX_MIB_TCPSPURIOUSRTOS),
   240 	SNMP_MIB_ITEM("TCPSpuriousRTOs", LINUX_MIB_TCPSPURIOUSRTOS),
   235 	SNMP_MIB_ITEM("TCPMD5NotFound", LINUX_MIB_TCPMD5NOTFOUND),
   241 	SNMP_MIB_ITEM("TCPMD5NotFound", LINUX_MIB_TCPMD5NOTFOUND),
   236 	SNMP_MIB_ITEM("TCPMD5Unexpected", LINUX_MIB_TCPMD5UNEXPECTED),
   242 	SNMP_MIB_ITEM("TCPMD5Unexpected", LINUX_MIB_TCPMD5UNEXPECTED),
       
   243 	SNMP_MIB_ITEM("TCPSackShifted", LINUX_MIB_SACKSHIFTED),
       
   244 	SNMP_MIB_ITEM("TCPSackMerged", LINUX_MIB_SACKMERGED),
       
   245 	SNMP_MIB_ITEM("TCPSackShiftFallback", LINUX_MIB_SACKSHIFTFALLBACK),
   237 	SNMP_MIB_SENTINEL
   246 	SNMP_MIB_SENTINEL
   238 };
   247 };
   239 
   248 
   240 static void icmpmsg_put_line(struct seq_file *seq, unsigned long *vals,
   249 static void icmpmsg_put_line(struct seq_file *seq, unsigned long *vals,
   241 			     unsigned short *type, int count)
   250 			     unsigned short *type, int count)