From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6362 invoked by alias); 3 Sep 2007 03:21:35 -0000 Received: (qmail 6355 invoked by uid 22791); 3 Sep 2007 03:21:34 -0000 X-Spam-Status: No, hits=0.2 required=5.0 tests=AWL,BAYES_50,DK_POLICY_SIGNSOME,DNS_FROM_RFC_ABUSE X-Spam-Check-By: sourceware.org Received: from fgwmail7.fujitsu.co.jp (HELO fgwmail7.fujitsu.co.jp) (192.51.44.37) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 03 Sep 2007 03:21:28 +0000 Received: from m1.gw.fujitsu.co.jp ([10.0.50.71]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id l833LOdx010320 for (envelope-from zhaolei@cn.fujitsu.com); Mon, 3 Sep 2007 12:21:24 +0900 Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 91DFF24004D for ; Mon, 3 Sep 2007 12:21:24 +0900 (JST) Received: from s10.gw.fujitsu.co.jp (s10.gw.fujitsu.co.jp [10.0.50.80]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 69BB62DC07E for ; Mon, 3 Sep 2007 12:21:24 +0900 (JST) Received: from s10.gw.fujitsu.co.jp (s10 [127.0.0.1]) by s10.gw.fujitsu.co.jp (Postfix) with ESMTP id 5AB8B161C011 for ; Mon, 3 Sep 2007 12:21:24 +0900 (JST) Received: from vs01.gw.fujitsu.co.jp (vs01.gw.fujitsu.co.jp [133.161.11.21]) by s10.gw.fujitsu.co.jp (Postfix) with ESMTP id 5F6CE161C008 for ; Mon, 3 Sep 2007 12:21:23 +0900 (JST) Received: from root01.fujitsu.com (root01.fujitsu.com [133.161.11.11]) by vs01.gw.fujitsu.co.jp (8.13.7/8.13.7) with ESMTP id l833LNmJ005746 for ; Mon, 3 Sep 2007 12:21:23 +0900 Received: from root01.fujitsu.com (root01 [127.0.0.1]) by root01.fujitsu.com (Postfix) with ESMTP id 2EABF282C7D; Mon, 3 Sep 2007 12:21:23 +0900 (JST) Received: from guest004 (unknown [10.124.105.133]) by root01.fujitsu.com (Postfix) with SMTP id CB5FE282BF1; Mon, 3 Sep 2007 12:21:22 +0900 (JST) Message-ID: <006d01c7edd9$55a2b080$85697c0a@guest004> From: "Zhaolei" To: Cc: "Zhaolei" References: <1188780895.5736.ezmlm@sourceware.org> Subject: [patch] Modify flag's value in tapset's probe delete_module Date: Mon, 03 Sep 2007 12:48:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00488.txt.bz2 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