From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9016 invoked by alias); 21 Sep 2007 07:07:16 -0000 Received: (qmail 8884 invoked by uid 22791); 21 Sep 2007 07:07:15 -0000 X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL,BAYES_50,DK_POLICY_SIGNSOME,DNS_FROM_RFC_ABUSE X-Spam-Check-By: sourceware.org Received: from fgwmail5.fujitsu.co.jp (HELO fgwmail5.fujitsu.co.jp) (192.51.44.35) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Sep 2007 07:07:09 +0000 Received: from m4.gw.fujitsu.co.jp ([10.0.50.74]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id l8L775wd029283 for (envelope-from zhaolei@cn.fujitsu.com); Fri, 21 Sep 2007 16:07:06 +0900 Received: from smail (m4 [127.0.0.1]) by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id A407B2AC042 for ; Fri, 21 Sep 2007 16:07:05 +0900 (JST) Received: from s10.gw.fujitsu.co.jp (s10.gw.fujitsu.co.jp [10.0.50.80]) by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 7CD7B12C0B8 for ; Fri, 21 Sep 2007 16:07:05 +0900 (JST) Received: from s10.gw.fujitsu.co.jp (s10 [127.0.0.1]) by s10.gw.fujitsu.co.jp (Postfix) with ESMTP id 6ED62161C00F for ; Fri, 21 Sep 2007 16:07:05 +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 B3D45161C008 for ; Fri, 21 Sep 2007 16:07:04 +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 l8L774bw016382 for ; Fri, 21 Sep 2007 16:07:04 +0900 Received: from root01.fujitsu.com (root01 [127.0.0.1]) by root01.fujitsu.com (Postfix) with ESMTP id 32368282CCC; Fri, 21 Sep 2007 16:07:04 +0900 (JST) Received: from guest004 (unknown [10.124.105.133]) by root01.fujitsu.com (Postfix) with SMTP id 3949C282CCE; Fri, 21 Sep 2007 16:07:03 +0900 (JST) Message-ID: <02cd01c7fc1d$f76ceaf0$85697c0a@guest004> From: "Zhaolei" To: Cc: "Zhaolei" References: <46F22F2D.8030705@cn.fujitsu.com> Subject: [Patch]Improve retstr of syscall.adjtimex.return in tapset Date: Fri, 21 Sep 2007 12:16:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" 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/msg00666.txt.bz2 Hi, everyone In kernel, adjtimex syscall's return value have following types: #define TIME_OK 0 /* clock synchronized */ #define TIME_INS 1 /* insert leap second */ #define TIME_DEL 2 /* delete leap second */ #define TIME_OOP 3 /* leap second in progress */ #define TIME_WAIT 4 /* leap second has occurred */ #define TIME_BAD 5 /* clock not synchronized */ Current version of tapset can only display return value's error string, and display only digital number when return value have other meaning. For example, when call adjtimex twice(return 5 and -14) Current version of stap's retstr is like: 5 -14 (EFAULT) I think is may be a good idea to print return value's type string in retstr like following: 5 (TIME_BAD) -14 (EFAULT) If no objection, I will commit this patch: Signed-off-by: "Zhaolei" zhaolei@cn.fujitsu.com diff -up old/aux_syscalls.stp new/aux_syscalls.stp --- old/aux_syscalls.stp 2007-08-30 16:24:49.000000000 +0900 +++ new/aux_syscalls.stp 2007-08-30 16:23:44.000000000 +0900 @@ -1750,3 +1750,35 @@ function _at_flag_str(f) { if (f == 0x100) return "AT_SYMLINK_NOFOLLOW" return sprintf("0x%x", f) } + +function _adjtimex_return_str(ret) { + if ( ret == 0 ) + { + return sprintf("%d %s", ret, "(TIME_OK)") + } + if ( ret == 1 ) + { + return sprintf("%d %s", ret, "(TIME_INS)") + } + if ( ret == 2 ) + { + return sprintf("%d %s", ret, "(TIME_DEL)") + } + if ( ret == 3 ) + { + return sprintf("%d %s", ret, "(TIME_OOP)") + } + if ( ret == 4 ) + { + return sprintf("%d %s", ret, "(TIME_WAIT)") + } + if ( ret == 5 ) + { + return sprintf("%d %s", ret, "(TIME_BAD)") + } + return returnstr(1) +} + diff -up old/syscalls.stp new/syscalls.stp --- old/syscalls.stp 2007-08-30 16:24:34.000000000 +0900 +++ new/syscalls.stp 2007-08-30 16:23:51.000000000 +0900 @@ -113,7 +113,7 @@ probe syscall.adjtimex = kernel.function } probe syscall.adjtimex.return = kernel.function("sys_adjtimex").return { name = "adjtimex" - retstr = returnstr(1) + retstr = _adjtimex_return_str($return) } # long compat_sys_adjtimex(struct compat_timex __user *utp) Regards Zhaolei