Add name omission and output omission on save to lttng-ctl
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 14 Jun 2016 16:36:07 +0000 (12:36 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 14 Jun 2016 16:36:07 +0000 (12:36 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/lttng/save-internal.h
include/lttng/save.h
src/lib/lttng-ctl/save.c

index aac213e03fefc94da9e69c5bae53de72411557e8..c5feb4af47113e2ea113b5a1f180a1b0b178fe52 100644 (file)
@@ -34,6 +34,10 @@ struct lttng_save_session_attr {
        char configuration_url[PATH_MAX];
        /* Overwrite the session configuration file if it exists. */
        uint8_t overwrite;
+       /* Omit the sessions' name(s). */
+       uint8_t omit_name;
+       /* Omit the sessions' output(s). */
+       uint8_t omit_output;
 } LTTNG_PACKED;
 
 #endif /* LTTNG_SAVE_INTERNAL_ABI_H */
index 1fbeb86f616c4256c733f71a9de2db2d613a0ec2..5ef22f6c92a3fa448d376187b38606cc841b05ca 100644 (file)
@@ -59,6 +59,18 @@ const char *lttng_save_session_attr_get_output_url(
  */
 int lttng_save_session_attr_get_overwrite(
        struct lttng_save_session_attr *attr);
+/*
+ * Return the omit name configuration attribute. This attribute indicates
+ * whether or not the saved sessions' names should be omitted.
+ */
+int lttng_save_session_attr_get_omit_name(
+       struct lttng_save_session_attr *attr);
+/*
+ * Return the omit output configuration attribute. This attribute indicates
+ * whether or not the saved sessions' output configuration should be omitted.
+ */
+int lttng_save_session_attr_get_omit_output(
+       struct lttng_save_session_attr *attr);
 
 /*
  * Save session attribute setter family functions.
@@ -86,6 +98,18 @@ int lttng_save_session_attr_set_output_url(
  */
 int lttng_save_session_attr_set_overwrite(
        struct lttng_save_session_attr *attr, int overwrite);
+/*
+ * Set the omit name attribute. If set to true, the sessions' names are omitted
+ * from the resulting session configuration file.
+ */
+int lttng_save_session_attr_set_omit_name(
+       struct lttng_save_session_attr *attr, int omit_name);
+/*
+ * Set the omit output attribute. If set to true, the sessions' output
+ * configurations are omitted from the resulting session configuration file.
+ */
+int lttng_save_session_attr_set_omit_output(
+       struct lttng_save_session_attr *attr, int omit_output);
 
 /*
  * Save session configuration(s).
index f8b9043b634fcf053644721d4770b57250a2377c..555006d0aff1350938c450aea93f481583a6b018 100644 (file)
@@ -68,6 +68,18 @@ int lttng_save_session_attr_get_overwrite(
        return attr ? attr->overwrite : -LTTNG_ERR_INVALID;
 }
 
+int lttng_save_session_attr_get_omit_name(
+       struct lttng_save_session_attr *attr)
+{
+       return attr ? attr->omit_name : -LTTNG_ERR_INVALID;
+}
+
+int lttng_save_session_attr_get_omit_output(
+       struct lttng_save_session_attr *attr)
+{
+       return attr ? attr->omit_output : -LTTNG_ERR_INVALID;
+}
+
 int lttng_save_session_attr_set_session_name(
        struct lttng_save_session_attr *attr, const char *session_name)
 {
@@ -151,6 +163,36 @@ end:
        return ret;
 }
 
+int lttng_save_session_attr_set_omit_name(
+       struct lttng_save_session_attr *attr, int omit_name)
+{
+       int ret = 0;
+
+       if (!attr) {
+               ret = -LTTNG_ERR_INVALID;
+               goto end;
+       }
+
+       attr->omit_name = !!omit_name;
+end:
+       return ret;
+}
+
+int lttng_save_session_attr_set_omit_output(
+       struct lttng_save_session_attr *attr, int omit_output)
+{
+       int ret = 0;
+
+       if (!attr) {
+               ret = -LTTNG_ERR_INVALID;
+               goto end;
+       }
+
+       attr->omit_output = !!omit_output;
+end:
+       return ret;
+}
+
 /*
  * The lttng-ctl API does not expose all the information needed to save the
  * session configurations. Thus, we must send a save command to the session
This page took 0.027802 seconds and 5 git commands to generate.