Change licensing
[lttng-tools.git] / liblttkconsumerd / liblttkconsumerd.c
index de942a1983182df755938bfe1b840c3262a22215..5735f38b818dcea54a15c08c93ab357ec309a8ac 100644 (file)
@@ -4,8 +4,8 @@
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation; only version 2
+ * of the License.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -61,6 +61,7 @@ struct kconsumerd_global_data {
        unsigned int need_update;
 } kconsumerd_data = {
        .fd_list.head = CDS_LIST_HEAD_INIT(kconsumerd_data.fd_list.head),
+       .need_update = 1,
 };
 
 /* communication with splice */
@@ -75,6 +76,7 @@ static int kconsumerd_poll_pipe[2];
  * received by the library.
  */
 
+
 /* timeout parameter, to control the polling thread grace period */
 static int kconsumerd_poll_timeout = -1;
 
@@ -116,6 +118,7 @@ void kconsumerd_set_command_socket_path(char *sock)
  * kconsumerd_find_session_fd
  *
  * Find a session fd in the global list.
+ * The kconsumerd_data.lock must be locked during this call
  *
  * Return 1 if found else 0
  */
@@ -123,7 +126,6 @@ static int kconsumerd_find_session_fd(int fd)
 {
        struct kconsumerd_fd *iter;
 
-       pthread_mutex_lock(&kconsumerd_data.lock);
        cds_list_for_each_entry(iter, &kconsumerd_data.fd_list.head, list) {
                if (iter->sessiond_fd == fd) {
                        DBG("Duplicate session fd %d", fd);
@@ -131,7 +133,6 @@ static int kconsumerd_find_session_fd(int fd)
                        return 1;
                }
        }
-       pthread_mutex_unlock(&kconsumerd_data.lock);
 
        return 0;
 }
@@ -495,7 +496,7 @@ static int kconsumerd_read_subbuffer(struct kconsumerd_fd *kconsumerd_fd)
        }
 
        switch (DEFAULT_KERNEL_CHANNEL_OUTPUT) {
-       case LTTNG_KERNEL_SPLICE:
+       case LTTNG_EVENT_SPLICE:
                /* read the whole subbuffer */
                err = kernctl_get_padded_subbuf_size(infd, &len);
                if (err != 0) {
@@ -514,7 +515,7 @@ static int kconsumerd_read_subbuffer(struct kconsumerd_fd *kconsumerd_fd)
                        ERR("Error splicing to tracefile");
                }
                break;
-       case LTTNG_KERNEL_MMAP:
+       case LTTNG_EVENT_MMAP:
                /* read the used subbuffer size */
                err = kernctl_get_subbuf_size(infd, &len);
                if (err != 0) {
This page took 0.025217 seconds and 4 git commands to generate.