API change for lttng_list_domains prototype
authorDavid Goulet <david.goulet@polymtl.ca>
Tue, 6 Dec 2011 19:54:13 +0000 (14:54 -0500)
committerDavid Goulet <david.goulet@polymtl.ca>
Tue, 6 Dec 2011 19:58:14 +0000 (14:58 -0500)
Now takes a session name and no lttng_handle anymore.

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
include/lttng/lttng.h
liblttngctl/lttngctl.c
lttng/commands/list.c

index bfe2cc5c3324ddf40e7a86c9266e8b1f72fd3f4c..ebcdd2b58e94ca83484b3b7fad4972f9d3e91b74 100644 (file)
@@ -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);
 
 /*
index ed685966ee43c606e11d60669a4e8f20ccfba9a7..c5e8cf8f8cffae86ecce900354f13a0752b4e382 100644 (file)
@@ -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) {
index 991ad28d6b01c7238fff29ee3cf912e651d1b826..6f37254e41c35ce6de41c1215483ecee9058a212 100644 (file)
@@ -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;
This page took 0.036678 seconds and 4 git commands to generate.