From: David Goulet Date: Fri, 5 Sep 2014 19:29:23 +0000 (-0400) Subject: Fix: list agent event per domain only X-Git-Tag: v2.6.0-rc1~64 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f60140a188c6c0cd1acf948c37e338e96a74be8d;p=lttng-tools.git Fix: list agent event per domain only Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/agent.c b/src/bin/lttng-sessiond/agent.c index dbeec9dab..b267503fc 100644 --- a/src/bin/lttng-sessiond/agent.c +++ b/src/bin/lttng-sessiond/agent.c @@ -528,7 +528,8 @@ error: * * Return the number of events or else a negative value. */ -int agent_list_events(struct lttng_event **events) +int agent_list_events(struct lttng_event **events, + enum lttng_domain_type domain) { int ret; size_t nbmem, count = 0; @@ -552,6 +553,11 @@ int agent_list_events(struct lttng_event **events) ssize_t nb_ev; struct lttng_event *agent_events; + /* Skip domain not asked by the list. */ + if (app->domain != domain) { + continue; + } + nb_ev = list_events(app, &agent_events); if (nb_ev < 0) { ret = nb_ev; diff --git a/src/bin/lttng-sessiond/agent.h b/src/bin/lttng-sessiond/agent.h index 3dbf7179a..f8d9ca6ea 100644 --- a/src/bin/lttng-sessiond/agent.h +++ b/src/bin/lttng-sessiond/agent.h @@ -147,6 +147,7 @@ int agent_enable_event(struct agent_event *event, int agent_disable_event(struct agent_event *event, enum lttng_domain_type domain); void agent_update(struct agent *agt, int sock); -int agent_list_events(struct lttng_event **events); +int agent_list_events(struct lttng_event **events, + enum lttng_domain_type domain); #endif /* LTTNG_SESSIOND_AGENT_H */ diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index bacaa5caa..628fb1061 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1816,7 +1816,7 @@ ssize_t cmd_list_tracepoints(int domain, struct lttng_event **events) break; case LTTNG_DOMAIN_LOG4J: case LTTNG_DOMAIN_JUL: - nb_events = agent_list_events(events); + nb_events = agent_list_events(events, domain); if (nb_events < 0) { ret = LTTNG_ERR_UST_LIST_FAIL; goto error;