SoW-2019-0002: Dynamic Snapshot
[lttng-tools.git] / src / common / actions / notify.c.orig
CommitLineData
a58c490f 1/*
ab5be9fa 2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
a58c490f 3 *
ab5be9fa 4 * SPDX-License-Identifier: LGPL-2.1-only
a58c490f 5 *
a58c490f
JG
6 */
7
8#include <lttng/action/action-internal.h>
9#include <lttng/action/notify-internal.h>
10#include <common/macros.h>
11#include <assert.h>
12
13static
14void lttng_action_notify_destroy(struct lttng_action *action)
15{
16 free(action);
17}
18
19static
3647288f
JG
20int lttng_action_notify_serialize(struct lttng_action *action,
21 struct lttng_dynamic_buffer *buf)
a58c490f
JG
22{
23 return 0;
24}
25
26struct lttng_action *lttng_action_notify_create(void)
27{
28 struct lttng_action_notify *notify;
29
30 notify = zmalloc(sizeof(struct lttng_action_notify));
31 if (!notify) {
32 goto end;
33 }
34
d3a684ee 35<<<<<<< HEAD
a58c490f
JG
36 notify->parent.type = LTTNG_ACTION_TYPE_NOTIFY;
37 notify->parent.serialize = lttng_action_notify_serialize;
38 notify->parent.destroy = lttng_action_notify_destroy;
d3a684ee
JR
39=======
40 lttng_action_init(&notify->parent, LTTNG_ACTION_TYPE_NOTIFY, NULL,
41 lttng_action_notify_serialize,
42 lttng_action_notify_is_equal,
43 lttng_action_notify_destroy);
44>>>>>>> d8c05bf99... For joraj: missing lttng_action_init for notify action
a58c490f
JG
45end:
46 return &notify->parent;
47}
d3a684ee
JR
48
49ssize_t lttng_action_notify_create_from_buffer(
50 const struct lttng_buffer_view *view,
51 struct lttng_action **action)
52{
53 ssize_t consumed_length;
54
55 *action = lttng_action_notify_create();
56 if (!*action) {
57 consumed_length = -1;
58 goto end;
59 }
60
61 consumed_length = 0;
62end:
63 return consumed_length;
64}
This page took 0.042799 seconds and 5 git commands to generate.