\-\-overwrite
Flight recorder mode : overwrites events when subbuffers are full
\-\-subbuf-size SIZE
- Subbuffer size in bytes {+k,+M,+G} (default: 4096, kernel default: 262144)
+ Subbuffer size in bytes {+k,+M,+G}
+ (default UST uid: 131072, UST pid: 4096, kernel: 262144, metadata: 4096)
Rounded up to the next power of 2.
\-\-num-subbuf NUM
- Number of subbuffers (default: 4)
+ Number of subbuffers. (default UST uid: 4, UST pid: 4, kernel: 4, metadata: 2)
Rounded up to the next power of 2.
\-\-switch-timer USEC
- Switch subbuffer timer interval in µsec (default: 0)
+ Switch subbuffer timer interval in µsec.
+ (default UST uid: 0, UST pid: 0, kernel: 0, metadata: 0)
\-\-read-timer USEC
- Read timer interval in µsec (UST default: 0, kernel default: 200000)
+ Read timer interval in µsec.
+ (default UST uid: 0, UST pid: 0, kernel: 200000, metadata: 0)
\-\-output TYPE
Channel output type. Possible values: mmap, splice
+ (default UST uid: mmap, UST pid: mmap, kernel: splice, metadata: mmap)
\-\-buffers-uid
Use per UID buffer (\-u only). Buffers are shared between applications
that have the same UID.
Use shared buffer for the whole system (\-k only)
\-C, \-\-tracefile-size SIZE
Maximum size of each tracefile within a stream (in bytes).
+ 0 means unlimited. (default: 0)
\-W, \-\-tracefile-count COUNT
Used in conjunction with \-C option, this will limit the number
- of files created to the specified count.
+ of files created to the specified count. 0 means unlimited. (default: 0)
.B EXAMPLES:
/*
* Return allocated channel attributes.
*/
-struct lttng_channel *channel_new_default_attr(int dom)
+struct lttng_channel *channel_new_default_attr(int dom,
+ enum lttng_buffer_type type)
{
struct lttng_channel *chan;
goto error;
}
+ /* Same for all domains. */
chan->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE;
+ chan->attr.tracefile_size = DEFAULT_CHANNEL_TRACEFILE_SIZE;
+ chan->attr.tracefile_count = DEFAULT_CHANNEL_TRACEFILE_COUNT;
switch (dom) {
case LTTNG_DOMAIN_KERNEL:
+ assert(type == LTTNG_BUFFER_GLOBAL);
chan->attr.subbuf_size =
default_get_kernel_channel_subbuf_size();
chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM;
chan->attr.read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER;
break;
case LTTNG_DOMAIN_UST:
-#if 0
- case LTTNG_DOMAIN_UST_PID:
- case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
- case LTTNG_DOMAIN_UST_EXEC_NAME:
-#endif
- chan->attr.subbuf_size = default_get_ust_channel_subbuf_size();
- chan->attr.num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM;
- chan->attr.output = DEFAULT_UST_CHANNEL_OUTPUT;
- chan->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER;
- chan->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER;
+ switch (type) {
+ case LTTNG_BUFFER_PER_UID:
+ chan->attr.subbuf_size = default_get_ust_uid_channel_subbuf_size();
+ chan->attr.num_subbuf = DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM;
+ chan->attr.output = DEFAULT_UST_UID_CHANNEL_OUTPUT;
+ chan->attr.switch_timer_interval =
+ DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER;
+ chan->attr.read_timer_interval =
+ DEFAULT_UST_UID_CHANNEL_READ_TIMER;
+ break;
+ case LTTNG_BUFFER_PER_PID:
+ default:
+ chan->attr.subbuf_size = default_get_ust_pid_channel_subbuf_size();
+ chan->attr.num_subbuf = DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM;
+ chan->attr.output = DEFAULT_UST_PID_CHANNEL_OUTPUT;
+ chan->attr.switch_timer_interval =
+ DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER;
+ chan->attr.read_timer_interval =
+ DEFAULT_UST_PID_CHANNEL_READ_TIMER;
+ break;
+ }
break;
default:
goto error; /* Not implemented */
/* Creating channel attributes if needed */
if (attr == NULL) {
- defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL);
+ defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL,
+ LTTNG_BUFFER_GLOBAL);
if (defattr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
/* Creating channel attributes if needed */
if (attr == NULL) {
- defattr = channel_new_default_attr(LTTNG_DOMAIN_UST);
+ defattr = channel_new_default_attr(LTTNG_DOMAIN_UST, type);
if (defattr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
attr = defattr;
}
- if (attr->attr.subbuf_size < DEFAULT_UST_CHANNEL_SUBBUF_SIZE) {
- ret = LTTNG_ERR_INVALID;
- goto error;
- }
-
/*
* Validate UST buffer size and number of buffers: must both be power of 2
* and nonzero. We validate right here for UST, because applications will
/* Validate buffer type. */
switch (type) {
case LTTNG_BUFFER_PER_PID:
+ if (attr->attr.subbuf_size <
+ default_get_ust_pid_channel_subbuf_size()) {
+ ret = LTTNG_ERR_INVALID;
+ goto error;
+ }
+ break;
case LTTNG_BUFFER_PER_UID:
+ if (attr->attr.subbuf_size <
+ default_get_ust_uid_channel_subbuf_size()) {
+ ret = LTTNG_ERR_INVALID;
+ goto error;
+ }
break;
default:
ret = LTTNG_ERR_BUFFER_NOT_SUPPORTED;
int channel_kernel_create(struct ltt_kernel_session *ksession,
struct lttng_channel *chan, int kernel_pipe);
-struct lttng_channel *channel_new_default_attr(int domain);
+struct lttng_channel *channel_new_default_attr(int domain,
+ enum lttng_buffer_type type);
int channel_ust_create(struct ltt_ust_session *usess,
struct lttng_channel *attr, enum lttng_buffer_type type);
if (chan_count == 0) {
struct lttng_channel *attr;
/* Create default channel */
- attr = channel_new_default_attr(domain);
+ attr = channel_new_default_attr(domain, usess->buffer_type);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
kchan = trace_kernel_get_channel_by_name(channel_name,
session->kernel_session);
if (kchan == NULL) {
- attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL,
+ LTTNG_BUFFER_GLOBAL);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
channel_name);
if (uchan == NULL) {
/* Create default channel */
- attr = channel_new_default_attr(LTTNG_DOMAIN_UST);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_UST,
+ usess->buffer_type);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
session->kernel_session);
if (kchan == NULL) {
/* Create default channel */
- attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL,
+ LTTNG_BUFFER_GLOBAL);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
channel_name);
if (uchan == NULL) {
/* Create default channel */
- attr = channel_new_default_attr(LTTNG_DOMAIN_UST);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_UST,
+ usess->buffer_type);
if (attr == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;
lum->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE;
lum->attr.subbuf_size = default_get_metadata_subbuf_size();
lum->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM;
- lum->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER;
- lum->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER;
+ lum->attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER;
+ lum->attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER;
lum->attr.output = LTTNG_UST_MMAP;
lum->handle = -1;
metadata->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE;
metadata->attr.subbuf_size = default_get_metadata_subbuf_size();
metadata->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM;
- metadata->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER;
- metadata->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER;
+ metadata->attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER;
+ metadata->attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER;
metadata->attr.output = LTTNG_UST_MMAP;
metadata->attr.type = LTTNG_UST_CHAN_METADATA;
} else {
fprintf(ofp, " --overwrite Flight recorder mode%s\n",
DEFAULT_CHANNEL_OVERWRITE ? " (default)" : "");
fprintf(ofp, " --subbuf-size SIZE Subbuffer size in bytes {+k,+M,+G}\n");
- fprintf(ofp, " (default: %zu, kernel default: %zu)\n",
- default_get_channel_subbuf_size(),
- default_get_kernel_channel_subbuf_size());
+ fprintf(ofp, " (default UST uid: %zu, UST pid: %zu, kernel: %zu, metadata: %zu)\n",
+ default_get_ust_uid_channel_subbuf_size(),
+ default_get_ust_pid_channel_subbuf_size(),
+ default_get_kernel_channel_subbuf_size(),
+ default_get_metadata_subbuf_size());
fprintf(ofp, " Rounded up to the next power of 2.\n");
fprintf(ofp, " --num-subbuf NUM Number of subbufers\n");
- fprintf(ofp, " (default: %u)\n",
- DEFAULT_CHANNEL_SUBBUF_NUM);
+ fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u, metadata: %u)\n",
+ DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM, DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM,
+ DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM, DEFAULT_METADATA_SUBBUF_NUM);
fprintf(ofp, " Rounded up to the next power of 2.\n");
- fprintf(ofp, " --switch-timer USEC Switch timer interval in usec (default: %u)\n",
- DEFAULT_CHANNEL_SWITCH_TIMER);
- fprintf(ofp, " --read-timer USEC Read timer interval in usec (UST default: %u, kernel default: %u)\n",
- DEFAULT_UST_CHANNEL_READ_TIMER, DEFAULT_KERNEL_CHANNEL_READ_TIMER);
+ fprintf(ofp, " --switch-timer USEC Switch timer interval in usec\n");
+ fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u, metadata: %u)\n",
+ DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER, DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER,
+ DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER, DEFAULT_METADATA_SWITCH_TIMER);
+ fprintf(ofp, " --read-timer USEC Read timer interval in usec.\n");
+ fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u, metadata: %u)\n",
+ DEFAULT_UST_UID_CHANNEL_READ_TIMER, DEFAULT_UST_UID_CHANNEL_READ_TIMER,
+ DEFAULT_KERNEL_CHANNEL_READ_TIMER, DEFAULT_METADATA_READ_TIMER);
fprintf(ofp, " --output TYPE Channel output type (Values: %s, %s)\n",
output_mmap, output_splice);
+ fprintf(ofp, " (default UST uid: %s, UST pid: %s, kernel: %s, metadata: %s)\n",
+ DEFAULT_UST_UID_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice,
+ DEFAULT_UST_PID_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice,
+ DEFAULT_KERNEL_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice,
+ DEFAULT_METADATA_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice);
fprintf(ofp, " --buffers-uid Use per UID buffer (-u only)\n");
fprintf(ofp, " --buffers-pid Use per PID buffer (-u only)\n");
fprintf(ofp, " --buffers-global Use shared buffer for the whole system (-k only)\n");
fprintf(ofp, " -C, --tracefile-size SIZE\n");
- fprintf(ofp, " Maximum size of each tracefile within a stream (in bytes).\n");
+ fprintf(ofp, " Maximum size of each tracefile within a stream (in bytes). 0 means unlimited.\n");
+ fprintf(ofp, " (default: %u)\n", DEFAULT_CHANNEL_TRACEFILE_SIZE);
fprintf(ofp, " -W, --tracefile-count COUNT\n");
fprintf(ofp, " Used in conjunction with -C option, this will limit the number\n");
- fprintf(ofp, " of files created to the specified count.\n");
+ fprintf(ofp, " of files created to the specified count. 0 means unlimited.\n");
+ fprintf(ofp, " (default: %u)\n", DEFAULT_CHANNEL_TRACEFILE_COUNT);
fprintf(ofp, "\n");
}
size_t default_channel_subbuf_size;
size_t default_metadata_subbuf_size;
size_t default_kernel_channel_subbuf_size;
-size_t default_ust_channel_subbuf_size;
+size_t default_ust_pid_channel_subbuf_size;
+size_t default_ust_uid_channel_subbuf_size;
static void __attribute__((constructor)) init_defaults(void)
{
}
default_channel_subbuf_size =
- max(DEFAULT_CHANNEL_SUBBUF_SIZE, page_size);
+ max(_DEFAULT_CHANNEL_SUBBUF_SIZE, page_size);
default_metadata_subbuf_size =
max(DEFAULT_METADATA_SUBBUF_SIZE, page_size);
default_kernel_channel_subbuf_size =
max(DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE, page_size);
- default_ust_channel_subbuf_size =
- max(DEFAULT_UST_CHANNEL_SUBBUF_SIZE, page_size);
+ default_ust_pid_channel_subbuf_size =
+ max(DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE, page_size);
+ default_ust_uid_channel_subbuf_size =
+ max(DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE, page_size);
}
/* Default channel attributes */
#define DEFAULT_CHANNEL_NAME "channel0"
-#define DEFAULT_CHANNEL_OVERWRITE 0 /* usec */
-/* 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 4
-#define DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */
-#define DEFAULT_CHANNEL_READ_TIMER 200000 /* usec */
-#define DEFAULT_CHANNEL_OUTPUT LTTNG_EVENT_MMAP
-
+#define DEFAULT_CHANNEL_OVERWRITE 0
+#define DEFAULT_CHANNEL_TRACEFILE_SIZE 0
+#define DEFAULT_CHANNEL_TRACEFILE_COUNT 0
+
+/* Must always be a power of 2 */
+#define _DEFAULT_CHANNEL_SUBBUF_SIZE 4096 /* bytes */
+/* Must always be a power of 2 */
+#define _DEFAULT_CHANNEL_SUBBUF_NUM 4
+#define _DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */
+#define _DEFAULT_CHANNEL_READ_TIMER 200000 /* usec */
+#define _DEFAULT_CHANNEL_OUTPUT LTTNG_EVENT_MMAP
+
+/* Metadata channel defaults. */
#define DEFAULT_METADATA_SUBBUF_SIZE 4096
#define DEFAULT_METADATA_SUBBUF_NUM 2
#define DEFAULT_METADATA_CACHE_SIZE 4096
+#define DEFAULT_METADATA_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER
+#define DEFAULT_METADATA_READ_TIMER 0
+#define DEFAULT_METADATA_OUTPUT _DEFAULT_CHANNEL_OUTPUT
/* Kernel has different defaults */
/* DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE must always be a power of 2 */
-#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE 262144 /* bytes */
+#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE 262144 /* bytes */
/*
* DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM must always be a power of 2.
* Update help manually if override.
*/
-#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM DEFAULT_CHANNEL_SUBBUF_NUM
+#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM
/* See lttng-kernel.h enum lttng_kernel_output for channel output */
-#define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_EVENT_SPLICE
-/* By default, unlimited tracefile size */
-#define DEFAULT_KERNEL_CHANNEL_TRACEFILE_SIZE 0
-/* By default, unlimited tracefile count */
-#define DEFAULT_KERNEL_CHANNEL_TRACEFILE_COUNT 0
-
-#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER \
- DEFAULT_CHANNEL_SWITCH_TIMER
-#define DEFAULT_KERNEL_CHANNEL_READ_TIMER 200000 /* usec */
+#define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_EVENT_SPLICE
+#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER
+#define DEFAULT_KERNEL_CHANNEL_READ_TIMER _DEFAULT_CHANNEL_READ_TIMER
/* User space defaults */
/* Must be a power of 2 */
-#define DEFAULT_UST_CHANNEL_SUBBUF_SIZE 4096 /* bytes */
+#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE _DEFAULT_CHANNEL_SUBBUF_SIZE
+#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072 /* bytes */
/* Must be a power of 2. Update help manuall if override. */
-#define DEFAULT_UST_CHANNEL_SUBBUF_NUM DEFAULT_CHANNEL_SUBBUF_NUM
+#define DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM
+#define DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM
/* See lttng-ust.h enum lttng_ust_output */
-#define DEFAULT_UST_CHANNEL_OUTPUT LTTNG_EVENT_MMAP
-/* By default, unlimited tracefile size */
-#define DEFAULT_UST_CHANNEL_TRACEFILE_SIZE 0
-/* By default, unlimited tracefile count */
-#define DEFAULT_UST_CHANNEL_TRACEFILE_COUNT 0
+#define DEFAULT_UST_PID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT
+#define DEFAULT_UST_UID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT
+/* Timers in usec. */
+#define DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER
+#define DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER
-#define DEFAULT_UST_CHANNEL_SWITCH_TIMER \
- DEFAULT_CHANNEL_SWITCH_TIMER
-#define DEFAULT_UST_CHANNEL_READ_TIMER 0 /* usec */
+#define DEFAULT_UST_PID_CHANNEL_READ_TIMER 0 /* usec */
+#define DEFAULT_UST_UID_CHANNEL_READ_TIMER 0 /* usec */
/*
* Default timeout value for the sem_timedwait() call. Blocking forever is not
extern size_t default_channel_subbuf_size;
extern size_t default_metadata_subbuf_size;
-extern size_t default_ust_channel_subbuf_size;
+extern size_t default_ust_pid_channel_subbuf_size;
+extern size_t default_ust_uid_channel_subbuf_size;
extern size_t default_kernel_channel_subbuf_size;
-
/*
* Returns the default subbuf size.
*
}
/*
- * Returns the default subbuf size for the UST domain.
+ * Returns the default subbuf size for the UST domain per PID.
+ *
+ * This function depends on a value that is set at constructor time, so it is
+ * unsafe to call it from another constructor.
+ */
+static inline
+size_t default_get_ust_pid_channel_subbuf_size(void)
+{
+ return default_ust_pid_channel_subbuf_size;
+}
+
+/*
+ * Returns the default subbuf size for the UST domain per UID.
*
* This function depends on a value that is set at constructor time, so it is
* unsafe to call it from another constructor.
*/
static inline
-size_t default_get_ust_channel_subbuf_size(void)
+size_t default_get_ust_uid_channel_subbuf_size(void)
{
- return default_ust_channel_subbuf_size;
+ return default_ust_uid_channel_subbuf_size;
}
#endif /* _DEFAULTS_H */
memset(attr, 0, sizeof(struct lttng_channel_attr));
+ /* Same for all domains. */
+ attr->overwrite = DEFAULT_CHANNEL_OVERWRITE;
+ attr->tracefile_size = DEFAULT_CHANNEL_TRACEFILE_SIZE;
+ attr->tracefile_count = DEFAULT_CHANNEL_TRACEFILE_COUNT;
+
switch (domain->type) {
case LTTNG_DOMAIN_KERNEL:
- attr->overwrite = DEFAULT_CHANNEL_OVERWRITE;
attr->switch_timer_interval = DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER;
attr->read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER;
-
attr->subbuf_size = default_get_kernel_channel_subbuf_size();
attr->num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM;
attr->output = DEFAULT_KERNEL_CHANNEL_OUTPUT;
- attr->tracefile_size = DEFAULT_KERNEL_CHANNEL_TRACEFILE_SIZE;
- attr->tracefile_count = DEFAULT_KERNEL_CHANNEL_TRACEFILE_COUNT;
break;
case LTTNG_DOMAIN_UST:
- attr->overwrite = DEFAULT_CHANNEL_OVERWRITE;
- attr->switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER;
- attr->read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER;
-
- attr->subbuf_size = default_get_ust_channel_subbuf_size();
- attr->num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM;
- attr->output = DEFAULT_UST_CHANNEL_OUTPUT;
- attr->tracefile_size = DEFAULT_UST_CHANNEL_TRACEFILE_SIZE;
- attr->tracefile_count = DEFAULT_UST_CHANNEL_TRACEFILE_COUNT;
- break;
+ switch (domain->buf_type) {
+ case LTTNG_BUFFER_PER_UID:
+ attr->subbuf_size = default_get_ust_uid_channel_subbuf_size();
+ attr->num_subbuf = DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM;
+ attr->output = DEFAULT_UST_UID_CHANNEL_OUTPUT;
+ attr->switch_timer_interval = DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER;
+ attr->read_timer_interval = DEFAULT_UST_UID_CHANNEL_READ_TIMER;
+ break;
+ case LTTNG_BUFFER_PER_PID:
+ default:
+ attr->subbuf_size = default_get_ust_pid_channel_subbuf_size();
+ attr->num_subbuf = DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM;
+ attr->output = DEFAULT_UST_PID_CHANNEL_OUTPUT;
+ attr->switch_timer_interval = DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER;
+ attr->read_timer_interval = DEFAULT_UST_PID_CHANNEL_READ_TIMER;
+ break;
+ }
default:
/* Default behavior: leave set to 0. */
break;
metadata->attr.num_subbuf
== DEFAULT_METADATA_SUBBUF_NUM &&
metadata->attr.switch_timer_interval
- == DEFAULT_UST_CHANNEL_SWITCH_TIMER &&
+ == DEFAULT_METADATA_SWITCH_TIMER &&
metadata->attr.read_timer_interval
- == DEFAULT_UST_CHANNEL_READ_TIMER &&
+ == DEFAULT_METADATA_READ_TIMER &&
metadata->attr.output == LTTNG_UST_MMAP,
"Validate UST session metadata");