From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMbkL-0003i8-TB for qemu-devel@nongnu.org; Tue, 04 Aug 2015 08:55:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMbkG-0007kA-3o for qemu-devel@nongnu.org; Tue, 04 Aug 2015 08:55:09 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:32981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMbkF-0007jS-U3 for qemu-devel@nongnu.org; Tue, 04 Aug 2015 08:55:04 -0400 Received: by wijp15 with SMTP id p15so4666220wij.0 for ; Tue, 04 Aug 2015 05:55:03 -0700 (PDT) References: <1438593291-27109-1-git-send-email-alex.bennee@linaro.org> <1438593291-27109-2-git-send-email-alex.bennee@linaro.org> <55BF6F68.1090103@redhat.com> <87k2tblcxq.fsf@linaro.org> <20150804115957.GA6574@aurel32.net> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <20150804115957.GA6574@aurel32.net> Date: Tue, 04 Aug 2015 13:55:00 +0100 Message-ID: <87io8vkycb.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v4 01/11] tcg: add ability to dump /tmp/perf-.map files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-trivial@nongnu.org, Paolo Bonzini , crosthwaitepeter@gmail.com, qemu-devel@nongnu.org, rth@twiddle.net Aurelien Jarno writes: > On 2015-08-04 08:39, Alex Bennée wrote: >> >> Paolo Bonzini writes: >> >> > On 03/08/2015 11:14, Alex Bennée wrote: >> >> This allows the perf tool to map samples to each individual translation >> >> block. This could be expanded for user space but currently it gives >> >> enough information to find any hotblocks by other means. >> >> >> >> Signed-off-by: Alex Bennée >> > >> > What happens if you encounter a tb_flush? >> >> At the point of a tb_flush all bets are off as we will re-generate all >> the blocks at potentially different locations in the translation buffer. >> However for most analysis cases you are unlikely to cause the code >> buffer to overflow. Most other uses of tb_flush are the result >> debugging. >> >> I could add a printf when --perfmap is enabled to flag when a flush >> happens to signal to the user? I guess some more caveats in the flag >> description wouldn't hurt. >> >> We could consider truncating and re-starting the JIT dump at each flush? > > You also need to take care about TB invalidation. When the last > generated TB is invalidated, the code pointer is rolled back to the > end of the previous TB. In that case the last entry of the dump might > should be replaced by the new value. If the invalidated TB is not the > last one, it is just left in the generated code. Can we only invalidate the previous TB and not any earlier ones? We could keep the output line until the next TB is generated but then you would never have a mapping for the last TB generated. -- Alex Bennée