trace: trace monitor qmp dispatch/completion
Add trace events for handle_qmp_command(), which dispatches qmp commands, and monitor_protocol_emitter(), which produces the reply to a qmp command. Also remove duplicate #include "trace/control.h". Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
This commit is contained in:
		
							parent
							
								
									28dcee10c5
								
							
						
					
					
						commit
						89bd820acb
					
				| 
						 | 
					@ -57,11 +57,11 @@
 | 
				
			||||||
#include "json-parser.h"
 | 
					#include "json-parser.h"
 | 
				
			||||||
#include "osdep.h"
 | 
					#include "osdep.h"
 | 
				
			||||||
#include "cpu.h"
 | 
					#include "cpu.h"
 | 
				
			||||||
 | 
					#include "trace.h"
 | 
				
			||||||
#include "trace/control.h"
 | 
					#include "trace/control.h"
 | 
				
			||||||
#ifdef CONFIG_TRACE_SIMPLE
 | 
					#ifdef CONFIG_TRACE_SIMPLE
 | 
				
			||||||
#include "trace/simple.h"
 | 
					#include "trace/simple.h"
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#include "trace/control.h"
 | 
					 | 
				
			||||||
#include "ui/qemu-spice.h"
 | 
					#include "ui/qemu-spice.h"
 | 
				
			||||||
#include "memory.h"
 | 
					#include "memory.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -370,6 +370,8 @@ static void monitor_protocol_emitter(Monitor *mon, QObject *data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    QDict *qmp;
 | 
					    QDict *qmp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    trace_monitor_protocol_emitter(mon);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    qmp = qdict_new();
 | 
					    qmp = qdict_new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!monitor_has_error(mon)) {
 | 
					    if (!monitor_has_error(mon)) {
 | 
				
			||||||
| 
						 | 
					@ -5102,6 +5104,7 @@ static void handle_qmp_command(JSONMessageParser *parser, QList *tokens)
 | 
				
			||||||
    qobject_incref(mon->mc->id);
 | 
					    qobject_incref(mon->mc->id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    cmd_name = qdict_get_str(input, "execute");
 | 
					    cmd_name = qdict_get_str(input, "execute");
 | 
				
			||||||
 | 
					    trace_handle_qmp_command(mon, cmd_name);
 | 
				
			||||||
    if (invalid_qmp_mode(mon, cmd_name)) {
 | 
					    if (invalid_qmp_mode(mon, cmd_name)) {
 | 
				
			||||||
        qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
 | 
					        qerror_report(QERR_COMMAND_NOT_FOUND, cmd_name);
 | 
				
			||||||
        goto err_out;
 | 
					        goto err_out;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -534,3 +534,7 @@ esp_mem_writeb_cmd_sel(uint32_t val) "Select without ATN (%2.2x)"
 | 
				
			||||||
esp_mem_writeb_cmd_selatn(uint32_t val) "Select with ATN (%2.2x)"
 | 
					esp_mem_writeb_cmd_selatn(uint32_t val) "Select with ATN (%2.2x)"
 | 
				
			||||||
esp_mem_writeb_cmd_selatns(uint32_t val) "Select with ATN & stop (%2.2x)"
 | 
					esp_mem_writeb_cmd_selatns(uint32_t val) "Select with ATN & stop (%2.2x)"
 | 
				
			||||||
esp_mem_writeb_cmd_ensel(uint32_t val) "Enable selection (%2.2x)"
 | 
					esp_mem_writeb_cmd_ensel(uint32_t val) "Enable selection (%2.2x)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# monitor.c
 | 
				
			||||||
 | 
					handle_qmp_command(void *mon, const char *cmd_name) "mon %p cmd_name \"%s\""
 | 
				
			||||||
 | 
					monitor_protocol_emitter(void *mon) "mon %p"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue