Linux Kernel Architecture

(Jacob Rumans) #1

Chapter 10: Filesystems without Persistent Storage


-rw-r--r-- 1 wolfgang users 0 2008-02-15 04:22 loginuid
-r--r--r-- 1 wolfgang users 0 2008-02-15 04:22 maps
-rw------- 1 wolfgang users 0 2008-02-15 04:22 mem
-r--r--r-- 1 wolfgang users 0 2008-02-15 04:22 mounts
-r-------- 1 wolfgang users 0 2008-02-15 04:22 mountstats
-r--r--r-- 1 wolfgang users 0 2008-02-15 04:22 numa_maps
-rw-r--r-- 1 wolfgang users 0 2008-02-15 04:22 oom_adj
-r--r--r-- 1 wolfgang users 0 2008-02-15 04:22 oom_score
lrwxrwxrwx 1 wolfgang users 0 2008-02-15 04:22 root -> /
-rw------- 1 wolfgang users 0 2008-02-15 04:22 seccomp
-r--r--r-- 1 wolfgang users 0 2008-02-15 04:22 smaps
-r--r--r-- 1 wolfgang users 0 2008-02-15 00:56 stat
-r--r--r-- 1 wolfgang users 0 2008-02-15 01:30 statm
-r--r--r-- 1 wolfgang users 0 2008-02-15 00:56 status
dr-xr-xr-x 3 wolfgang users 0 2008-02-15 04:22 task
-r--r--r-- 1 wolfgang users 0 2008-02-15 04:22 wchan

Our example shows the data for anemacsprocess with the PID 7,748 as used to edit the LaTeX sources
of this book.

The meanings of most entries are evident from the filename. For instance,cmdlineis the command line
used to start the process — that is, the name of the program including all parameters as a string:

The kernel does not use normal blanks to separate elements but NUL bytes as used
in C to indicate the end of a string.

wolfgang@meitner>cat cmdline
emacsfs.tex

Theodtool can be used to convert the data to a readable format:

wolfgang@meitner>od -t a /proc/7748/cmdline
0000000 emacsnulfs.texnul
0000015

The above output makes it clear that the process was called byemacs fs.tex.

The other files contain the following data:

❑ environindicates all environment variables set for the program; again, NUL characters are used
as separators instead of blanks.
❑ All memory mappings to libraries (and to the binary file itself) used by the process are listed
in text form inmaps. In the case ofemacs, an excerpt from this file would look like this (I use a
regular text format without NUL characters):
wolfgang@meitner>cat maps
00400000-005a4000 r-xp 00000000 08:05 283752
/usr/bin/emacs
007a3000-00e8c000 rw-p 001a3000 08:05 283752
/usr/bin/emacs
00e8c000-018a1000 rw-p 00e8c000 00:00 0 [heap]
2af4b085d000-2af4b0879000 r-xp 00000000 08:05 1743619
Free download pdf