From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5e4L-00081c-Vq for qemu-devel@nongnu.org; Fri, 11 Jul 2014 12:53:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5e4C-0006P3-Ux for qemu-devel@nongnu.org; Fri, 11 Jul 2014 12:53:09 -0400 Received: from mail-ie0-x234.google.com ([2607:f8b0:4001:c03::234]:41472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5e4C-0006Ol-Pz for qemu-devel@nongnu.org; Fri, 11 Jul 2014 12:53:00 -0400 Received: by mail-ie0-f180.google.com with SMTP id at20so1127158iec.39 for ; Fri, 11 Jul 2014 09:52:59 -0700 (PDT) Sender: Richard Henderson Message-ID: <53C01667.4010003@twiddle.net> Date: Fri, 11 Jul 2014 09:52:55 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1405097039-9524-1-git-send-email-alex.bennee@linaro.org> In-Reply-To: <1405097039-9524-1-git-send-email-alex.bennee@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 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: =?ISO-8859-1?Q?Alex_Benn=E9e?= , qemu-devel@nongnu.org Cc: Anthony Liguori , batuzovk@ispras.ru 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? > + > +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... r~