+ case LTTNG_LIST_TRACEPOINT_FIELDS:
+ {
+ struct lttng_event_field *fields;
+ ssize_t nb_fields;
+
+ nb_fields = cmd_list_tracepoint_fields(cmd_ctx->lsm->domain.type, &fields);
+ if (nb_fields < 0) {
+ ret = -nb_fields;
+ goto error;
+ }
+
+ /*
+ * Setup lttng message with payload size set to the event list size in
+ * bytes and then copy list into the llm payload.
+ */
+ ret = setup_lttng_msg(cmd_ctx, sizeof(struct lttng_event_field) * nb_fields);
+ if (ret < 0) {
+ free(fields);
+ goto setup_error;
+ }
+
+ /* Copy event list into message payload */
+ memcpy(cmd_ctx->llm->payload, fields,
+ sizeof(struct lttng_event_field) * nb_fields);
+
+ free(fields);
+
+ ret = LTTCOMM_OK;
+ break;
+ }
+