+ struct ustcomm_ust_msg lum;
+ struct ustcomm_ust_reply lur;
+ int ret, tp_list_handle;
+
+ memset(&lum, 0, sizeof(lum));
+ lum.handle = LTTNG_UST_ROOT_HANDLE;
+ lum.cmd = LTTNG_UST_TRACEPOINT_LIST;
+ ret = ustcomm_send_app_cmd(sock, &lum, &lur);
+ if (ret)
+ return ret;
+ tp_list_handle = lur.ret_val;
+ DBG("received tracepoint list handle %u", tp_list_handle);
+ return tp_list_handle;
+}
+
+int ustctl_tracepoint_list_get(int sock, int tp_list_handle,
+ struct lttng_ust_tracepoint_iter *iter)
+{
+ struct ustcomm_ust_msg lum;
+ struct ustcomm_ust_reply lur;
+ int ret;
+
+ if (!iter)
+ return -EINVAL;
+
+ memset(&lum, 0, sizeof(lum));
+ lum.handle = tp_list_handle;
+ lum.cmd = LTTNG_UST_TRACEPOINT_LIST_GET;
+ ret = ustcomm_send_app_cmd(sock, &lum, &lur);
+ if (ret)
+ return ret;
+ DBG("received tracepoint list entry name %s loglevel %d",
+ lur.u.tracepoint.name,
+ lur.u.tracepoint.loglevel);
+ memcpy(iter, &lur.u.tracepoint, sizeof(*iter));
+ return 0;