6b22fecf52799f1bd7a26fc97f84d5ab0db18fef
2 * Copyright (C) 2018 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #include <lttng/event-internal.h>
9 #include <common/error.h>
11 struct lttng_event
*lttng_event_copy(const struct lttng_event
*event
)
13 struct lttng_event
*new_event
;
14 struct lttng_event_extended
*new_event_extended
;
16 new_event
= (lttng_event
*) zmalloc(sizeof(*event
));
18 PERROR("Error allocating event structure");
22 /* Copy the content of the old event. */
23 memcpy(new_event
, event
, sizeof(*event
));
26 * We need to create a new extended since the previous pointer is now
29 new_event_extended
= (lttng_event_extended
*) zmalloc(sizeof(*new_event_extended
));
30 if (!new_event_extended
) {
31 PERROR("Error allocating event extended structure");
35 new_event
->extended
.ptr
= new_event_extended
;
This page took 0.049859 seconds and 3 git commands to generate.