From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6ghu-0004vH-5t for qemu-devel@nongnu.org; Mon, 14 Jul 2014 09:54:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X6gho-0006l1-1m for qemu-devel@nongnu.org; Mon, 14 Jul 2014 09:54:18 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:50768 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6ghn-0006k7-S2 for qemu-devel@nongnu.org; Mon, 14 Jul 2014 09:54:11 -0400 References: <1405097039-9524-1-git-send-email-alex.bennee@linaro.org> <53C01667.4010003@twiddle.net> From: Alex =?utf-8?Q?Benn=C3=A9e?= Date: Mon, 14 Jul 2014 14:53:30 +0100 In-reply-to: <53C01667.4010003@twiddle.net> Message-ID: <8761j0xcxt.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] tcg: add ability to dump /tmp/perf-.map files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, Anthony Liguori , batuzovk@ispras.ru Richard Henderson writes: > On 07/11/2014 09:43 AM, Alex Bennée wrote: >> +/* if I could put this in a header easily.... */ >> +void tb_enable_perfmap(void); > > How about next to tb_flush in exec/exec-all.h? Including exec/exec-all.h trips up some sort of include prevention magic: CC vl.o In file included from vl.c:82:0: /home/alex/lsrc/qemu/qemu.git/include/exec/exec-all.h:75:28: error: attempt to use poisoned "CPUArchState" void gen_intermediate_code(CPUArchState *env, struct TranslationBlock *tb); ^ >> + >> +void tb_enable_perfmap(void) { > > Watch the { placement. > >> + gchar * map_file = g_strdup_printf("/tmp/perf-%d.map", getpid()); >> + tb_perfmap = fopen(map_file, "w"); >> + g_free(map_file); >> +} > > And speaking of tb_flush, ought there be some marker in the perf file to reset > things? Otherwise you're just going to wind up with garbage if you let the > guest run long enough. > > Of course, I have no idea how to link the flush with a timestamp that allows > one to selectively choose which section of the perf file one uses... The perf JIT format isn't really that smart so currently I'm not sure how it would deal with it. Currently I suspect the best solution is "don't do that then" :-/ > > > r~ -- Alex Bennée