Thread (7 messages) 7 messages, 3 authors, 2010-02-28

Re: Adding inode field to /proc/net/netlink

From: Masatake YAMATO <hidden>
Date: 2010-02-28 09:23:15

From: Masatake YAMATO <redacted>
Date: Sun, 28 Feb 2010 14:45:37 +0900 (JST)
quoted
The Inode field in /proc/net/{tcp,udp,packet,raw,...} is useful to know the types of 
file descriptors associated to a process. Actually lsof utility uses the field.
Unfortunately, unlike /proc/net/{tcp,udp,packet,raw,...}, /proc/net/netlink doesn't have the field.
This patch adds the field to /proc/net/netlink.

Signed-off-by: Masatake YAMATO <redacted>
Unfortunately we cannot add new fields without breaking the parsing
done by existing applications.
I understood but it has been already breaking:

    [yamato@xxx /proc/net]$ uname -a; cat /proc/net/netlink 
    Linux xxx.redhat.com 2.6.29.6-217.2.16.fc11.x86_64 #1 SMP Mon Aug 24 17:17:40 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
    sk       Eth Pid    Groups   Rmem     Wmem     Dump     Locks
    ffff8801bbde0400 0   2758   00000111 0        0        (null) 2
    ...

    [yamato@yyy /proc/net]$ uname -a; cat /proc/net/netlink 
    Linux yyy.redhat.com 2.6.30.10-105.2.23.fc11.x86_64 #1 SMP Thu Feb 11 07:06:34 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
    sk       Eth Pid    Groups   Rmem     Wmem     Dump     Locks     Drops
    ffff8800d83f5800 0   1783   00000001 0        0        (null) 2        0       

Drops field may be added between 2.6.29 and 2.6.30.
Adding one more field is really problem?
In other word, why "Drops" field was acceptable?

lsof uses following technique. It parses the header raw
(here "    sk       Eth Pid    Groups   Rmem     Wmem     Dump     Locks     Drops")
and picks values from columns only if the columns exits in the header raw.
e.g. If "Inode" exists in the header, lsof tries to use Inode value.
With the technique just adding(not deleting or swapping) a new column is not a big problem.

Masatake YAMATO
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help