From c5ceb523fa6fc168d3f51e306fee3def458e047e Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Tue, 13 Jul 2010 09:26:33 +0100 Subject: trace: Add trace-file command to open/close/flush trace file This patch adds the trace-file command: trace-file [on|off|flush] Open, close, or flush the trace file. If no argument is given, the status of the trace file is displayed. The trace file is turned on by default but is only written out when the trace buffer becomes full. The flush operation can be used to force write out at any time. Turning off the trace file does not change the state of trace events; tracing will continue to the trace buffer. When the trace file is off, use "info trace" to display the contents of the trace buffer in memory. Signed-off-by: Stefan Hajnoczi This commit also contains the trace-file sub-command from the following commit: commit 5ce8d1a957afae2c52ad748944ce72848ccf57bd Author: Prerna Saxena Date: Wed Aug 4 16:23:54 2010 +0530 trace: Add options to specify trace file name at startup and runtime 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. Signed-off-by: Prerna Saxena Signed-off-by: Stefan Hajnoczi --- qemu-monitor.hx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'qemu-monitor.hx') diff --git a/qemu-monitor.hx b/qemu-monitor.hx index c264c7d539..49bcd8d324 100644 --- a/qemu-monitor.hx +++ b/qemu-monitor.hx @@ -294,6 +294,20 @@ STEXI @item trace-event @findex trace-event changes status of a trace event +ETEXI + + { + .name = "trace-file", + .args_type = "op:s?,arg:F?", + .params = "on|off|flush|set [arg]", + .help = "open, close, or flush trace file, or set a new file name", + .mhandler.cmd = do_trace_file, + }, + +STEXI +@item trace-file on|off|flush +@findex trace-file +Open, close, or flush the trace file. If no argument is given, the status of the trace file is displayed. ETEXI #endif -- cgit v1.2.3-55-g7522