From: David Goulet Date: Tue, 6 Dec 2011 19:54:13 +0000 (-0500) Subject: API change for lttng_list_domains prototype X-Git-Tag: v2.0-pre15~28 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=330be774319277f86ecf9445603bf97dc3249ca3;p=lttng-tools.git API change for lttng_list_domains prototype Now takes a session name and no lttng_handle anymore. Signed-off-by: David Goulet --- diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index bfe2cc5c3..ebcdd2b58 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -256,7 +256,7 @@ extern int lttng_list_sessions(struct lttng_session **sessions); * * Return the size of the "lttng_domain" array. Caller must free(3). */ -extern int lttng_list_domains(struct lttng_handle *handle, +extern int lttng_list_domains(const char *session_name, struct lttng_domain **domains); /* diff --git a/liblttngctl/lttngctl.c b/liblttngctl/lttngctl.c index ed685966e..c5e8cf8f8 100644 --- a/liblttngctl/lttngctl.c +++ b/liblttngctl/lttngctl.c @@ -708,20 +708,19 @@ int lttng_list_sessions(struct lttng_session **sessions) /* * List domain of a session. */ -int lttng_list_domains(struct lttng_handle *handle, +int lttng_list_domains(const char *session_name, struct lttng_domain **domains) { int ret; struct lttcomm_session_msg lsm; - if (handle == NULL) { + if (session_name == NULL) { return -1; } lsm.cmd_type = LTTNG_LIST_DOMAINS; - copy_string(lsm.session.name, handle->session_name, - sizeof(lsm.session.name)); + copy_string(lsm.session.name, session_name, sizeof(lsm.session.name)); ret = ask_sessiond(&lsm, (void**) domains); if (ret < 0) { diff --git a/lttng/commands/list.c b/lttng/commands/list.c index 991ad28d6..6f37254e4 100644 --- a/lttng/commands/list.c +++ b/lttng/commands/list.c @@ -482,14 +482,14 @@ error: /* * List available domain(s) for a session. */ -static int list_domains(void) +static int list_domains(const char *session_name) { int i, count, ret = CMD_SUCCESS; struct lttng_domain *domains = NULL; MSG("Domains:\n-------------"); - count = lttng_list_domains(handle, &domains); + count = lttng_list_domains(session_name, &domains); if (count < 0) { ret = count; goto error; @@ -601,7 +601,7 @@ int cmd_list(int argc, const char **argv) /* Domain listing */ if (opt_domain) { - ret = list_domains(); + ret = list_domains(session_name); goto end; } @@ -613,7 +613,7 @@ int cmd_list(int argc, const char **argv) } } else { /* We want all domain(s) */ - nb_domain = lttng_list_domains(handle, &domains); + nb_domain = lttng_list_domains(session_name, &domains); if (nb_domain < 0) { ret = nb_domain; goto end;