X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Flttng-ctl.c;h=96a54f881c8e5df2b9225bed57997be0c4339cda;hp=36069ef2816b7906bb9f19a8c0714912a8061f31;hb=f37d259d342af1ff8855d9eaa578cb7a3cfcc4f2;hpb=f214d69a26ea3e5a024cd57b560f70dcece81897 diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 36069ef28..96a54f881 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -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).