This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: How to understand the pid() and new_pid are same value in executing forktracker.stp?
- From: Josh Stone <jistone at redhat dot com>
- To: Nan Xiao <xiaonan830818 at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Thu, 22 Oct 2015 18:38:39 -0700
- Subject: Re: How to understand the pid() and new_pid are same value in executing forktracker.stp?
- Authentication-results: sourceware.org; auth=none
- References: <CA+MhoaM4a=mNdmz4m7pHi9s4SkqhXhV5S8V4cUZT+rAXFasRAQ at mail dot gmail dot com> <562982A1 dot 4020600 at redhat dot com> <CA+MhoaPtthXSmQQab1zHeY+LqcHga5Gs5cC9vzpyRzCLTo2m6g at mail dot gmail dot com>
On 10/22/2015 06:29 PM, Nan Xiao wrote:
> I remember in Linux, the process is actually a thread, or LWP, right?
> If it is true, I think the pid() is also tid().
That's what I tried to explain here:
>> Note that we use the POSIX terminology with pid=process and tid=thread,
>> versus the kernel with pid=task-id and tgid=thread-group-id. Every user
>> thread has a task, and a thread group is roughly a user process.
So stap's pid = task_struct->tgid, and stap's tid = task_struct->pid.