From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeB2G-0000pA-CH for qemu-devel@nongnu.org; Sun, 19 May 2013 17:21:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UeB2B-0004AT-LX for qemu-devel@nongnu.org; Sun, 19 May 2013 17:20:56 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:64493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeB2B-0004AO-C0 for qemu-devel@nongnu.org; Sun, 19 May 2013 17:20:51 -0400 Received: by mail-lb0-f181.google.com with SMTP id w20so5565337lbh.12 for ; Sun, 19 May 2013 14:20:50 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <019C9E6F-6C2C-4D59-BB88-974F498337EB@greensocs.com> References: <519667A7.9010902@greensocs.com> <1368938253.2611.4@driftwood> <019C9E6F-6C2C-4D59-BB88-974F498337EB@greensocs.com> From: Peter Maydell Date: Sun, 19 May 2013 22:20:30 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [RFC] reverse execution. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Burton Cc: Blue Swirl , qemu-devel , =?UTF-8?B?S09OUkFEIEZyw6lkw6lyaWM=?= On 19 May 2013 21:09, Mark Burton wrote: > Note - what I understand by a basic block is something that ends in a > jump/branch of some description. Hence, one thing I think you can say about a > basic block is that each PC value within it is unique. Hence, if I know the > number of basic blocks executed, and the current PC, then I should be able to > re-run to there (assuming a deterministic system of course). Assuming your rerun is strictly deterministic so you always exit the basic block the same way each time, then yes, this amounts to optimising the "instruction count" by doing it as "X basic blocks then Y instructions". You could actually have this really do the instruction count for you, if you track insns per block at translation time. (There is some fiddling necessary when we take an unexpected exception in the middle of a block due to a load/store fault.) > I'd be interested to know (a) if there is a sensible place for > adding a basic block counter, and (b) if people like this route > better or worse than an instruction counter? I think you're probably best off getting the instruction counter working properly before trying to optimise it... thanks -- PMM