diff --git a/MAINTAINERS b/MAINTAINERS index acbad134ecba49433c1417dc2302eac6f5e177f3..575ea6e68d041a574e875b990a63da4682989b56 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1918,7 +1918,7 @@ F: qapi/run-state.json Human Monitor (HMP) M: Dr. David Alan Gilbert S: Maintained -F: monitor.c +F: monitor/misc.c F: hmp.[ch] F: hmp-commands*.hx F: include/monitor/hmp-target.h @@ -2040,7 +2040,7 @@ QMP M: Markus Armbruster S: Supported F: qmp.c -F: monitor.c +F: monitor/misc.c F: docs/devel/*qmp-* F: docs/interop/*qmp-* F: scripts/qmp/ diff --git a/Makefile.objs b/Makefile.objs index c8337fa34be8c9cd26a9cf7a8fc99722b4312a49..dd39a70b481bac7ef7b20969239bda9458cc6696 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -130,6 +130,7 @@ trace-events-subdirs = trace-events-subdirs += accel/kvm trace-events-subdirs += accel/tcg trace-events-subdirs += crypto +trace-events-subdirs += monitor ifeq ($(CONFIG_USER_ONLY),y) trace-events-subdirs += linux-user endif diff --git a/Makefile.target b/Makefile.target index ecd856e3a3f0c4b8e868af3d547695a9cb3dfd0a..72c267f7dc0c87df21cb61d1604c4175dd5169ed 100644 --- a/Makefile.target +++ b/Makefile.target @@ -148,9 +148,10 @@ endif #CONFIG_BSD_USER ######################################################### # System emulator target ifdef CONFIG_SOFTMMU -obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o +obj-y += arch_init.o cpus.o gdbstub.o balloon.o ioport.o numa.o obj-y += qtest.o obj-y += hw/ +obj-y += monitor/ obj-y += qapi/ obj-y += memory.o obj-y += memory_mapping.o diff --git a/docs/devel/writing-qmp-commands.txt b/docs/devel/writing-qmp-commands.txt index 9dfc62bf5a3a37907dbd39b5fc4a7c4c2b24d957..cc6ecd6d5d4dd8520e4ad5e2612f3f60cd1a7812 100644 --- a/docs/devel/writing-qmp-commands.txt +++ b/docs/devel/writing-qmp-commands.txt @@ -470,7 +470,7 @@ it's good practice to always check for errors. Another important detail is that HMP's "info" commands don't go into the hmp-commands.hx. Instead, they go into the info_cmds[] table, which is defined -in the monitor.c file. The entry for the "info alarmclock" follows: +in the monitor/misc.c file. The entry for the "info alarmclock" follows: { .name = "alarmclock", diff --git a/monitor/Makefile.objs b/monitor/Makefile.objs new file mode 100644 index 0000000000000000000000000000000000000000..e783b0616b3ffe6387706192170ee11b5e9a87f8 --- /dev/null +++ b/monitor/Makefile.objs @@ -0,0 +1 @@ +obj-y += misc.o diff --git a/monitor.c b/monitor/misc.c similarity index 99% rename from monitor.c rename to monitor/misc.c index 3015b6e9c756e3850836f1ed56c4ea7d0a08742f..c5f8483b7e80c70f343f58960fcfba38c836f784 100644 --- a/monitor.c +++ b/monitor/misc.c @@ -64,7 +64,7 @@ #include "qapi/qmp/json-parser.h" #include "qapi/qmp/qlist.h" #include "qom/object_interfaces.h" -#include "trace-root.h" +#include "trace.h" #include "trace/control.h" #include "monitor/hmp-target.h" #ifdef CONFIG_TRACE_SIMPLE diff --git a/monitor/trace-events b/monitor/trace-events new file mode 100644 index 0000000000000000000000000000000000000000..abfdf20b1495154a904cfb0b9e7893997a07566a --- /dev/null +++ b/monitor/trace-events @@ -0,0 +1,11 @@ +# See docs/devel/tracing.txt for syntax documentation. + +# misc.c +monitor_protocol_event_handler(uint32_t event, void *qdict) "event=%d data=%p" +monitor_protocol_event_emit(uint32_t event, void *data) "event=%d data=%p" +monitor_protocol_event_queue(uint32_t event, void *qdict, uint64_t rate) "event=%d data=%p rate=%" PRId64 +handle_hmp_command(void *mon, const char *cmdline) "mon %p cmdline: %s" +handle_qmp_command(void *mon, const char *req) "mon %p req: %s" +monitor_suspend(void *ptr, int cnt) "mon %p: %d" +monitor_qmp_cmd_in_band(const char *id) "%s" +monitor_qmp_cmd_out_of_band(const char *id) "%s" diff --git a/trace-events b/trace-events index 844ee58dd97ac8e9a1d7583c80d2c64f1d8a930e..aeea3c2bdbfd368d186e274abfa8680666fd5dfa 100644 --- a/trace-events +++ b/trace-events @@ -41,16 +41,6 @@ system_wakeup_request(int reason) "reason=%d" qemu_system_shutdown_request(int reason) "reason=%d" qemu_system_powerdown_request(void) "" -# monitor.c -monitor_protocol_event_handler(uint32_t event, void *qdict) "event=%d data=%p" -monitor_protocol_event_emit(uint32_t event, void *data) "event=%d data=%p" -monitor_protocol_event_queue(uint32_t event, void *qdict, uint64_t rate) "event=%d data=%p rate=%" PRId64 -handle_hmp_command(void *mon, const char *cmdline) "mon %p cmdline: %s" -handle_qmp_command(void *mon, const char *req) "mon %p req: %s" -monitor_suspend(void *ptr, int cnt) "mon %p: %d" -monitor_qmp_cmd_in_band(const char *id) "%s" -monitor_qmp_cmd_out_of_band(const char *id) "%s" - # dma-helpers.c dma_blk_io(void *dbs, void *bs, int64_t offset, bool to_dev) "dbs=%p bs=%p offset=%" PRId64 " to_dev=%d" dma_aio_cancel(void *dbs) "dbs=%p"