Add communication data structure for kconsumerd
authorDavid Goulet <david.goulet@polymtl.ca>
Fri, 6 May 2011 15:13:35 +0000 (11:13 -0400)
committerDavid Goulet <david.goulet@polymtl.ca>
Fri, 6 May 2011 15:13:35 +0000 (11:13 -0400)
First step of the kconsumerd integration. Those structures are needed
for kconsumerd and session daemon communications.

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
liblttsessiondcomm/liblttsessiondcomm.h

index 967c77c206c24c400feb090d37da7c108c96dc3f..e51b813175203516a5f73b309bf7949246279a97 100644 (file)
@@ -1,4 +1,6 @@
-/* Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
+/*
+ * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
+ *                      Julien Desfossez <julien.desfossez@polymtl.ca>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -92,6 +94,20 @@ enum lttcomm_return_code {
        LTTCOMM_NR,                             /* Last element */
 };
 
+/* commands for kconsumerd */
+enum lttcomm_consumerd_command {
+       LTTCOMM_ADD_STREAM = 1100,
+       LTTCOMM_UPDATE_STREAM, /* pause, delete, start depending on fd state */
+       LTTCOMM_STOP, /* delete all */
+};
+
+/* state of each fd in consumerd */
+enum lttcomm_kconsumerd_fd_state {
+       ACTIVE_FD,
+       PAUSE_FD,
+       DELETE_FD,
+};
+
 /*
  * Data structure for ltt-session received message
  */
@@ -144,6 +160,27 @@ struct lttcomm_lttng_msg {
        unsigned int size_payload;
 };
 
+/*
+ * Data structures for the kconsumerd communications
+ *
+ * The header structure is sent to the kconsumerd daemon to inform
+ * how many lttcomm_kconsumerd_msg it is about to receive
+ */
+struct lttcomm_kconsumerd_header {
+       unsigned int payload_size;
+       enum lttcomm_consumerd_command cmd_type;
+       enum lttcomm_return_code ret_code;
+};
+
+/* lttcomm_kconsumerd_msg represents a file descriptor to consume the
+ * data and a path name to write it
+ */
+struct lttcomm_kconsumerd_msg {
+       char path_name[PATH_MAX];
+       int fd;
+       enum lttcomm_kconsumerd_fd_state state;
+};
+
 extern int lttcomm_create_unix_sock(const char *pathname);
 extern int lttcomm_connect_unix_sock(const char *pathname);
 extern int lttcomm_accept_unix_sock(int sock);
This page took 0.027177 seconds and 5 git commands to generate.