Fix: Add space for stream name CPU number
authorDavid Goulet <dgoulet@efficios.com>
Fri, 2 Nov 2012 17:16:29 +0000 (13:16 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 2 Nov 2012 17:17:40 +0000 (13:17 -0400)
Fixes #358

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/trace-kernel.h
src/bin/lttng-sessiond/trace-ust.h
src/common/defaults.h
src/common/sessiond-comm/relayd.h
src/common/sessiond-comm/sessiond-comm.h

index e5a8f3b0b4c0f6acd7268cf760bca94e777b6503..96a3664b4158d8a78f13053bfe75ab7a83d9272b 100644 (file)
@@ -23,6 +23,7 @@
 #include <lttng/lttng.h>
 #include <common/lttng-kernel.h>
 #include <common/lttng-kernel-old.h>
+#include <common/defaults.h>
 
 #include "consumer.h"
 
@@ -82,7 +83,7 @@ struct ltt_kernel_stream {
        int fd;
        int state;
        /* Format is %s_%d respectively channel name and CPU number. */
-       char name[LTTNG_SYMBOL_NAME_LEN];
+       char name[DEFAULT_STREAM_NAME_LEN];
        struct cds_list_head list;
 };
 
index 845bcd6c91965b309114a04f539098aad3f4f16f..f01f82d7dfdee36c9067a336b8e1c7a0e2352906 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <lttng/lttng.h>
 #include <common/hashtable/hashtable.h>
+#include <common/defaults.h>
 
 #include "consumer.h"
 #include "ust-ctl.h"
@@ -54,7 +55,7 @@ struct ltt_ust_stream {
        int handle;
        char pathname[PATH_MAX];
        /* Format is %s_%d respectively channel name and CPU number. */
-       char name[LTTNG_SYMBOL_NAME_LEN];
+       char name[DEFAULT_STREAM_NAME_LEN];
        struct lttng_ust_object_data *obj;
        /* Using a list of streams to keep order. */
        struct cds_list_head list;
index 9853fbc9e81d7ebaa024d2baeac4be859dfe2eae..5495531f6318a5177b9d3e97fb05ff939121075f 100644 (file)
  */
 #define DEFAULT_POLL_SIZE 65535
 
+/*
+ * Format is %s_%d respectively channel name and CPU number. Eigth bytes
+ * are added here to add space for the CPU number. I guess 2^8 CPUs is more
+ * than enough. We might end up with quantum computing in a cell phone when
+ * reaching this limit.
+ */
+#define DEFAULT_STREAM_NAME_LEN        LTTNG_SYMBOL_NAME_LEN + 8
+
 /* Default channel attributes */
 #define DEFAULT_CHANNEL_NAME            "channel0"
 #define DEFAULT_CHANNEL_OVERWRITE       0       /* usec */
index b897714d719ea1e618af6f9b2695c46d301007da..7bc7a12173236b4609322291ec3d5af89038853b 100644 (file)
@@ -25,6 +25,7 @@
 #include <stdint.h>
 
 #include <lttng/lttng.h>
+#include <common/defaults.h>
 
 #define RELAYD_VERSION_COMM_MAJOR             2
 #define RELAYD_VERSION_COMM_MINOR             1
@@ -56,7 +57,7 @@ struct lttcomm_relayd_data_hdr {
  * Used to add a stream on the relay daemon.
  */
 struct lttcomm_relayd_add_stream {
-       char channel_name[LTTNG_SYMBOL_NAME_LEN];
+       char channel_name[DEFAULT_STREAM_NAME_LEN];
        char pathname[PATH_MAX];
 } __attribute__ ((__packed__));
 
index b94d3fb8d6229300fea7fda8203e4dda1b7fe27d..e69c32bb2dfc80392a17532592057008535e3a44 100644 (file)
@@ -30,6 +30,7 @@
 #include <lttng/lttng.h>
 #include <common/compat/socket.h>
 #include <common/uri.h>
+#include <common/defaults.h>
 
 #include <arpa/inet.h>
 #include <netinet/in.h>
@@ -274,7 +275,7 @@ struct lttcomm_consumer_msg {
                        char path_name[PATH_MAX];
                        int net_index;
                        unsigned int metadata_flag;
-                       char name[LTTNG_SYMBOL_NAME_LEN];  /* Name string of the stream */
+                       char name[DEFAULT_STREAM_NAME_LEN];  /* Name string of the stream */
                        uint64_t session_id;   /* Tracing session id of the stream */
                } stream;
                struct {
This page took 0.030047 seconds and 4 git commands to generate.