Skip to contentSkip to conversation

Tracing patches

GIT PULL Applied Stefan Hajnoczi 2 participants 3 messages Sep 3, 2015

lore
Share & tools
lore
#0 lore raw

The following changes since commit 561578c2a82292ddf55737791d2838b797f49f35:

Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20150902' into staging (2015-09-03 13:05:45 +0100)

are available in the git repository at:

git://github.com/stefanha/qemu.git tags/tracing-pull-request

for you to fetch changes up to 987bd27000b6e21df6c73f6badb945ab5e42996a:

trace-events: Add hmp completion (2015-09-03 15:46:10 +0100)

----------------------------------------------------------------

----------------------------------------------------------------

Dr. David Alan Gilbert (1):
trace-events: Add hmp completion

 hmp-commands.hx |  1 +
 hmp.h           |  1 +
 monitor.c       | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+)
Signature · 1 line
2.4.3
#1 lore raw

[Qemu-devel] [PULL 1/1] trace-events: Add hmp completion

From: "Dr. David Alan Gilbert" <[email protected]>

Add completion for the trace event names in the hmp trace-event command.

Message-id: [email protected]

---
 hmp-commands.hx |  1 +
 hmp.h           |  1 +
 monitor.c       | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+)
hmp-commands.hx +1 -0
index d3b7932..94d2c39 100644
@@ -271,6 +271,7 @@ ETEXI
         .params     = "name on|off",
         .help       = "changes status of a specific trace event",
         .mhandler.cmd = hmp_trace_event,
+        .command_completion = trace_event_completion,
     },
 
 STEXI
hmp.h +1 -0
index 0cf4f2a..b8f5d33 100644
@@ -113,6 +113,7 @@ void set_link_completion(ReadLineState *rs, int nb_args, const char *str);
 void netdev_add_completion(ReadLineState *rs, int nb_args, const char *str);
 void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str);
 void ringbuf_write_completion(ReadLineState *rs, int nb_args, const char *str);
+void trace_event_completion(ReadLineState *rs, int nb_args, const char *str);
 void watchdog_action_completion(ReadLineState *rs, int nb_args,
                                 const char *str);
 void migrate_set_capability_completion(ReadLineState *rs, int nb_args,
monitor.c +20 -0
index fc32f12..b432447 100644
@@ -4429,6 +4429,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;
Signature · 1 line
2.4.3
#2 lore raw
In reply to Stefan Hajnoczi
Quoted 6 lines · Stefan Hajnoczi

The following changes since commit 561578c2a82292ddf55737791d2838b797f49f35:

Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20150902' into staging (2015-09-03 13:05:45 +0100)

are available in the git repository at:

Quoted 7 lines

git://github.com/stefanha/qemu.git tags/tracing-pull-request

for you to fetch changes up to 987bd27000b6e21df6c73f6badb945ab5e42996a:

trace-events: Add hmp completion (2015-09-03 15:46:10 +0100)

----------------------------------------------------------------

Applied, thanks.

-- PMM