From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12184 invoked by alias); 7 Jun 2006 08:17:03 -0000 Received: (qmail 12175 invoked by uid 22791); 7 Jun 2006 08:17:02 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mga01.intel.com (HELO fmsmga101-1.fm.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 07 Jun 2006 08:17:00 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101-1.fm.intel.com with ESMTP; 07 Jun 2006 01:16:58 -0700 Received: from maobb.sh.intel.com (HELO [10.239.13.186]) ([10.239.13.186]) by fmsmga001.fm.intel.com with ESMTP; 07 Jun 2006 01:16:55 -0700 X-IronPort-AV: i="4.05,216,1146466800"; d="scan'208"; a="48252022:sNHT154756119" Message-ID: <44868B03.70108@intel.com> Date: Wed, 07 Jun 2006 08:17:00 -0000 From: "bibo,mao" User-Agent: Thunderbird 1.5.0.2 (X11/20060420) MIME-Version: 1.0 To: Masami Hiramatsu CC: "Keshavamurthy, Anil S" , Ananth N Mavinakayanahalli , SystemTAP , Yumiko Sugita , Satoshi Oshima , Hideo Aoki , Prasanna S Panchamukhi , Jim Keniston Subject: Re: [PATCH]kprobe booster for IA64 References: <4485223C.8090109@sdl.hitachi.co.jp> In-Reply-To: <4485223C.8090109@sdl.hitachi.co.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q2/txt/msg00576.txt.bz2 hiramatu san, If the probed instruction can cause one fault, there may be some problem. Because original instruction is copied into 2nd element of ainsn.insn, instruction execution address is different, search_exception_tables result will be different also. Thanks bibo,mao Masami Hiramatsu wrote: > Hi, Anil and Ananth > > I ported the kprobe-booster to the IA64 architecture. > This patch can be applied against 2.6.17-rc5-mm3. > And here is the patch. Could you review it? > > This patch modifies kprobe as below; > - Boost if the target bundle don't use B and X unit. > - Introduce INST_FLAG_BOOSTABLE value for ainsn.insn_flag. > If this flag is set, the kprobe is boostable. > - Change instruction buffer(ainsn.insn) to an array of > bundles which has three elements. The 2nd element and the > 3rd element of this array are used for dynamic execution. > > And this patch is Lindent clean ;) > > I measured the overhead of the booster by using > the benchmark kernel module attached to this mail. > > noprobe: 436 machine cycles > noboost: 1162 machine cycles > boosted: 829 machine cycles > > CPU spec: Itanium2 1.3GHz (2CPUs) > > > > ------------------------------------------------------------------------ > > /* > * boost probe bench > * Copyright (c) 2006 Hitachi,Ltd., > * Created by Masami Hiramatsu > */ > #include > #include > #include > #include > > MODULE_AUTHOR("M.Hiramatsu"); > MODULE_LICENSE("GPL"); > > int dummy_function(int n) > { > int k,l=0; > for (k=1; k l += (k + 1) / k; > } > return l; > } > > static int probe_handler (struct kprobe * kp, > struct pt_regs * regs) > { > return 0; > } > > #include > #define CALLB 14 > #define CALLN (1< > static int bench_probe(void) > { > int i; > cycles_t c = get_cycles(); > for (i=0; i dummy_function(10); > } > return (get_cycles() - c)>>CALLB; > } > > static struct kprobe kp; > > static int install_probe(void) > { > int ret = -10000; > > kp.pre_handler = probe_handler; > kp.addr = *(void **)dummy_function; > > printk("noprobe: %d machine cycles\n", bench_probe()); > ret = register_kprobe(&kp); > if (ret != 0) { > printk("probe install error: %d\n",ret); > return -EINVAL; > } > printk("boosted: %d machine cycles \n", bench_probe()); > kp.ainsn.inst_flag &= ~INST_FLAG_BOOSTABLE; > printk("noboost: %d machine cycles\n", bench_probe()); > > unregister_kprobe(&kp); > return -1; > } > > static void uninstall_probe(void) > { > printk("module removed\n"); > } > > module_init(install_probe); > module_exit(uninstall_probe);