From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=46287 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OgaJG-0005dY-GC for qemu-devel@nongnu.org; Wed, 04 Aug 2010 05:30:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OgaJF-0000jK-9L for qemu-devel@nongnu.org; Wed, 04 Aug 2010 05:30:50 -0400 Received: from fe01x03-cgp.akado.ru ([77.232.31.164]:55561 helo=akado.ru) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OgaJF-0000ir-2r for qemu-devel@nongnu.org; Wed, 04 Aug 2010 05:30:49 -0400 Date: Wed, 4 Aug 2010 13:30:42 +0400 (MSD) From: malc Subject: Re: [Qemu-devel] [Tracing][PATCH v2] Add options to specify trace file name at startup and runtime. In-Reply-To: <20100804145154.3d9a7c41@zephyr> Message-ID: References: <20100803110700.75d7c3b0@zephyr> <20100804145154.3d9a7c41@zephyr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Prerna Saxena Cc: Ananth Narayan , qemu-devel , Stefan Hajnoczi On Wed, 4 Aug 2010, Prerna Saxena wrote: > This patch adds an optional command line switch '-trace' to specify the > filename to write traces to, when qemu starts. > Eg, If compiled with the 'simple' trace backend, > [temp@system]$ qemu -trace FILENAME IMAGE > Allows the binary traces to be written to FILENAME instead of the option > set at config-time. > > Also, this adds monitor sub-command 'set' to trace-file commands to > dynamically change trace log file at runtime. > Eg, > (qemu)trace-file set FILENAME > This allows one to set trace outputs to FILENAME from the default > specified at startup. > > Changelog from v1 : > - Cleanups. [..snip..] > + st_set_trace_file_enabled(false); > > - if (asprintf(&filename, CONFIG_TRACE_FILE, getpid()) < 0) { > - return false; > + free(trace_file_name); > + > + if (!file) { > + if (asprintf(&trace_file_name, CONFIG_TRACE_FILE, getpid()) < 0) { > + trace_file_name = NULL; > + return false; Tab here. > + } > + } else { > + if (asprintf(&trace_file_name, "%s", file) < 0) { > + trace_file_name = NULL; > + return false; > + } > } > [..snip..] -- mailto:av1474@comtv.ru