pid is currently equal to the Linux-side PID: i.e., from userspace's
perspective, the thread ID. tgid is equal to the thread ID of the parent. Both
of these are at best inconvenient and at worst wrong: they should both use the
thread group ID of their respective task, which corresponds to the
userspace-visible PID.
Orabug:
18412802
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
* It is always safe to dereference current, it always points
* to a valid task_struct.
*/
- return (uint64_t)current->pid;
+ return (uint64_t)current->tgid;
case DIF_VAR_PPID:
if (!dtrace_priv_proc(state))
* Additionally, it is safe to dereference one's parent, since
* it is never NULL after process birth.
*/
- return (uint64_t)current->real_parent->pid;
+ return (uint64_t)current->real_parent->tgid;
case DIF_VAR_TID:
return (uint64_t)current->pid;