<div dir="ltr">Thank you so much Valdis and Aruna. Probably, the problem was I tried to search more on internet rather than kernel source and after 3 hours(I know it is long), I understood that I am nowhere going in the right direction.<div>
<br><div><span style="font-family:arial,sans-serif;font-size:13px">I have the mm_struct * with me. grepping is more useful.</span><br></div></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">Thanks again to all the people who are supporting kernel newbies :)</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 25, 2014 at 10:12 PM, Aruna Hewapathirane <span dir="ltr">&lt;<a href="mailto:aruna.hewapathirane@gmail.com" target="_blank">aruna.hewapathirane@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">&gt;&gt; I want process related information like rss.(we can get this by doing cat /proc/&lt;pid&gt;status) Is there a way to get this from &gt;&gt; within a kernel module? I checked out the sources on /proc filesystem. They all show how to create, read, write a new</div>

</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">&gt;&gt; proc file. But I want to read from an existing proc file specifically /proc/&lt;pid&gt;/status
</div></blockquote><div> <br></div></div><div>Have a look here: <a href="https://gist.github.com/Aruna-Hewapathirane/f41e7291e15bae6062a1" target="_blank">https://gist.<span>github</span>.com/<span>Aruna</span>-<span>Hewapathirane</span>/f41e7291e15bae6062a1</a> does exactly what your trying to do.<br>

</div><div class=""><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>&gt;&gt; Can anyone please point me to either resources or guide me to accomplish the task of reading information from <br>

</div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">&gt;&gt;/proc/files...<br></div></blockquote><div><br></div></div>
<div>I would suggest you go through the source code for PS : <a href="http://procps.sourceforge.net/" target="_blank">http://<span>procps</span>.<span>sourceforge</span>.net/</a> and carefully study how things are done.<br>

<br></div></div>This will also help: <a href="https://www.kernel.org/doc/Documentation/filesystems/proc.txt" target="_blank">https://www.kernel.org/doc/Documentation/<span>filesystems</span>/<span>proc</span>.<span>txt</span></a><br>

<br></div><div class="gmail_extra">That being said I have to agree fully with <span>Valdis</span> the best way is always to grep through the kernel that way you get to see code that is being used and how things are done.<br>

<br></div><div class="gmail_extra">With all due respect to all the more experienced and knowledgeable folks on the list I had great difficulty when I first started out accessing information and I have no wish to see anyone who is fascinated by the kernel and wants to mess with the internals be it for fun as a hobby to learn or for serious patching and contributing to the kernel walk away frustrated like I did so many times. ( I always walked right back though... :)<br>

<br></div><div class="gmail_extra">Yes <span>Valdis</span> you can give me a hard time on <span>IRC</span> when I next show up :)<br><br>
</div><div class="gmail_extra"><span>Aruna</span> ( <span>Ravali</span>, please heed <span>Valdis&#39;s</span> advice that is the best way. I just pointed you in the right direction with a bit more code to play with but try to do your own digging first through the kernel and good luck ! )<br>

</div></div>
</blockquote></div><br></div>