From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35882 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNdS8-0002L8-8g for qemu-devel@nongnu.org; Tue, 30 Nov 2010 22:34:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNYsa-00083o-MI for qemu-devel@nongnu.org; Tue, 30 Nov 2010 17:40:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNYsa-00080l-DC for qemu-devel@nongnu.org; Tue, 30 Nov 2010 17:40:56 -0500 From: Juan Quintela In-Reply-To: <20101130103557.GA23629@stefan-thinkpad.transitives.com> (Stefan Hajnoczi's message of "Tue, 30 Nov 2010 10:36:00 +0000") References: <4CF45AB2.7050506@codemonkey.ws> <20101130103557.GA23629@stefan-thinkpad.transitives.com> Date: Tue, 30 Nov 2010 23:40:36 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 03/10] Add printf debug to savevm List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Anthony Liguori , qemu-devel@nongnu.org Stefan Hajnoczi wrote: > On Mon, Nov 29, 2010 at 08:00:18PM -0600, Anthony Liguori wrote: >> Yeah, all of this should be done via tracing. Maybe Stefan can make >> some suggestions. > > Here is an example of how to record savevm timestamps using tracing. > Actually the timestamp is recorded automatically when a trace event > fires. > > Add these to the trace-events file: > savevm_start(void) "" > savevm_stop(unsigned int section_id) "section_id %u" > > Then use trace_savevm_start() instead of START_SAVEVM_CLOCK() and > trace_savevm_stop() instead of STOP_SAVEVM_CLOCK() in savevm.c. Also > #include "trace.h". > > All the macros and inline timestamp analysis can be removed from > savevm.c. > > ./configure --trace-backend=simple [...] > make > > After running savevm look for the trace- file that QEMU produces in > its current working directory. You can pretty-print it like this: > ./simpletrace.py trace-events trace- > > The second field in the simpletrace.py output is the time delta (in > microseconds) since the last trace event. So you can easily see how > long start->stop took. > > For more info see docs/tracing.txt. You might prefer to use SystemTap > (./configure --trace-backend=dtrace) so you can write stap scripts to do > more powerful analysis. Thanks. Searching for guru, I basically want to only print the values when the difference is bigger that some values (number of calls is really big, I need to learn how to script the analisys). But clearly this "have to be" easier than change printf's and ifs and rerun the test. Later, Juan. > Stefan