Commit b0410664 authored by Peter Maydell's avatar Peter Maydell
Browse files

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: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 550e66ea 987bd270
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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,
+20 −0
Original line number Diff line number Diff line
@@ -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;