#define LTTNG_RUNDIR "/var/run/lttng"
/* Default channel attributes */
-#define DEFAULT_CHANNEL_NAME "channel0"
-#define DEFAULT_CHANNEL_OVERWRITE 0
-#define DEFAULT_CHANNEL_SUBBUF_SIZE 4096 /* bytes */
-#define DEFAULT_CHANNEL_SUBBUF_NUM 8 /* Must always be a power of 2 */
-#define DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */
-#define DEFAULT_CHANNEL_READ_TIMER 200 /* usec */
-#define DEFAULT_CHANNEL_OUTPUT 0 /* splice, mmap (0: SPLICE, 1: MMAP, see lttng.h) */
+#define DEFAULT_CHANNEL_NAME "channel0"
+#define DEFAULT_CHANNEL_OVERWRITE 0
+/* DEFAULT_CHANNEL_SUBBUF_SIZE must always be a power of 2 */
+#define DEFAULT_CHANNEL_SUBBUF_SIZE 4096 /* bytes */
+/* DEFAULT_CHANNEL_SUBBUF_NUM must always be a power of 2 */
+#define DEFAULT_CHANNEL_SUBBUF_NUM 8
+#define DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */
+#define DEFAULT_CHANNEL_READ_TIMER 200 /* usec */
+/* See lttng.h enum lttng_kernel_output for channel output */
+#define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_KERNEL_SPLICE
+#define DEFAULT_UST_CHANNEL_OUTPUT LTTNG_UST_MMAP
/*
* lttng user-space instrumentation type
goto end;
}
- if (DEFAULT_CHANNEL_OUTPUT == LTTNG_KERNEL_SPLICE) {
+ switch (DEFAULT_KERNEL_CHANNEL_OUTPUT) {
+ case LTTNG_KERNEL_SPLICE:
/* read the whole subbuffer */
err = kernctl_get_padded_subbuf_size(infd, &len);
if (err != 0) {
*/
ERR("Error splicing to tracefile");
}
- } else if (DEFAULT_CHANNEL_OUTPUT == LTTNG_KERNEL_MMAP) {
+ break;
+ case LTTNG_KERNEL_MMAP:
/* read the used subbuffer size */
err = kernctl_get_subbuf_size(infd, &len);
if (err != 0) {
*/
ERR("Error writing to tracefile");
}
- } else {
+ break;
+ default:
ERR("Unknown output method");
ret = -1;
- goto end;
}
err = kernctl_put_next_subbuf(infd);
chan->attr.num_subbuf = DEFAULT_CHANNEL_SUBBUF_NUM;
chan->attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER;
chan->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER;
- chan->attr.output = DEFAULT_CHANNEL_OUTPUT;
+ chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT;
error:
return chan;
chan->attr.num_subbuf = DEFAULT_CHANNEL_SUBBUF_NUM;
chan->attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER;
chan->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER;
- chan->attr.output = DEFAULT_CHANNEL_OUTPUT;
+ chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT;
/* Init metadata */
lkm->fd = 0;
chan.attr.num_subbuf = DEFAULT_CHANNEL_SUBBUF_NUM;
chan.attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER;
chan.attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER;
- chan.attr.output = DEFAULT_CHANNEL_OUTPUT;
+ chan.attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT;
}
/*