[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 25/74] hmp-commands: add sync-profile
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 25/74] hmp-commands: add sync-profile |
Date: |
Tue, 21 Aug 2018 19:01:57 +0200 |
From: "Emilio G. Cota" <address@hidden>
The command introduced here is just for developers. This means that:
- the interface implemented here could change in the future
- the command is only meant to be used from HMP, not from QMP
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hmp-commands.hx | 15 +++++++++++++++
hmp.c | 24 ++++++++++++++++++++++++
hmp.h | 1 +
3 files changed, 40 insertions(+)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index c1fc747..db0c681 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -644,6 +644,21 @@ sendkey ctrl-alt-f1
This command is useful to send keys that your graphical user interface
intercepts at low level, such as @code{ctrl-alt-f1} in X Window.
ETEXI
+ {
+ .name = "sync-profile",
+ .args_type = "op:s?",
+ .params = "[on|off|reset]",
+ .help = "enable, disable or reset synchronization profiling. "
+ "With no arguments, prints whether profiling is on or
off.",
+ .cmd = hmp_sync_profile,
+ },
+
+STEXI
address@hidden sync-profile [on|off|reset]
address@hidden sync-profile
+Enable, disable or reset synchronization profiling. With no arguments, prints
+whether profiling is on or off.
+ETEXI
{
.name = "system_reset",
diff --git a/hmp.c b/hmp.c
index 2aafb50..d94a47f 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1062,6 +1062,30 @@ void hmp_stop(Monitor *mon, const QDict *qdict)
qmp_stop(NULL);
}
+void hmp_sync_profile(Monitor *mon, const QDict *qdict)
+{
+ const char *op = qdict_get_try_str(qdict, "op");
+
+ if (op == NULL) {
+ bool on = qsp_is_enabled();
+
+ monitor_printf(mon, "sync-profile is %s\n", on ? "on" : "off");
+ return;
+ }
+ if (!strcmp(op, "on")) {
+ qsp_enable();
+ } else if (!strcmp(op, "off")) {
+ qsp_disable();
+ } else if (!strcmp(op, "reset")) {
+ qsp_reset();
+ } else {
+ Error *err = NULL;
+
+ error_setg(&err, QERR_INVALID_PARAMETER, op);
+ hmp_handle_error(mon, &err);
+ }
+}
+
void hmp_system_reset(Monitor *mon, const QDict *qdict)
{
qmp_system_reset(NULL);
diff --git a/hmp.h b/hmp.h
index 33354f1..5f1addc 100644
--- a/hmp.h
+++ b/hmp.h
@@ -42,6 +42,7 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict);
void hmp_info_iothreads(Monitor *mon, const QDict *qdict);
void hmp_quit(Monitor *mon, const QDict *qdict);
void hmp_stop(Monitor *mon, const QDict *qdict);
+void hmp_sync_profile(Monitor *mon, const QDict *qdict);
void hmp_system_reset(Monitor *mon, const QDict *qdict);
void hmp_system_powerdown(Monitor *mon, const QDict *qdict);
void hmp_exit_preconfig(Monitor *mon, const QDict *qdict);
--
1.8.3.1
- [Qemu-devel] [PULL 22/74] qsp: track BQL callers explicitly, (continued)
- [Qemu-devel] [PULL 22/74] qsp: track BQL callers explicitly, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 19/74] qsp: add sort_by option to qsp_report, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 31/74] lsi_scsi: add support for PPR Extended Message, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 27/74] checkpatch: allow space in more places before a bracket, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 36/74] rcu_queue: use atomic_set in QLIST_REMOVE_RCU, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 33/74] build-sys: remove glib_subprocess check, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 18/74] qsp: QEMU's Synchronization Profiler, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 48/74] qemu-guest-agent: freeze-hook to ignore dpkg files as well, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 21/74] qsp: support call site coalescing, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 32/74] kvm: add call to qemu_add_opts() for -overcommit option, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 25/74] hmp-commands: add sync-profile,
Paolo Bonzini <=
- [Qemu-devel] [PULL 47/74] hw/intc/apic: Switch away from old_mmio, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 28/74] update-linux-headers.sh: add qemu_fw_cfg.h, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 34/74] target-i386: Fix lcall/ljmp to call gate in IA-32e mode, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 37/74] rcu_queue: remove barrier from QLIST_EMPTY_RCU, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 17/74] seqlock: constify seqlock_read_begin, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 43/74] tests: add test-list-simpleq, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 44/74] tests: add test-rcu-tailq, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 49/74] module: Use QEMU_MODULE_DIR as a search path, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 51/74] seqlock: add QemuLockable support, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 41/74] test-rcu-list: access counters with atomics, Paolo Bonzini, 2018/08/21