#include <lttng/lttng-error.h>
#include <lttng/kernel-probe.h>
#include <lttng/userspace-probe.h>
-#include <lttng/userspace-probe-internal.h>
+#include <lttng/userspace-probe-internal.hpp>
#include <lttng/event-rule/event-rule.h>
-#include <lttng/event-rule/event-rule-internal.h>
+#include <lttng/event-rule/event-rule-internal.hpp>
#include <lttng/event-rule/kernel-kprobe.h>
-#include <lttng/event-rule/kernel-kprobe-internal.h>
+#include <lttng/event-rule/kernel-kprobe-internal.hpp>
#include <lttng/event-rule/kernel-syscall.h>
-#include <lttng/event-rule/kernel-syscall-internal.h>
+#include <lttng/event-rule/kernel-syscall-internal.hpp>
#include <lttng/event-rule/kernel-tracepoint.h>
-#include <lttng/event-rule/kernel-tracepoint-internal.h>
+#include <lttng/event-rule/kernel-tracepoint-internal.hpp>
#include <lttng/event-rule/kernel-uprobe.h>
-#include <lttng/event-rule/kernel-uprobe-internal.h>
-#include <common/common.h>
-#include <common/defaults.h>
-#include <common/trace-chunk.h>
-#include <common/macros.h>
+#include <lttng/event-rule/kernel-uprobe-internal.hpp>
+#include <common/common.hpp>
+#include <common/defaults.hpp>
+#include <common/trace-chunk.hpp>
+#include <common/macros.hpp>
-#include "consumer.h"
-#include "trace-kernel.h"
-#include "lttng-sessiond.h"
-#include "notification-thread-commands.h"
+#include "consumer.hpp"
+#include "trace-kernel.hpp"
+#include "lttng-sessiond.hpp"
+#include "notification-thread-commands.hpp"
/*
* Find the channel name for the given kernel session.
struct ltt_kernel_session *lks = NULL;
/* Allocate a new ltt kernel session */
- lks = (ltt_kernel_session *) zmalloc(sizeof(struct ltt_kernel_session));
+ lks = zmalloc<ltt_kernel_session>();
if (lks == NULL) {
PERROR("create kernel session zmalloc");
goto alloc_error;
LTTNG_ASSERT(chan);
- lkc = (ltt_kernel_channel *) zmalloc(sizeof(struct ltt_kernel_channel));
+ lkc = zmalloc<ltt_kernel_channel>();
if (lkc == NULL) {
PERROR("ltt_kernel_channel zmalloc");
goto error;
}
- lkc->channel = (lttng_channel *) zmalloc(sizeof(struct lttng_channel));
+ lkc->channel = zmalloc<lttng_channel>();
if (lkc->channel == NULL) {
PERROR("lttng_channel zmalloc");
goto error;
}
- extended = (lttng_channel_extended *) zmalloc(sizeof(struct lttng_channel_extended));
+ extended = zmalloc<lttng_channel_extended>();
if (!extended) {
PERROR("lttng_channel_channel zmalloc");
goto error;
{
struct ltt_kernel_context *kctx;
- kctx = (ltt_kernel_context *) zmalloc(sizeof(*kctx));
+ kctx = zmalloc<ltt_kernel_context>();
if (!kctx) {
PERROR("zmalloc kernel context");
goto error;
struct ltt_kernel_context *kctx_copy;
LTTNG_ASSERT(kctx);
- kctx_copy = (ltt_kernel_context *) zmalloc(sizeof(*kctx_copy));
+ kctx_copy = zmalloc<ltt_kernel_context>();
if (!kctx_copy) {
PERROR("zmalloc ltt_kernel_context");
goto error;
LTTNG_ASSERT(ev);
- local_kernel_event = (ltt_kernel_event *) zmalloc(sizeof(struct ltt_kernel_event));
- attr = (lttng_kernel_abi_event *) zmalloc(sizeof(struct lttng_kernel_abi_event));
+ local_kernel_event = zmalloc<ltt_kernel_event>();
+ attr = zmalloc<lttng_kernel_abi_event>();
if (local_kernel_event == NULL || attr == NULL) {
PERROR("kernel event zmalloc");
ret = LTTNG_ERR_NOMEM;
LTTNG_ASSERT(event_rule_type != LTTNG_EVENT_RULE_TYPE_UNKNOWN);
local_kernel_token_event_rule =
- (ltt_kernel_event_notifier_rule *) zmalloc(sizeof(struct ltt_kernel_event_notifier_rule));
+ zmalloc<ltt_kernel_event_notifier_rule>();
if (local_kernel_token_event_rule == NULL) {
PERROR("Failed to allocate ltt_kernel_token_event_rule structure");
ret = LTTNG_ERR_NOMEM;
struct ltt_kernel_metadata *lkm;
struct lttng_channel *chan;
- lkm = (ltt_kernel_metadata *) zmalloc(sizeof(struct ltt_kernel_metadata));
- chan = (lttng_channel *) zmalloc(sizeof(struct lttng_channel));
+ lkm = zmalloc<ltt_kernel_metadata>();
+ chan = zmalloc<lttng_channel>();
if (lkm == NULL || chan == NULL) {
PERROR("kernel metadata zmalloc");
goto error;
LTTNG_ASSERT(name);
- lks = (ltt_kernel_stream *) zmalloc(sizeof(struct ltt_kernel_stream));
+ lks = zmalloc<ltt_kernel_stream>();
if (lks == NULL) {
PERROR("kernel stream zmalloc");
goto error;