lttng-ctl: Implement the notify action interface
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 27 Feb 2017 18:49:12 +0000 (13:49 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 1 Mar 2017 03:10:48 +0000 (22:10 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/Makefile.am
include/lttng/action/notify-internal.h [new file with mode: 0644]
src/lib/lttng-ctl/Makefile.am
src/lib/lttng-ctl/notify.c [new file with mode: 0644]

index 90ee41882dba38e6bf98b18d6b26a8e55387c9e5..82fd8d4667099937993fe53fdc73c372d036243f 100644 (file)
@@ -84,4 +84,5 @@ noinst_HEADERS = \
        lttng/health-internal.h \
        lttng/save-internal.h \
        lttng/load-internal.h \
-       lttng/action/action-internal.h
+       lttng/action/action-internal.h \
+       lttng/action/notify-internal.h
diff --git a/include/lttng/action/notify-internal.h b/include/lttng/action/notify-internal.h
new file mode 100644 (file)
index 0000000..509bd36
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License, version 2.1 only,
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef LTTNG_ACTION_NOTIFY_INTERNAL_H
+#define LTTNG_ACTION_NOTIFY_INTERNAL_H
+
+#include <lttng/action/notify.h>
+#include <lttng/action/action-internal.h>
+
+struct lttng_action_notify {
+       struct lttng_action parent;
+};
+
+#endif /* LTTNG_ACTION_NOTIFY_INTERNAL_H */
index 1b5895a3debb8a87f8df075068b0d8ffb5f2cee8..91f37f418a08985af3535a205060f3ce13f4c804 100644 (file)
@@ -6,7 +6,7 @@ lib_LTLIBRARIES = liblttng-ctl.la
 
 liblttng_ctl_la_SOURCES = lttng-ctl.c snapshot.c lttng-ctl-helper.h \
                lttng-ctl-health.c save.c load.c deprecated-symbols.c \
-               action.c
+               action.c notify.c
 
 liblttng_ctl_la_LDFLAGS = \
                $(LT_NO_UNDEFINED)
diff --git a/src/lib/lttng-ctl/notify.c b/src/lib/lttng-ctl/notify.c
new file mode 100644 (file)
index 0000000..5011cdb
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License, version 2.1 only,
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <lttng/action/action-internal.h>
+#include <lttng/action/notify-internal.h>
+#include <common/macros.h>
+#include <assert.h>
+
+static
+void lttng_action_notify_destroy(struct lttng_action *action)
+{
+       free(action);
+}
+
+struct lttng_action *lttng_action_notify_create(void)
+{
+       struct lttng_action_notify *notify;
+
+       notify = zmalloc(sizeof(struct lttng_action_notify));
+       if (!notify) {
+               goto end;
+       }
+
+       notify->parent.type = LTTNG_ACTION_TYPE_NOTIFY;
+       notify->parent.destroy = lttng_action_notify_destroy;
+end:
+       return &notify->parent;
+}
This page took 0.0284 seconds and 5 git commands to generate.