From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17092 invoked by alias); 31 Oct 2006 09:32:07 -0000 Received: (qmail 17085 invoked by uid 22791); 31 Oct 2006 09:32:06 -0000 X-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DK_SIGNED,DNS_FROM_RFC_ABUSE,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from nz-out-0102.google.com (HELO nz-out-0102.google.com) (64.233.162.193) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 31 Oct 2006 09:32:04 +0000 Received: by nz-out-0102.google.com with SMTP id n1so1395882nzf for ; Tue, 31 Oct 2006 01:32:02 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=shlHcSHDwkmUUf4vI0c4Fq8fStfl0hefbQBG70uuGydZ5ntfPXc5htCZ6AkG/w0ccmfAsZHGekRmodj4OqyQ8hN7uMLLrNJkh8TTaZ7gARqjiUo8M0kazd+A8+z/81//8pEycmPf0cQIo/yZLFy/pZHGSCOiO+Evw+UYbNLsRmg= Received: by 10.65.119.9 with SMTP id w9mr6521635qbm; Tue, 31 Oct 2006 01:32:02 -0800 (PST) Received: by 10.64.208.14 with HTTP; Tue, 31 Oct 2006 01:32:02 -0800 (PST) Message-ID: Date: Tue, 31 Oct 2006 09:51:00 -0000 From: "Jun Koi" To: "Stone, Joshua I" Subject: Re: Improvement for post-handler only case in kprobes Cc: systemtap@sources.redhat.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: 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-q4/txt/msg00292.txt.bz2 On 10/31/06, Stone, Joshua I wrote: > On Sunday, October 29, 2006 6:02 AM, Jun Koi wrote: > > [...] > > In case we only has post-handler (NOT pre-handler), we can eliminate > > the single-mode step in the following way: > > - Still put BreakPoint at the registered address. > > - After the single-step, remove the old BreakPoint and put it at the > > current EIP (this is the place we switch out with single-step). Next > > time, we only need to handle the breakpoint, as it is hit right after > > the "original" breakpoint. Hence we dont need to get into the > > single-step mode any more. Of course this improves the performance. > > So you're basically suggesting to turn a post-handler on a instruction > into a pre-handler on the following instruction? Yes, that is my idea. > > This is equivalent only if you can guarantee that the two instructions > will always execute together. Thus the first instruction cannot be a > control instruction (branch, jump, etc.), and the second cannot be the > target of any control instruction. You would have to do full > basic-block analysis to guarantee this condition. Yes, unfortunately we cannot do it without some price paying. > > In any case, I don't think you'll save anything, because whatever > instruction is replaced with a breakpoint still needs to be executed. > This happens out-of-line and single-stepped. What we gain is performance improvement, because we no longer have to single-step any more (in case we successfully boost with boostable instruction). Meanwhile in the current approach, we always have to do single-step for post-handler. Thank you, Jun > > > Josh >