[PATCH]add termination-signal in __fork_flags()'s output

Zhaolei zhaolei@cn.fujitsu.com
Wed Jun 11 15:01:00 GMT 2008


Hi -

This patch adds termination-signal in __fork_flags()'s output.

For example:
syscall.fork's argstr before patch:
  CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID
syscall.fork's argstr after patch:
  CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD

If no objection, I will commit it.

Signed-off-by: "Zhaolei" zhaolei@cn.fujitsu.com

diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp
index 2bd2ced..0a02271 100644
--- a/tapset/aux_syscalls.stp
+++ b/tapset/aux_syscalls.stp
@@ -1705,7 +1705,13 @@ const _stp_val_array const _stp_fork_list[] = {

 function __fork_flags:string(flags:long)
 %{ /* pure */
- _stp_lookup_or_str(_stp_fork_list, THIS->flags, THIS->__retvalue, MAXSTRINGLEN);
+ _stp_lookup_or_str(_stp_fork_list, THIS->flags & ~0xff, THIS->__retvalue, MAXSTRINGLEN);
+ if ( THIS->flags & 0xff ) {
+  /* flags contains the termination signal */
+  if (*THIS->__retvalue)
+   strlcat(THIS->__retvalue, "|", MAXSTRINGLEN);
+  _stp_lookup_str(_stp_signal_list, THIS->flags & 0xff, THIS->__retvalue, MAXSTRINGLEN);
+ }
 %}

 %{

Regards
Zhaolei


More information about the Systemtap mailing list