Skip to contentSkip to conversation

hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds

PATCH In review Peter Xu 2 participants 3 messages Jun 1, 2021 – Jun 14, 2021

lore
Share & tools
lore

Peter Xu

author
#0 lore raw

PATCH v2 1/1 hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds

These two commands are missing when adding the QMP sister commands. Add them, so developers can play with them easier.

Cc Dr. David Alan Gilbert <[email protected]>
Cc Juan Quintela <[email protected]>
Cc Leonardo Bras Soares Passos <[email protected]>
Cc Chuan Zheng <[email protected]>

---
v2:
- rebase to "migration/dirtyrate: make sample page count configurable"

---
 hmp-commands-info.hx  | 13 ++++++++++++
 hmp-commands.hx       | 14 +++++++++++++
 include/monitor/hmp.h |  2 ++
 migration/dirtyrate.c | 47 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 76 insertions(+)
hmp-commands-info.hx +13 -0
index ab0c7aa5eea..f8a9141dd8a 100644
@@ -880,3 +880,16 @@ SRST
   ``info replay``
     Display the record/replay information: mode and the current icount.
 ERST
+
+    {
+        .name       = "dirty_rate",
+        .args_type  = "",
+        .params     = "",
+        .help       = "show dirty rate information",
+        .cmd        = hmp_info_dirty_rate,
+    },
+
+SRST
+  ``info dirty_rate``
+    Display the vcpu dirty rate information.
+ERST
hmp-commands.hx +14 -0
index 2d21fe5ad42..84dcc3aae6c 100644
@@ -1727,3 +1727,17 @@ ERST
         .flags      = "p",
     },
 
+SRST
+``calc_dirty_rate`` *second*
+  Start a round of dirty rate measurement with the period specified in *second*.
+  The result of the dirty rate measurement may be observed with ``info
+  dirty_rate`` command.
+ERST
+
+    {
+        .name       = "calc_dirty_rate",
+        .args_type  = "second:l,sample_pages_per_GB:l?",
+        .params     = "second [sample_pages_per_GB]",
+        .help       = "start a round of guest dirty rate measurement",
+        .cmd        = hmp_calc_dirty_rate,
+    },
include/monitor/hmp.h +2 -0
index 605d57287ae..3baa1058e2c 100644
@@ -129,5 +129,7 @@ void hmp_info_replay(Monitor *mon, const QDict *qdict);
 void hmp_replay_break(Monitor *mon, const QDict *qdict);
 void hmp_replay_delete_break(Monitor *mon, const QDict *qdict);
 void hmp_replay_seek(Monitor *mon, const QDict *qdict);
+void hmp_info_dirty_rate(Monitor *mon, const QDict *qdict);
+void hmp_calc_dirty_rate(Monitor *mon, const QDict *qdict);
 
 #endif
migration/dirtyrate.c +47 -0

56 lines not on this page · raw message

Signature · 1 line
2.31.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Peter Xu

These two commands are missing when adding the QMP sister commands. Add them, so developers can play with them easier.

Cc Dr. David Alan Gilbert <[email protected]>
Cc Juan Quintela <[email protected]>
Cc Leonardo Bras Soares Passos <[email protected]>
Cc Chuan Zheng <[email protected]>
Quoted 3 lines

---
v2:
- rebase to "migration/dirtyrate: make sample page count configurable"

author
#2 lore raw
Quoted 14 lines · Juan Quintela
Quoted 9 lines · Peter Xu

These two commands are missing when adding the QMP sister commands. Add them, so developers can play with them easier.

Cc Dr. David Alan Gilbert <[email protected]>
Cc Juan Quintela <[email protected]>
Cc Leonardo Bras Soares Passos <[email protected]>
Cc Chuan Zheng <[email protected]>
Quoted 3 lines

---
v2:
- rebase to "migration/dirtyrate: make sample page count configurable"

Quoted 1 line

It turns out this patch has landed upstream already. :-) but still thanks for the review (and welcome back)!

Signature · 1 line
Peter Xu