Examining the process VAS
We have already covered the layout – the segments or mappings – that every process’s VAS is made up of (see the Understanding the basics of the process Virtual Address Space (VAS) section in Chapter 6, Kernel Internals Essentials – Processes and Threads). We learned that the process VAS consists of various mappings or segments; among them are text (code), data segments, library mappings, and at least one stack. Here, we will expand greatly on that discussion.
Being able to dive deep into the kernel and see various runtime values is an important skill for a developer like you (as well as for the app user, QA, sysadmin, DevOps folks, and so on). The Linux kernel provides us with an amazing interface to do precisely this – it’s, you guessed it, the proc
filesystem (procfs
).
This pseudo filesystem is always present on Linux (at least it should be) and is mounted under /proc
by default. The procfs
system has two...