+ case LTTNG_LIST_TRACES:
+ {
+ unsigned int trace_count = get_trace_count_per_session(current_session);
+
+ if (trace_count == 0) {
+ ret = LTTCOMM_NO_TRACE;
+ goto end;
+ }
+
+ buf_size = setup_data_buffer(&send_buf,
+ sizeof(struct lttng_trace) * trace_count, &llm);
+ if (buf_size < 0) {
+ ret = LTTCOMM_FATAL;
+ goto end;
+ }
+
+ get_traces_per_session(current_session, (struct lttng_trace *)(send_buf + header_size));
+ break;
+ }