summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-09-03 16:17:28 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-09-03 16:17:28 +0100
commitb041066421e8dcc7d080dfcfd83551c9c9f24ade (patch)
tree48a0167a139d9dde4c07237d32460ea10b2872db /monitor.c
parent550e66ea4cce7b6664d6caf7e651814cc2d30421 (diff)
parent987bd27000b6e21df6c73f6badb945ab5e42996a (diff)
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
# gpg: Signature made Thu 03 Sep 2015 15:46:52 BST using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/tracing-pull-request: trace-events: Add hmp completion Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index 451af6ff89..b1f2a29793 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4442,6 +4442,26 @@ void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str)
}
}
+void trace_event_completion(ReadLineState *rs, int nb_args, const char *str)
+{
+ size_t len;
+
+ len = strlen(str);
+ readline_set_completion_index(rs, len);
+ if (nb_args == 2) {
+ TraceEventID id;
+ for (id = 0; id < trace_event_count(); id++) {
+ const char *event_name = trace_event_get_name(trace_event_id(id));
+ if (!strncmp(str, event_name, len)) {
+ readline_add_completion(rs, event_name);
+ }
+ }
+ } else if (nb_args == 3) {
+ add_completion_option(rs, str, "on");
+ add_completion_option(rs, str, "off");
+ }
+}
+
void watchdog_action_completion(ReadLineState *rs, int nb_args, const char *str)
{
int i;