* [Qemu-devel] [PULL 0/1] Tracing patches @ 2015-09-03 14:46 Stefan Hajnoczi 2015-09-03 14:46 ` [Qemu-devel] [PULL 1/1] trace-events: Add hmp completion Stefan Hajnoczi 2015-09-03 16:27 ` [Qemu-devel] [PULL 0/1] Tracing patches Peter Maydell 0 siblings, 2 replies; 3+ messages in thread From: Stefan Hajnoczi @ 2015-09-03 14:46 UTC (permalink / raw) To: qemu-devel; +Cc: Peter Maydell, 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: 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(+) -- 2.4.3 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PULL 1/1] trace-events: Add hmp completion 2015-09-03 14:46 [Qemu-devel] [PULL 0/1] Tracing patches Stefan Hajnoczi @ 2015-09-03 14:46 ` Stefan Hajnoczi 2015-09-03 16:27 ` [Qemu-devel] [PULL 0/1] Tracing patches Peter Maydell 1 sibling, 0 replies; 3+ messages in thread From: Stefan Hajnoczi @ 2015-09-03 14:46 UTC (permalink / raw) To: qemu-devel; +Cc: Peter Maydell, Dr. David Alan Gilbert, Stefan Hajnoczi From: "Dr. David Alan Gilbert" <dgilbert@redhat.com> Add completion for the trace event names in the hmp trace-event command. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-id: 1439548063-18410-1-git-send-email-dgilbert@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> --- hmp-commands.hx | 1 + hmp.h | 1 + monitor.c | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index d3b7932..94d2c39 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -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 diff --git a/hmp.h b/hmp.h index 0cf4f2a..b8f5d33 100644 --- a/hmp.h +++ b/hmp.h @@ -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, diff --git a/monitor.c b/monitor.c index fc32f12..b432447 100644 --- a/monitor.c +++ b/monitor.c @@ -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; -- 2.4.3 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PULL 0/1] Tracing patches 2015-09-03 14:46 [Qemu-devel] [PULL 0/1] Tracing patches Stefan Hajnoczi 2015-09-03 14:46 ` [Qemu-devel] [PULL 1/1] trace-events: Add hmp completion Stefan Hajnoczi @ 2015-09-03 16:27 ` Peter Maydell 1 sibling, 0 replies; 3+ messages in thread From: Peter Maydell @ 2015-09-03 16:27 UTC (permalink / raw) To: Stefan Hajnoczi; +Cc: QEMU Developers On 3 September 2015 at 15:46, Stefan Hajnoczi <stefanha@redhat.com> wrote: > 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) > > ---------------------------------------------------------------- Applied, thanks. -- PMM ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-03 16:28 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-09-03 14:46 [Qemu-devel] [PULL 0/1] Tracing patches Stefan Hajnoczi 2015-09-03 14:46 ` [Qemu-devel] [PULL 1/1] trace-events: Add hmp completion Stefan Hajnoczi 2015-09-03 16:27 ` [Qemu-devel] [PULL 0/1] Tracing patches Peter Maydell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).