Re: How to get object virtual address from a kernel core dump

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




task_struct contains mm_struct.

If we have pid of the process then task_struct can be obtained from pid using following two methods.

1.
Please check find_task_by_pid() function in kernel. We can write a similar macro to convert pid to task_struct.

2. We can write a macro that traverses all task starting from init_task and check the required pid.

#define for_each_task(p) \
        for (p = &init_task ; (p = p->next_task) != &init_task ; )


If process is the current one then current_thread_info()->task provides task_struct for current task.
We can write a macro similar to current_thread_info().

pid-> task_struct->mm_struct.

Regards
Manoj Nayak

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux