Metadata generation (partial)
[lttng-modules.git] / ltt-tracer.h
index 1540a28acf06d8ed74f70503de35390864812b76..3bb55234aa5bea4bb2ff704a117fa06754c7668b 100644 (file)
 #include "ltt-tracer-core.h"
 #include "ltt-events.h"
 
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
+#endif
+
 /* Number of bytes to log with a read/write event */
 #define LTT_LOG_RW_SIZE                        32L
 
@@ -109,6 +113,16 @@ struct event_header {
 
 #define LTT_MAX_SMALL_SIZE             0xFFFFU
 
+static inline
+size_t ltt_get_header_alignment(void)
+{
+#ifdef RING_BUFFER_ALIGN
+       return sizeof(struct event_header) * CHAR_BIT;
+#else
+       return CHAR_BIT;
+#endif
+}
+
 /*
  * We use asm/timex.h : cpu_khz/HZ variable in here : we might have to deal
  * specifically with CPU frequency scaling someday, so using an interpolation
@@ -160,6 +174,12 @@ struct packet_header {
 #define LTT_TRACER_VERSION_MAJOR       3
 #define LTT_TRACER_VERSION_MINOR       0
 
+/*
+ * Number of milliseconds to retry before failing metadata writes on buffer full
+ * condition. (10 seconds)
+ */
+#define LTTNG_METADATA_TIMEOUT_MSEC    10000
+
 /*
  * Size reserved for high priority events (interrupts, NMI, BH) at the end of a
  * nearly full buffer. User space won't use this last amount of space when in
This page took 0.023289 seconds and 4 git commands to generate.