From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAkwL-00014Q-BX for qemu-devel@nongnu.org; Tue, 04 Feb 2014 13:41:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAkwF-0004VV-Gf for qemu-devel@nongnu.org; Tue, 04 Feb 2014 13:41:45 -0500 Received: from mail-qc0-x229.google.com ([2607:f8b0:400d:c01::229]:43328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAhke-00007p-FK for qemu-devel@nongnu.org; Tue, 04 Feb 2014 10:17:28 -0500 Received: by mail-qc0-f169.google.com with SMTP id w7so13994590qcr.0 for ; Tue, 04 Feb 2014 07:17:28 -0800 (PST) Sender: Richard Henderson Message-ID: <52F10482.8010808@twiddle.net> Date: Tue, 04 Feb 2014 07:17:22 -0800 From: Richard Henderson MIME-Version: 1.0 References: <20140131160902.32741.2680.stgit@fimbulvetr.bsc.es> <52F0FFBD.8050801@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 00/12] trace: [tcg] Allow tracing guest events in TCG-generated code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: =?UTF-8?B?TGx1w61zIFZpbGFub3Zh?= , Stefan Hajnoczi , QEMU Developers On 02/04/2014 07:02 AM, Peter Maydell wrote: > On 4 February 2014 14:57, Richard Henderson wrote: >> I suppose I have no major objection to the feature, although frankly it's >> not especially exciting. I can't really imagine ever wanting to bulk trace >> all of the helpers. Tracing specific helpers on a target-by-target basis, >> sure. But that can be done just as easily as adding tracing code to any >> other bit of C. > > I think the things people seem to actually want (judging > from occasional postings to the list) are things like: > * trace all guest memory accesses > * trace all guest instruction executions > > Does this patchset get us usefully towards that kind of thing? > Not sure... If that's the goal, I would suggest that they do not. One does not need to hook all of the helpers in order to achieve that. A hook in tcg_gen_qemu_{ld,st}_i{32,64} to (conditionally) emit a call to a helper to log the access gets you all (non-execution) guest memory accesses. Guest instruction executions is quite a bit harder, of course. But any start in that direction could be done through a pair of trace events: Log the insn address range covered by a TB + a uuid at translation time; log the uuid at the start of execution of the TB. A script should be able to put the two together to complete the trace. r~