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>
12 struct lttng_event
*lttng_event_copy(const struct lttng_event
*event
)
14 struct lttng_event
*new_event
;
15 struct lttng_event_extended
*new_event_extended
;
17 new_event
= zmalloc(sizeof(*event
));
19 PERROR("Error allocating event structure");
23 /* Copy the content of the old event. */
24 memcpy(new_event
, event
, sizeof(*event
));
27 * We need to create a new extended since the previous pointer is now
30 new_event_extended
= zmalloc(sizeof(*new_event_extended
));
31 if (!new_event_extended
) {
32 PERROR("Error allocating event extended structure");
36 new_event
->extended
.ptr
= new_event_extended
;
This page took 0.029318 seconds and 4 git commands to generate.