#include <urcu/compiler.h>
#include <urcu/list.h>
#include <lttng/ust-events.h>
-#include <lttng/usterr-signal-safe.h>
-#include "lttng/core.h"
+#include <lttng/ust-version.h>
+#include <usterr-signal-safe.h>
+#include <helper.h>
#include "ltt-tracer.h"
#include "tracepoint-internal.h"
long lttng_abi_tracer_version(int objd,
struct lttng_ust_tracer_version *v)
{
- v->major = LTTNG_UST_MAJOR;
- v->minor = LTTNG_UST_MINOR;
- v->patchlevel = LTTNG_UST_PATCHLEVEL;
+ v->major = LTTNG_UST_MAJOR_VERSION;
+ v->minor = LTTNG_UST_MINOR_VERSION;
+ v->patchlevel = LTTNG_UST_PATCHLEVEL_VERSION;
return 0;
}
.name = "lttng_ust:metadata",
};
struct ltt_event *event;
+ int ret;
/*
* We tolerate no failure path after event creation. It will stay
* invariant for the rest of the session.
*/
- event = ltt_event_create(channel, &metadata_params, NULL);
- if (!event) {
+ ret = ltt_event_create(channel, &metadata_params, NULL, &event);
+ if (ret < 0) {
goto create_error;
}
return;
*/
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:
* We tolerate no failure path after event creation. It will stay
* invariant for the rest of the session.
*/
- event = ltt_event_create(channel, event_param, NULL);
- if (!event) {
- ret = -EINVAL;
+ ret = ltt_event_create(channel, event_param, NULL, &event);
+ if (ret < 0) {
goto event_error;
}
objd_set_private(event_objd, event);