[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: explanation about /proc/net



Somebody in the thread at some point said:
> Hi all
> 
> How can I find out the /proc/net info
> 
> eg: softnet_stat is for what purpose

In the kernel sources

./Documentation/filesystems/proc.txt

contains some information on /proc/net goodies.

For offroad stuff like softnet_stat though, your best friend is grepping
the kernel sources

$ cat /proc/net/softnet_stat
0cd35244 00000000 00000f10 00000000 00000000 00000000 00000000 00000000
00000000
01bde35c 00000000 00000157 00000000 00000000 00000000 00000000 00000000
00000000
$ grep softnet_stat * -R
...
core/dev.c:     if (!proc_net_fops_create("softnet_stat", S_IRUGO,
&softnet_seq_fops))
core/dev.c:     proc_net_remove("softnet_stat");

./net/core/dev.c

static int softnet_seq_show(struct seq_file *seq, void *v)
{
        struct netif_rx_stats *s = v;

        seq_printf(seq, "%08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
                   s->total, s->dropped, s->time_squeeze, 0,
                   0, 0, 0, 0, /* was fastroute */
                   s->cpu_collision );
        return 0;
}

$ grep "struct netif_rx_stats" include/* -R
include/linux/netdevice.h:struct netif_rx_stats
include/linux/netdevice.h:DECLARE_PER_CPU(struct netif_rx_stats,
netdev_rx_stat);

struct netif_rx_stats
{
        unsigned total;
        unsigned dropped;
        unsigned time_squeeze;
        unsigned cpu_collision;
};

no comments...

-Andy


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]