From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwxZg-0003fF-MY for qemu-devel@nongnu.org; Mon, 13 Feb 2012 10:12:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RwxZe-0002uF-OI for qemu-devel@nongnu.org; Mon, 13 Feb 2012 10:12:16 -0500 Received: from cantor2.suse.de ([195.135.220.15]:43571 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwxZe-0002u7-Ja for qemu-devel@nongnu.org; Mon, 13 Feb 2012 10:12:14 -0500 Message-ID: <4F39284D.70307@suse.de> Date: Mon, 13 Feb 2012 16:12:13 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] how could I analysis the trace log? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wei Yang Cc: Stefan Hajnoczi , qemu-devel@nongnu.org Hi, Am 12.02.2012 05:32, schrieb Wei Yang: > I enable the trace function with --enable-trace-backend=3Dsimple and I > create the event file like this > g_realloc > g_malloc >=20 > Then I start the qemu with following command. > ./i386-softmmu/qemu-system-i386 -enable-kvm -drive > file=3D../../kvm/ubuntu.img -boot dc -m 512 -usb > -monitor stdio -trace events=3Dqemu_trace_events,file=3Dqemu_trace.log >=20 > After some run time, I run the script like: > ./scripts/simpletrace.py qemu_trace_events_parse qemu_trace.log >=20 > The qemu_trace_events_parse is : > g_realloc(addr) > g_malloc(addr) >=20 > The output looks like: > g_malloc 1.831 addr=3D0xb945d1f0 > g_malloc 2.498 addr=3D0xb945d1f0 > g_realloc 4.715 addr=3D0x10 > g_realloc 1.520 addr=3D0xc > g_realloc 1.505 addr=3D0xc >=20 > The steps I used is correct? Not quite. IIRC you need to pass in path/to/qemu/trace-events with the full list of events you were using at the time of tracing (trace file uses index of event). That file also contains a format string from which you can infer what the arguments mean. > I just guess the format of input events file of the simpletrace.py. > For so many available events, how could I specify the format of all > those events? Not knowing Python too well myself, I just wrote a small analysis script from scratch for my specific task, based on the simpletrace source code. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg