summaryrefslogtreecommitdiffstats
path: root/tapset
diff options
context:
space:
mode:
authorMalte Nuhn <nuhn@physik.rwth-aachen.de>2009-05-08 12:20:33 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-05-08 12:20:33 -0400
commite361ac2bdb6f1996e020a5612cec71762b556e25 (patch)
treedf4cb5075d375b7e698fb8317d753adaa6bb5b97 /tapset
parent07f8225311f85de5754bb594bf6ee945425dafcc (diff)
downloadsystemtap-steved-e361ac2bdb6f1996e020a5612cec71762b556e25.tar.gz
systemtap-steved-e361ac2bdb6f1996e020a5612cec71762b556e25.tar.xz
systemtap-steved-e361ac2bdb6f1996e020a5612cec71762b556e25.zip
context tapset: sid() function to return task session leader pid
Diffstat (limited to 'tapset')
-rw-r--r--tapset/context.stp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tapset/context.stp b/tapset/context.stp
index fcb60201..5d855f80 100644
--- a/tapset/context.stp
+++ b/tapset/context.stp
@@ -64,6 +64,18 @@ function ppid:long () %{ /* pure */
%}
/**
+ * sfunction sid - Returns the session ID of the current process.
+ *
+ * The session ID of a process is the process group ID of the session
+ * leader. Session ID is stored in the signal_struct since Kernel 2.6.0.
+ */
+function sid:long () %{ /* pure */
+ struct signal_struct *ss = kread( &(current->signal) );
+ THIS->__retvalue = kread ( &(ss->session) );
+ CATCH_DEREF_FAULT();
+%}
+
+/**
* sfunction pexecname - Returns the execname of a target process's parent process.
*/
function pexecname:string () %{ /* pure */