Implement event fields listing
[lttng-tools.git] / src / lib / lttng-ctl / lttng-ctl.c
index 36069ef2816b7906bb9f19a8c0714912a8061f31..96a54f881c8e5df2b9225bed57997be0c4339cda 100644 (file)
@@ -680,6 +680,33 @@ int lttng_list_tracepoints(struct lttng_handle *handle,
        return ret / sizeof(struct lttng_event);
 }
 
+/*
+ *  Lists all available tracepoint fields of domain.
+ *  Sets the contents of the event field array.
+ *  Returns the number of lttng_event_field entries in events;
+ *  on error, returns a negative value.
+ */
+int lttng_list_tracepoint_fields(struct lttng_handle *handle,
+               struct lttng_event_field **fields)
+{
+       int ret;
+       struct lttcomm_session_msg lsm;
+
+       if (handle == NULL) {
+               return -1;
+       }
+
+       lsm.cmd_type = LTTNG_LIST_TRACEPOINT_FIELDS;
+       copy_lttng_domain(&lsm.domain, &handle->domain);
+
+       ret = ask_sessiond(&lsm, (void **) fields);
+       if (ret < 0) {
+               return ret;
+       }
+
+       return ret / sizeof(struct lttng_event_field);
+}
+
 /*
  *  Returns a human readable string describing
  *  the error code (a negative value).
This page took 0.023453 seconds and 4 git commands to generate.