Linux内核如何创建/ proc / $ pid / maps文件?

时间:2022-06-12 13:00:52

I am doing some memory introspection and it requires me to know how proc/$pid/maps is created. I'm a bit confused by the code found in http://lxr.free-electrons.com/source/fs/proc/base.c on line 2750 I notice that there is a definition in this struct for maps but I want to know for each pid_entry which kernel function creates the maps file. A link to the kernel module or block of code is sufficient.

我正在做一些内存自省,它需要我知道如何创建proc / $ pid / maps。我对第2750行http://lxr.free-electrons.com/source/fs/proc/base.c中的代码感到有点困惑我注意到这个结构中有一个地图定义,但我想要知道每个pid_entry哪个内核函数创建了map文件。链接到内核模块或代码块就足够了。

1 个解决方案

#1


2  

You did something weird with the link.

你用链接做了一些奇怪的事。

Clicking through few definitions reveals the file is generated on demand here: http://lxr.free-electrons.com/source/fs/proc/task_mmu.c#L270

点击几个定义可以看到文件是按需生成的:http://lxr.free-electrons.com/source/fs/proc/task_mmu.c#L270

(at least for the common mmu case)

(至少对于常见的mmu情况)

the usual question: why are you asking?

通常的问题:你为什么这么问?

#1


2  

You did something weird with the link.

你用链接做了一些奇怪的事。

Clicking through few definitions reveals the file is generated on demand here: http://lxr.free-electrons.com/source/fs/proc/task_mmu.c#L270

点击几个定义可以看到文件是按需生成的:http://lxr.free-electrons.com/source/fs/proc/task_mmu.c#L270

(at least for the common mmu case)

(至少对于常见的mmu情况)

the usual question: why are you asking?

通常的问题:你为什么这么问?