From 22890ab5e825601f4c3d5a1a6b4197904e5d1fee Mon Sep 17 00:00:00 2001 From: Prerna Saxena Date: Thu, 24 Jun 2010 17:04:53 +0530 Subject: trace: Support for dynamically enabling/disabling trace events This patch adds support for dynamically enabling/disabling of trace events. This is done by internally maintaining each trace event's state, and permitting logging of data from a trace event only if it is in an 'active' state. Monitor commands added : 1) info trace-events : to view all available trace events and their state. 2) trace-event NAME on|off : to enable/disable data logging from a given trace event. Eg, trace-event paio_submit off disables logging of data when paio_submit is hit. By default, all trace-events are disabled. One can enable desired trace-events via the monitor. Signed-off-by: Prerna Saxena Signed-off-by: Stefan Hajnoczi trace: Monitor command 'info trace' Monitor command 'info trace' to display contents of trace buffer Signed-off-by: Prerna Saxena Signed-off-by: Stefan Hajnoczi trace: Remove monitor.h dependency from simpletrace User-mode targets don't have a monitor so the simple trace backend currently does not build on those targets. This patch abstracts the monitor printing interface so there is no direct coupling between simpletrace and the monitor. Signed-off-by: Stefan Hajnoczi --- qemu-monitor.hx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'qemu-monitor.hx') diff --git a/qemu-monitor.hx b/qemu-monitor.hx index 5c1da33..c264c7d 100644 --- a/qemu-monitor.hx +++ b/qemu-monitor.hx @@ -281,6 +281,22 @@ STEXI Output logs to @var{filename}. ETEXI +#ifdef CONFIG_SIMPLE_TRACE + { + .name = "trace-event", + .args_type = "name:s,option:b", + .params = "name on|off", + .help = "changes status of a specific trace event", + .mhandler.cmd = do_change_trace_event_state, + }, + +STEXI +@item trace-event +@findex trace-event +changes status of a trace event +ETEXI +#endif + { .name = "log", .args_type = "items:s", @@ -2529,6 +2545,15 @@ show roms @end table ETEXI +#ifdef CONFIG_SIMPLE_TRACE +STEXI +@item info trace +show contents of trace buffer +@item info trace-events +show available trace events and their state +ETEXI +#endif + HXCOMM DO NOT add new commands after 'info', move your addition before it! STEXI -- cgit v1.1