Read task_struct from process VM
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Read task_struct from process VM




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Read task_struct from process VM  
varma


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-13-06 12:51 PM

Hi,
I am trying to read task_struct fields from process virtual memory
using ptrace. But I am not able to do it. Can somebody tell me how can
I do it. My aim is take a process id, apply ptrace get the values of
vm_start and vm_end, and from these pages i want to read task_struct
fields of that process.

Thanks






[ Post a follow-up to this message ]



    Re: Read task_struct from process VM  
Igmar Palsenberg


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-13-06 10:54 PM

varma wrote:
> Hi,
> I am trying to read task_struct fields from process virtual memory
> using ptrace. But I am not able to do it. Can somebody tell me how can
> I do it.

You can't. task_struct is something that belongs to kernelspace, and you
can't read that from userspace.

> My aim is take a process id, apply ptrace get the values of
> vm_start and vm_end, and from these pages i want to read task_struct
> fields of that process.

That won't work.



Igmar





[ Post a follow-up to this message ]



    Re: Read task_struct from process VM  
varma


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-13-06 10:54 PM

Thanks. I want to trace all the processes as they started in Linux, so
that when the process exits, I will get control of the process being
traced, and using pid of that process i can get task_struct and, I can
read the process information(I/O, Mem, CPU time etc.). How can I do
this. Is it possible to do it.

I think i have to do it as kernel module, since get_task_by_pid can be
used from kernel module.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:00 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register