#include <inttypes.h>
#include <sys/types.h>
-#include <common/common.h>
-#include <common/hashtable/utils.h>
-#include <common/trace-chunk.h>
-#include <common/kernel-ctl/kernel-ctl.h>
-#include <common/kernel-ctl/kernel-ioctl.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/tracker.h>
-#include <common/utils.h>
+#include <common/common.hpp>
+#include <common/hashtable/utils.hpp>
+#include <common/trace-chunk.hpp>
+#include <common/kernel-ctl/kernel-ctl.hpp>
+#include <common/kernel-ctl/kernel-ioctl.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
+#include <common/tracker.hpp>
+#include <common/utils.hpp>
#include <lttng/event.h>
#include <lttng/lttng-error.h>
#include <lttng/tracker.h>
#include <lttng/userspace-probe.h>
-#include <lttng/userspace-probe-internal.h>
+#include <lttng/userspace-probe-internal.hpp>
#include <lttng/condition/event-rule-matches.h>
-#include <lttng/condition/event-rule-matches-internal.h>
+#include <lttng/condition/event-rule-matches-internal.hpp>
#include <lttng/event-rule/event-rule.h>
-#include <lttng/event-rule/event-rule-internal.h>
-#include <lttng/event-rule/kernel-uprobe-internal.h>
-
-#include "event-notifier-error-accounting.h"
-#include "lttng-sessiond.h"
-#include "lttng-syscall.h"
-#include "condition-internal.h"
-#include "consumer.h"
-#include "kernel.h"
-#include "kernel-consumer.h"
-#include "kern-modules.h"
-#include "sessiond-config.h"
-#include "utils.h"
-#include "rotate.h"
-#include "modprobe.h"
-#include "tracker.h"
-#include "notification-thread-commands.h"
+#include <lttng/event-rule/event-rule-internal.hpp>
+#include <lttng/event-rule/kernel-uprobe-internal.hpp>
+
+#include "event-notifier-error-accounting.hpp"
+#include "lttng-sessiond.hpp"
+#include "lttng-syscall.hpp"
+#include "condition-internal.hpp"
+#include "consumer.hpp"
+#include "kernel.hpp"
+#include "kernel-consumer.hpp"
+#include "kern-modules.hpp"
+#include "sessiond-config.hpp"
+#include "utils.hpp"
+#include "rotate.hpp"
+#include "modprobe.hpp"
+#include "tracker.hpp"
+#include "notification-thread-commands.hpp"
/*
* Key used to reference a channel between the sessiond and the consumer. This
* See kernel-ctl.h for explanation of this value
*/
nbmem = KERNEL_EVENT_INIT_LIST_SIZE;
- elist = (lttng_event *) zmalloc(sizeof(struct lttng_event) * nbmem);
+ elist = calloc<lttng_event>(nbmem);
if (elist == NULL) {
PERROR("alloc list events");
count = -ENOMEM;
*/
enum lttng_error_code kernel_snapshot_record(
struct ltt_kernel_session *ksess,
- const struct consumer_output *output, int wait,
+ const struct consumer_output *output,
uint64_t nb_packets_per_stream)
{
int err, ret, saved_metadata_fd;
/* For each channel, ask the consumer to snapshot it. */
cds_list_for_each_entry(chan, &ksess->channel_list.head, list) {
status = consumer_snapshot_channel(socket, chan->key, output, 0,
- ksess->uid, ksess->gid,
- &trace_path[consumer_path_offset], wait,
+ &trace_path[consumer_path_offset],
nb_packets_per_stream);
if (status != LTTNG_OK) {
(void) kernel_consumer_destroy_metadata(socket,
/* Snapshot metadata, */
status = consumer_snapshot_channel(socket, ksess->metadata->key, output,
- 1, ksess->uid, ksess->gid, &trace_path[consumer_path_offset],
- wait, 0);
+ 1, &trace_path[consumer_path_offset], 0);
if (status != LTTNG_OK) {
goto error_consumer;
}
DBG("Rotate kernel channel %" PRIu64 ", session %s",
chan->key, session->name);
ret = consumer_rotate_channel(socket, chan->key,
- ksess->uid, ksess->gid, ksess->consumer,
+ ksess->consumer,
/* is_metadata_channel */ false);
if (ret < 0) {
status = LTTNG_ERR_ROTATION_FAIL_CONSUMER;
* Rotate the metadata channel.
*/
ret = consumer_rotate_channel(socket, ksess->metadata->key,
- ksess->uid, ksess->gid, ksess->consumer,
+ ksess->consumer,
/* is_metadata_channel */ true);
if (ret < 0) {
status = LTTNG_ERR_ROTATION_FAIL_CONSUMER;