From patchwork Thu Oct 21 09:42:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prerna Saxena X-Patchwork-Id: 68558 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9B978B70EB for ; Thu, 21 Oct 2010 20:48:09 +1100 (EST) Received: from localhost ([127.0.0.1]:44855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8rkk-0005Le-Ji for incoming@patchwork.ozlabs.org; Thu, 21 Oct 2010 05:48:06 -0400 Received: from [140.186.70.92] (port=58266 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8rey-0003M9-19 for qemu-devel@nongnu.org; Thu, 21 Oct 2010 05:42:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8rew-0006fH-Fx for qemu-devel@nongnu.org; Thu, 21 Oct 2010 05:42:07 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:43734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8rev-0006f4-UP for qemu-devel@nongnu.org; Thu, 21 Oct 2010 05:42:06 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp07.au.ibm.com (8.14.4/8.13.1) with ESMTP id o9L9g4nc016132 for ; Thu, 21 Oct 2010 20:42:04 +1100 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o9L9g4nS942198 for ; Thu, 21 Oct 2010 20:42:04 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o9L9g3AQ010384 for ; Thu, 21 Oct 2010 20:42:04 +1100 Received: from zephyr ([9.124.35.82]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o9L9g26R010348; Thu, 21 Oct 2010 20:42:02 +1100 Date: Thu, 21 Oct 2010 15:12:00 +0530 From: Prerna Saxena To: qemu-devel Message-ID: <20101021151200.2d644ca2@zephyr> In-Reply-To: <20101021144929.7911128a@zephyr> References: <20101021144929.7911128a@zephyr> Organization: IBM X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-redhat-linux-gnu) Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Mahesh , Ananth Narayan , Stefan Hajnoczi , Luiz Capitulino Subject: [Qemu-devel] [RFC][PATCH 5/5] set-trace-file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org set-trace-file : QMP command to: - Enable/disable logging traces to file - Set a new output file - Flush a semi-filled trace-buffer to output file. Signed-off-by: Prerna Saxena --- qmp-commands.hx | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/qmp-commands.hx b/qmp-commands.hx index f2008e8..295382f 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -793,6 +793,47 @@ Notes: (1) The 'query-trace-events' command should be used to check the new state of the trace-event. +EQMP + + { + .name = "set-trace-file", + .args_type = "enable:-e?,flush:-f?,filename:F?", + .params = "[-e] [-f] [filename]", + .help = "Sets a user-specified output file to write traces to", + .user_print = monitor_user_noop, + .mhandler.cmd_new = do_set_trace_file_qmp, + }, + +SQMP +set-trace-file +-------------- + +Set a new output file to log trace data to. + +Arguments: + +- "filename": name of new output file to write trace data to. + (json-string, optional) +- "enable": if false, traces are not written to file. + : Only when this is 'true' that trace buffer contents get logged + in a file. (json-bool, optional, defaults to false) +- "flush": if true, contents of trace buffer are immediately written to file, + instead of waiting for the buffer to be full. + (json-bool, optional, defaults to false) + +Example: +1. Set a new trace-file: +-> { "execute": "set-trace-file", "arguments": { "filename": "ABC", + "enable":true } } +<- { "return": {} } + +2. Flush the current traces to file: +-> { "execute": "set-trace-file", "arguments": { "flush": true } } + +Notes: + +(1) The 'query-trace-file' command should be used to check active trace-file. + 3. Query Commands =================