#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <inttypes.h>
#include <common/common.h>
#include <common/kernel-ctl/kernel-ctl.h>
#include <common/sessiond-comm/sessiond-comm.h>
+#include "consumer.h"
#include "kernel.h"
#include "kern-modules.h"
PERROR("fcntl session fd");
}
+ lks->id = session->id;
lks->consumer_fds_sent = 0;
session->kernel_session = lks;
goto error;
}
- DBG3("Kernel create channel %s in %s with attr: %d, %zu, %zu, %u, %u, %d",
+ DBG3("Kernel create channel %s in %s with attr: %d, %" PRIu64 ", %" PRIu64 ", %u, %u, %d",
chan->name, path, lkc->channel->attr.overwrite,
lkc->channel->attr.subbuf_size, lkc->channel->attr.num_subbuf,
lkc->channel->attr.switch_timer_interval, lkc->channel->attr.read_timer_interval,
if (ret < 0) {
switch (errno) {
case EEXIST:
- ret = LTTCOMM_KERN_EVENT_EXIST;
+ ret = LTTNG_ERR_KERN_EVENT_EXIST;
break;
default:
PERROR("enable kernel event");
if (ret < 0) {
switch (errno) {
case EEXIST:
- ret = LTTCOMM_KERN_EVENT_EXIST;
+ ret = LTTNG_ERR_KERN_EVENT_EXIST;
break;
default:
PERROR("disable kernel event");
end_boot_id:
return 0;
}
+
+/*
+ * Complete teardown of a kernel session.
+ */
+void kernel_destroy_session(struct ltt_kernel_session *ksess)
+{
+ if (ksess == NULL) {
+ DBG3("No kernel session when tearing down session");
+ return;
+ }
+
+ DBG("Tearing down kernel session");
+
+ /* Close any relayd session */
+ consumer_output_send_destroy_relayd(ksess->consumer);
+
+ trace_kernel_destroy_session(ksess);
+}