+#include "agent.hpp"
+#include "channel.hpp"
+#include "kernel.hpp"
+#include "lttng-sessiond.hpp"
+#include "lttng-ust-ctl.hpp"
+#include "lttng-ust-error.hpp"
+#include "ust-app.hpp"
+#include "utils.hpp"
+
+#include <common/common.hpp>
+#include <common/defaults.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
+
-#include <common/common.h>
-#include <common/defaults.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-
-#include "channel.h"
-#include "lttng-sessiond.h"
-#include "kernel.h"
-#include "lttng-ust-ctl.h"
-#include "lttng-ust-error.h"
-#include "utils.h"
-#include "ust-app.h"
-#include "agent.h"
-
chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM;
chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT;
chan->attr.switch_timer_interval = DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER;
chan->attr.read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER;
chan->attr.live_timer_interval = DEFAULT_KERNEL_CHANNEL_LIVE_TIMER;
extended_attr->blocking_timeout = DEFAULT_KERNEL_CHANNEL_BLOCKING_TIMEOUT;
chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM;
chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT;
chan->attr.switch_timer_interval = DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER;
chan->attr.read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER;
chan->attr.live_timer_interval = DEFAULT_KERNEL_CHANNEL_LIVE_TIMER;
extended_attr->blocking_timeout = DEFAULT_KERNEL_CHANNEL_BLOCKING_TIMEOUT;
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;
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;
- chan->attr.live_timer_interval =
- DEFAULT_UST_UID_CHANNEL_LIVE_TIMER;
+ chan->attr.switch_timer_interval = DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER;
+ chan->attr.read_timer_interval = DEFAULT_UST_UID_CHANNEL_READ_TIMER;
+ chan->attr.live_timer_interval = DEFAULT_UST_UID_CHANNEL_LIVE_TIMER;
extended_attr->blocking_timeout = DEFAULT_UST_UID_CHANNEL_BLOCKING_TIMEOUT;
extended_attr->monitor_timer_interval =
DEFAULT_UST_UID_CHANNEL_MONITOR_TIMER;
extended_attr->blocking_timeout = DEFAULT_UST_UID_CHANNEL_BLOCKING_TIMEOUT;
extended_attr->monitor_timer_interval =
DEFAULT_UST_UID_CHANNEL_MONITOR_TIMER;
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.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;
- chan->attr.live_timer_interval =
- DEFAULT_UST_PID_CHANNEL_LIVE_TIMER;
+ chan->attr.switch_timer_interval = DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER;
+ chan->attr.read_timer_interval = DEFAULT_UST_PID_CHANNEL_READ_TIMER;
+ chan->attr.live_timer_interval = DEFAULT_UST_PID_CHANNEL_LIVE_TIMER;
extended_attr->blocking_timeout = DEFAULT_UST_PID_CHANNEL_BLOCKING_TIMEOUT;
extended_attr->monitor_timer_interval =
DEFAULT_UST_PID_CHANNEL_MONITOR_TIMER;
extended_attr->blocking_timeout = DEFAULT_UST_PID_CHANNEL_BLOCKING_TIMEOUT;
extended_attr->monitor_timer_interval =
DEFAULT_UST_PID_CHANNEL_MONITOR_TIMER;
- if (snprintf(chan->name, sizeof(chan->name), "%s",
- channel_name) < 0) {
+ if (snprintf(chan->name, sizeof(chan->name), "%s", channel_name) < 0) {
LTTNG_ASSERT(channel_name);
kchan = trace_kernel_get_channel_by_name(channel_name, ksession);
LTTNG_ASSERT(channel_name);
kchan = trace_kernel_get_channel_by_name(channel_name, ksession);
ret = kernel_disable_channel(kchan);
if (ret < 0 && ret != -EEXIST) {
ret = LTTNG_ERR_KERN_CHAN_DISABLE_FAIL;
ret = kernel_disable_channel(kchan);
if (ret < 0 && ret != -EEXIST) {
ret = LTTNG_ERR_KERN_CHAN_DISABLE_FAIL;
* Enable kernel channel of the kernel session.
*/
enum lttng_error_code channel_kernel_enable(struct ltt_kernel_session *ksession,
* Enable kernel channel of the kernel session.
*/
enum lttng_error_code channel_kernel_enable(struct ltt_kernel_session *ksession,
static int channel_validate_kernel(struct lttng_channel *attr)
{
/* Kernel channels do not support blocking timeout. */
static int channel_validate_kernel(struct lttng_channel *attr)
{
/* Kernel channels do not support blocking timeout. */
* Create kernel channel of the kernel session and notify kernel thread.
*/
enum lttng_error_code channel_kernel_create(struct ltt_kernel_session *ksession,
* Create kernel channel of the kernel session and notify kernel thread.
*/
enum lttng_error_code channel_kernel_create(struct ltt_kernel_session *ksession,
* Enable UST channel for session and domain.
*/
enum lttng_error_code channel_ust_enable(struct ltt_ust_session *usess,
* Enable UST channel for session and domain.
*/
enum lttng_error_code channel_ust_enable(struct ltt_ust_session *usess,
* Create UST channel for session and domain.
*/
enum lttng_error_code channel_ust_create(struct ltt_ust_session *usess,
* Create UST channel for session and domain.
*/
enum lttng_error_code channel_ust_create(struct ltt_ust_session *usess,
enum lttng_domain_type domain = LTTNG_DOMAIN_UST;
bool chan_published = false;
LTTNG_ASSERT(usess);
/* Creating channel attributes if needed */
enum lttng_domain_type domain = LTTNG_DOMAIN_UST;
bool chan_published = false;
LTTNG_ASSERT(usess);
/* Creating channel attributes if needed */
* and nonzero. We validate right here for UST, because applications will
* not report the error to the user (unlike kernel tracing).
*/
* and nonzero. We validate right here for UST, because applications will
* not report the error to the user (unlike kernel tracing).
*/
uchan->id = trace_ust_get_next_chan_id(usess);
DBG2("Channel %s is being created for UST with buffer %d and id %" PRIu64,
uchan->id = trace_ust_get_next_chan_id(usess);
DBG2("Channel %s is being created for UST with buffer %d and id %" PRIu64,
- if (strncmp(uchan->name, DEFAULT_METADATA_NAME,
- sizeof(uchan->name))) {
+ if (strncmp(uchan->name, DEFAULT_METADATA_NAME, sizeof(uchan->name)) != 0) {
* application exists we can access that data in the shadow copy during
* the global update of newly registered application.
*/
* application exists we can access that data in the shadow copy during
* the global update of newly registered application.
*/
- memcpy(&usess->metadata_attr, &uchan->attr,
- sizeof(usess->metadata_attr));
+ memcpy(&usess->metadata_attr, &uchan->attr, sizeof(usess->metadata_attr));
- lttng_channel_set_blocking_timeout(
- channel, uchan->attr.u.s.blocking_timeout);
- lttng_channel_set_monitor_timer_interval(
- channel, uchan->monitor_timer_interval);
+ lttng_channel_set_blocking_timeout(channel, uchan->attr.u.s.blocking_timeout);
+ lttng_channel_set_monitor_timer_interval(channel, uchan->monitor_timer_interval);