How to get the information from /proc/files from within a kernel module?

ravali pullela rpravali069 at gmail.com
Mon Aug 25 10:27:39 EDT 2014


Hi all,

I want process related information like rss.(we can get this by doing cat
/proc/<pid>status) Is there a way to get this from within a kernel module?
I checked out the sources on /proc filesystem. They all show how to create,
read, write a new proc file. But I want to read from an existing proc file
specifically /proc/<pid>/status

I could not find rss info of a process from its task struct in kernel
version 3.10.

I tried to look inside kernel to know how and where are these values (rss
and all) are calculated by kernel. But I could not track it.

Can anyone please point me to either resources or guide me to accomplish
the task of reading information from /proc/files...

I looked up call_usermodehelper but did not find it useful for my need.

Thanks !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140825/e9bea750/attachment-0001.html 


More information about the Kernelnewbies mailing list