This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Use pid2task when passing pid to task_execname(v2)


In v2 the case when pid2task returns NULL is handled.
Suggested by Josh Stone <jistone@redhat.com>.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
---
 tapset/linux/signal.stp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tapset/linux/signal.stp b/tapset/linux/signal.stp
index 48b7f5f..b529f5f 100644
--- a/tapset/linux/signal.stp
+++ b/tapset/linux/signal.stp
@@ -464,13 +464,15 @@ probe signal.force_segv.return =
  * @sig_name: A string representation of the signal
  * @sig_pid: The PID of the process receiving the signal
  * @pid_name: The name of the signal recipient
+ * @task: A task handle to the signal recipient
  */
 probe signal.syskill = syscall.kill
 {
     name = "syskill"
     sig_name = _signal_name($sig)
     sig_pid = $pid
-    pid_name = task_execname($pid)
+    task = pid2task($pid)
+    pid_name = task? task_execname(task): ""
 }
 
 /**
@@ -488,6 +490,7 @@ probe signal.syskill.return = syscall.kill.return
  * @pid_name: The name of the signal recipient
  * @sig: The specific signal sent to the process
  * @sig_name: A string representation of the signal
+ * @task: A task handle to the signal recipient
  *
  * The tkill call is analogous to kill(2),
  * except that it also allows a process within a specific thread group to
@@ -499,7 +502,8 @@ probe signal.systkill = syscall.tkill
     name = "systkill"
     sig_name = _signal_name($sig)
     sig_pid = $pid
-    pid_name = task_execname($pid)
+    task = pid2task($pid)
+    pid_name = task? task_execname(task): ""
 }
 
 /**
@@ -520,6 +524,7 @@ probe signal.systkill.return = syscall.tkill.return
  * @tgid: The thread group ID of the thread receiving the kill signal
  * @sig: The specific kill signal sent to the process
  * @sig_name: A string representation of the signal
+ * @task: A task handle to the signal recipient
  *
  * The tgkill call is similar to tkill,
  * except that it also allows the caller to specify the thread group ID of
@@ -530,7 +535,8 @@ probe signal.systgkill = syscall.tgkill
     name = "systgkill"
     sig_name = _signal_name($sig)
     sig_pid = $pid
-    pid_name = task_execname($pid)
+    task = pid2task($pid)
+    pid_name = task? task_execname(task): ""
 }
 
 /**
-- 
1.9.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]