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, and among them are text (code), data segments, library mappings, and at least one stack. Here, we 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 the user, QA, sysadmin, DevOps, 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 is always present on Linux (at least it should be) and is mounted under /proc. The procfs system has two...