*
* 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;
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;
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 */
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;