summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfche <fche>2005-11-09 17:08:19 +0000
committerfche <fche>2005-11-09 17:08:19 +0000
commit61df7c736e8d2388b4236b4eb8eaf32ab09d3cf7 (patch)
tree85d4beaac5ff07d833d02fa171b6c54a38aab026
parent549b9c3b29bafc954f097ff7cca83e979c52751e (diff)
downloadsystemtap-steved-61df7c736e8d2388b4236b4eb8eaf32ab09d3cf7.tar.gz
systemtap-steved-61df7c736e8d2388b4236b4eb8eaf32ab09d3cf7.tar.xz
systemtap-steved-61df7c736e8d2388b4236b4eb8eaf32ab09d3cf7.zip
2005-11-09 Frank Ch. Eigler <fche@elastic.org>
Reported by Guang Lei Li <liguangl@cn.ibm.com>: * tapset/context.stp (pid,ppid,tid): Correctly pick tgid vs pid. * testsuite/buildok/context_test.stp: Print out tid() too.
-rw-r--r--ChangeLog6
-rw-r--r--tapset/context.stp11
-rwxr-xr-xtestsuite/buildok/context_test.stp1
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 <fche@elastic.org>
+
+ Reported by Guang Lei Li <liguangl@cn.ibm.com>:
+ * 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 <fche@redhat.com>
* 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()))