public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "Zhaolei" <zhaolei@cn.fujitsu.com>
To: <systemtap@sourceware.org>
Cc: "Zhaolei" <zhaolei@cn.fujitsu.com>
Subject: [patch] Modify flag's value in tapset's probe delete_module
Date: Mon, 03 Sep 2007 12:48:00 -0000	[thread overview]
Message-ID: <006d01c7edd9$55a2b080$85697c0a@guest004> (raw)
In-Reply-To: <1188780895.5736.ezmlm@sourceware.org>

Hi, everyone

In the probe delete_module(syscalls.stp), function _module_flags_str
 (aux_syscalls.stp) is used for converting the flags to string. But the
 returned string is different from the man page of delete_module:

delete_module's flag values in "man delete_module"(RHEL5,IA64) is O_TRUNC
 and O_NONBLOCK, but in probe delete_module, flag's value is WAIT and FORCE
 (From other non-intel-arch?).

Is there anyone knows why tapset uses WAIT/FORCE values for delete_module's
 flag, please tell me(or I will modify it unify with man).

And there may be another problem exists in delete_module's probe:
O_TRUNC and O_NONBLOCK's value is different between architectures, so I
 think it is better using defined value for compare with flag's value.
 (It we use static value as 2048/512, it will get different result across
 architectures):

I write a patch for this problem:
and if no objection, I will commit it.

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

function _module_flags_str:string(flags:long)
--- aux_syscalls.stp.old 2007-08-24 15:35:05.000000000 +0900
+++ aux_syscalls.stp 2007-08-24 15:34:44.000000000 +0900
@@ -1131,11 +1131,19 @@ function _mlockall_flags_str:string(flag
 %}
 
 /* used by sys_delete_module */
-function _module_flags_str(f) { 
-   if(!(f & 2048)) bs="WAIT|"
-   if(f & 512) bs=bs."FORCE|"
-   return substr(bs,0,strlen(bs)-1)
-}
+function _module_flags_str:string(flags:long)
+%{ /* pure */
+ int len;
+ long flags = THIS->flags;
+ char *str = THIS->__retvalue;
+ if (flags & O_TRUNC)
+  strlcat(str,"O_TRUNC|", MAXSTRINGLEN);
+ if (flags & O_NONBLOCK)
+  strlcat(str,"O_NONBLOCK|", MAXSTRINGLEN);
+        len = strlen(str);
+        if (len)
+                str[strlen(str)-1] = 0;
+%}
 
 function _sched_policy_str(policy) {
    if(policy==0) return "SCHED_OTHER"

Regards
Zhaolei

       reply	other threads:[~2007-09-03  3:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1188780895.5736.ezmlm@sourceware.org>
2007-09-03 12:48 ` Zhaolei [this message]
2007-09-05 14:46   ` [patch] For memory access error when calling _stp_sockaddr_str with addrlen set to 0 Zhaolei
2007-09-05 22:49     ` Frank Ch. Eigler
2007-09-10  5:03     ` [patch] For getrusage's argstr in tapset Zhaolei
2007-09-10  5:21       ` Wenji Huang
2007-09-10  9:28         ` Zhaolei
2007-09-10 14:01           ` Wenji Huang
2007-09-13 16:06             ` Zhaolei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='006d01c7edd9$55a2b080$85697c0a@guest004' \
    --to=zhaolei@cn.fujitsu.com \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).