Now takes a session name and no lttng_handle anymore.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
*
* 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);
/*
/*
* 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) {
/*
* 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;
/* Domain listing */
if (opt_domain) {
- ret = list_domains();
+ ret = list_domains(session_name);
goto end;
}
}
} 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;