* Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca>
* Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; only version 2
- * of the License.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License only.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#define _GNU_SOURCE
return 0;
}
+int ustctl_tracepoint_field_list(int sock)
+{
+ struct ustcomm_ust_msg lum;
+ struct ustcomm_ust_reply lur;
+ int ret, tp_field_list_handle;
+
+ memset(&lum, 0, sizeof(lum));
+ lum.handle = LTTNG_UST_ROOT_HANDLE;
+ lum.cmd = LTTNG_UST_TRACEPOINT_FIELD_LIST;
+ ret = ustcomm_send_app_cmd(sock, &lum, &lur);
+ if (ret)
+ return ret;
+ tp_field_list_handle = lur.ret_val;
+ DBG("received tracepoint field list handle %u", tp_field_list_handle);
+ return tp_field_list_handle;
+}
+
+int ustctl_tracepoint_field_list_get(int sock, int tp_field_list_handle,
+ struct lttng_ust_field_iter *iter)
+{
+ struct ustcomm_ust_msg lum;
+ struct ustcomm_ust_reply lur;
+ int ret;
+ ssize_t len;
+
+ if (!iter)
+ return -EINVAL;
+
+ memset(&lum, 0, sizeof(lum));
+ lum.handle = tp_field_list_handle;
+ lum.cmd = LTTNG_UST_TRACEPOINT_FIELD_LIST_GET;
+ ret = ustcomm_send_app_cmd(sock, &lum, &lur);
+ if (ret)
+ return ret;
+ if (lur.ret_code != USTCOMM_OK) {
+ DBG("Return code: %s", ustcomm_get_readable_code(lur.ret_code));
+ return -EINVAL;
+ }
+ len = ustcomm_recv_unix_sock(sock, iter, sizeof(*iter));
+ if (len != sizeof(*iter)) {
+ return -EINVAL;
+ }
+ DBG("received tracepoint field list entry event_name %s event_loglevel %d field_name %s field_type %d",
+ iter->event_name,
+ iter->loglevel,
+ iter->field_name,
+ iter->type);
+ return 0;
+}
+
int ustctl_tracer_version(int sock, struct lttng_ust_tracer_version *v)
{
struct ustcomm_ust_msg lum;