From 61df7c736e8d2388b4236b4eb8eaf32ab09d3cf7 Mon Sep 17 00:00:00 2001 From: fche Date: Wed, 9 Nov 2005 17:08:19 +0000 Subject: 2005-11-09 Frank Ch. Eigler Reported by Guang Lei Li : * tapset/context.stp (pid,ppid,tid): Correctly pick tgid vs pid. * testsuite/buildok/context_test.stp: Print out tid() too. --- ChangeLog | 6 ++++++ tapset/context.stp | 11 +++++++++-- testsuite/buildok/context_test.stp | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8dea6bdb..5cf483cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-11-09 Frank Ch. Eigler + + Reported by Guang Lei Li : + * tapset/context.stp (pid,ppid,tid): Correctly pick tgid vs pid. + * testsuite/buildok/context_test.stp: Print out tid() too. + 2005-11-08 Frank Ch. Eigler * tapsets.cxx (blacklisted_p): Tolerate NULL filename parameter. diff --git a/tapset/context.stp b/tapset/context.stp index 81604d83..0075150d 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -40,14 +40,21 @@ function pid:long () %{ if (unlikely(in_interrupt())) THIS->__retvalue = 0; else - THIS->__retvalue = current->pid; + THIS->__retvalue = current->tgid; +%} + +function tid:long () %{ + if (unlikely(in_interrupt())) + THIS->__retvalue = 0; + else + THIS->__retvalue = current->pid; %} function ppid:long () %{ if (unlikely(in_interrupt() || !current->parent)) THIS->__retvalue = 0; else - THIS->__retvalue = current->parent->pid; + THIS->__retvalue = current->parent->tgid; %} function pexecname:string () %{ diff --git a/testsuite/buildok/context_test.stp b/testsuite/buildok/context_test.stp index c85bce67..c732999d 100755 --- a/testsuite/buildok/context_test.stp +++ b/testsuite/buildok/context_test.stp @@ -10,6 +10,7 @@ function print_stuff () { print("\n\n") log("execname is \"" . execname() . "\"") log("pid is " . string(pid())) + log("tid is " . string(tid())) log("pexecname is \"" . pexecname() . "\"") log("ppid is " . string(ppid())) log("uid is " . string(uid())) -- cgit