enum lttng_ust_output output; /* splice, mmap */
};
+struct lttng_ust_tracepoint_iter {
+ char name[LTTNG_UST_SYM_NAME_LEN]; /* provider:name */
+ char loglevel[LTTNG_UST_SYM_NAME_LEN]; /* loglevel */
+ int64_t loglevel_value;
+};
+
struct lttng_ust_object_data {
int handle;
int shm_fd;
#include <lttng/ust-abi.h>
-struct ustctl_tracepoint_iter {
- char name[LTTNG_UST_SYM_NAME_LEN]; /* provider:name */
- char loglevel[LTTNG_UST_SYM_NAME_LEN]; /* provider:loglevel */
- int64_t loglevel_value;
-};
-
int ustctl_register_done(int sock);
int ustctl_create_session(int sock);
int ustctl_open_metadata(int sock, int session_handle,
* handle. End is iteration is reached when -ENOENT is returned.
*/
int ustctl_tracepoint_list_get(int sock, int tp_list_handle,
- struct ustctl_tracepoint_iter *iter);
+ struct lttng_ust_tracepoint_iter *iter);
int ustctl_tracer_version(int sock, struct lttng_ust_tracer_version *v);
int ustctl_wait_quiescent(int sock);
struct lttng_ust_event event;
struct lttng_ust_context context;
struct lttng_ust_tracer_version version;
- char tracepoint_list_entry[LTTNG_UST_SYM_NAME_LEN];
+ struct lttng_ust_tracepoint_iter tracepoint;
} u;
};
uint64_t memory_map_size;
} stream;
struct lttng_ust_tracer_version version;
- char tracepoint_list_entry[LTTNG_UST_SYM_NAME_LEN];
+ struct lttng_ust_tracepoint_iter tracepoint;
} u;
};
}
int ustctl_tracepoint_list_get(int sock, int tp_list_handle,
- struct ustctl_tracepoint_iter *iter)
+ struct lttng_ust_tracepoint_iter *iter)
{
struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
ret = ustcomm_send_app_cmd(sock, &lum, &lur);
if (ret)
return ret;
- DBG("received tracepoint list entry %s", lur.u.tracepoint_list_entry);
- memcpy(iter->name, lur.u.tracepoint_list_entry, LTTNG_UST_SYM_NAME_LEN);
+ DBG("received tracepoint list entry name %s loglevel %s loglevel_value %lld",
+ lur.u.tracepoint.name,
+ lur.u.tracepoint.loglevel,
+ (unsigned long long) lur.u.tracepoint.loglevel_value);
+ memcpy(iter, &lur.u.tracepoint, sizeof(*iter));
return 0;
}
*/
static
void ltt_tracepoint_list_get(struct ltt_tracepoint_list *list,
- char *tp_list_entry)
+ struct lttng_ust_tracepoint_iter *tracepoint)
{
next:
if (!list->got_first) {
tracepoint_iter_next(&list->iter);
copy:
if (!list->iter.tracepoint) {
- tp_list_entry[0] = '\0'; /* end of list */
+ tracepoint->name[0] = '\0'; /* end of list */
} else {
if (!strcmp((*list->iter.tracepoint)->name,
"lttng_ust:metadata"))
goto next;
- memcpy(tp_list_entry, (*list->iter.tracepoint)->name,
+ memcpy(tracepoint->name, (*list->iter.tracepoint)->name,
LTTNG_UST_SYM_NAME_LEN);
+#if 0
+ if ((*list->iter.tracepoint)->loglevel) {
+ memcpy(tracepoint->loglevel,
+ (*list->iter.tracepoint)->loglevel->identifier,
+ LTTNG_UST_SYM_NAME_LEN);
+ tracepoint->loglevel_value =
+ (*list->iter.tracepoint)->loglevel->value;
+ } else {
+#endif
+ tracepoint->loglevel[0] = '\0';
+ tracepoint->loglevel_value = 0;
+#if 0
+ }
+#endif
}
}
long lttng_tracepoint_list_cmd(int objd, unsigned int cmd, unsigned long arg)
{
struct ltt_tracepoint_list *list = objd_private(objd);
- char *str = (char *) arg;
+ struct lttng_ust_tracepoint_iter *tp =
+ (struct lttng_ust_tracepoint_iter *) arg;
switch (cmd) {
case LTTNG_UST_TRACEPOINT_LIST_GET:
- ltt_tracepoint_list_get(list, str);
- if (str[0] == '\0')
+ ltt_tracepoint_list_get(list, tp);
+ if (tp->name[0] == '\0')
return -ENOENT;
return 0;
default:
lur.u.version = lum->u.version;
break;
case LTTNG_UST_TRACEPOINT_LIST_GET:
- memcpy(lur.u.tracepoint_list_entry,
- lum->u.tracepoint_list_entry,
- LTTNG_UST_SYM_NAME_LEN);
+ memcpy(&lur.u.tracepoint, &lum->u.tracepoint, sizeof(lur.u.tracepoint));
break;
}
ret = send_reply(sock, &lur);