Skip to contentSkip to conversation

/proc/{diskstats,schedstat,vmstat} documentation

DISCUSSION Marko Myllynen 2 participants 3 messages May 13, 2015 2 messages not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

Hi Michael,

it seems that /proc/vmstat is undocumented in proc(5), is it just because nobody has written the documentation yet or are some files considered out of scope for proc(5)? Other such "interesting" file which would be nice to have documented in-line is IMHO /proc/diskstats.

FWIW, for /proc/vmstat first search hit is
http://www.linuxinsight.com/proc_vmstat.html which looks decent.

I also see that /proc/schedstat and /proc/<pid>/schedstat are missing, some information about them can be found at
http://eaglet.rain.com/rick/linux/schedstat/v15/format-15.html and
https://www.kernel.org/doc/Documentation/scheduler/sched-stats.txt.

Lastly, /proc/<pid>/{loginuid,sessionid} are missing.

PS. Yes, I think I try to provide patches at least for a couple of these cases if time permits.

Thanks,

Signature · 5 lines
Marko Myllynen
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi Marko,

Quoted 6 lines · Marko Myllynen

Hi Michael,

it seems that /proc/vmstat is undocumented in proc(5), is it just because nobody has written the documentation yet or are some files considered out of scope for proc(5)? Other such "interesting" file which would be nice to have documented in-line is IMHO /proc/diskstats.

It's just because no one has taken the time... There are in fact many holes in proc(5) :-(.

Quoted 2 lines

FWIW, for /proc/vmstat first search hit is
http://www.linuxinsight.com/proc_vmstat.html which looks decent.

Well, it has some of the needed info, but there's many more entries in the file than are listed there.

Quoted 9 lines

I also see that /proc/schedstat and /proc/<pid>/schedstat are missing, some information about them can be found at
http://eaglet.rain.com/rick/linux/schedstat/v15/format-15.html and
https://www.kernel.org/doc/Documentation/scheduler/sched-stats.txt.

Lastly, /proc/<pid>/{loginuid,sessionid} are missing.

PS. Yes, I think I try to provide patches at least for a couple of these cases if time permits.

That would be great.

Thanks,

Michael

Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hi Marko,

Quoted 24 lines · Michael Kerrisk (man-pages)

Hi Marko,

Quoted 6 lines · Marko Myllynen

Hi Michael,

it seems that /proc/vmstat is undocumented in proc(5), is it just because nobody has written the documentation yet or are some files considered out of scope for proc(5)? Other such "interesting" file which would be nice to have documented in-line is IMHO /proc/diskstats.

It's just because no one has taken the time... There are in fact many holes in proc(5) :-(.

Quoted 2 lines

FWIW, for /proc/vmstat first search hit is
http://www.linuxinsight.com/proc_vmstat.html which looks decent.

Well, it has some of the needed info, but there's many more entries in the file than are listed there.

Quoted 5 lines

I also see that /proc/schedstat and /proc/<pid>/schedstat are missing, some information about them can be found at
http://eaglet.rain.com/rick/linux/schedstat/v15/format-15.html and
https://www.kernel.org/doc/Documentation/scheduler/sched-stats.txt.

Quoted 6 lines
Quoted 4 lines

Lastly, /proc/<pid>/{loginuid,sessionid} are missing.

PS. Yes, I think I try to provide patches at least for a couple of these cases if time permits.

That would be great.

So, in case you decide to pursue this, here's a little script I whipped up that tells you about version changes in /proc/vmstat since Linux 2.6.12 (git start).

Clone yourself a fresh git tree; chdir into the tree, and run the script.

Knowing the kernel version umber then let's you find the corresponding commit more easily, and there for each file you might find some info in the commit message explaining what the file is about.

Cheers,

Michael

#! /bin/sh
# Generate a history /proc/vmstat changes
#
# 1. Clone a fresh "linux" git repo
# 2. chdir to the root directory
# 3. Run this script
#
lfunc() {
FILE=$(git grep -l vmstat_text $1)
cat $FILE | sed '1,/^[cs].*vmstat_text/d' | sed '/^}/,$d' |

        sed 's%\/\*.*\*\/%%' | sed '/^[         ]*$/d' | sed 's/[",]//g' |
        awk '
                {
                    if ($1 == "#ifdef") {
                        lname[lev] = $2
                        lev++;
                    } else if ($1 == "#endif") {
                        lev--;
                    } else {
                        printf "%s", $0
                        for (l = 0; l < lev; l++)
                            printf "\t%s", lname[l]
                        print ""
                    }

                }
        ' | sed 's/^[   ]*//'

}

VERSIONS=$(git tag -l|grep -v -- '-'|grep '^v'| grep -v 'v2.6.11')

for v in $VERSIONS; do

     echo "======== $v"
     git checkout -fq $v
     lfunc mm > vmstat-$v;

done

c=0
for v in $VERSIONS; do

        if test $c -gt 0; then
                echo "================ $v"
                diff -u vmstat-$prev vmstat-$v
        fi
        c=$(expr $c + 1)
        prev=$v;

done | less
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html