* API used by sessiond.
*/
+struct lttng_ust_context_attr {
+ enum lttng_ust_context_type ctx;
+ union {
+ struct lttng_ust_perf_counter_ctx perf_counter;
+ struct {
+ char *provider_name;
+ char *ctx_name;
+ } app_ctx;
+ } u;
+};
+
/*
* Error values: all the following functions return:
* >= 0: Success (LTTNG_UST_OK)
int ustctl_create_event(int sock, struct lttng_ust_event *ev,
struct lttng_ust_object_data *channel_data,
struct lttng_ust_object_data **event_data);
-int ustctl_add_context(int sock, struct lttng_ust_context *ctx,
+int ustctl_add_context(int sock, struct lttng_ust_context_attr *ctx,
struct lttng_ust_object_data *obj_data,
struct lttng_ust_object_data **context_data);
int ustctl_set_filter(int sock, struct lttng_ust_filter_bytecode *bytecode,
enum ustctl_notify_cmd {
USTCTL_NOTIFY_CMD_EVENT = 0,
USTCTL_NOTIFY_CMD_CHANNEL = 1,
+ USTCTL_NOTIFY_CMD_ENUM = 2,
};
enum ustctl_channel_header {
char padding[USTCTL_UST_FLOAT_TYPE_PADDING];
} LTTNG_PACKED;
+#define USTCTL_UST_ENUM_VALUE_PADDING 15
+struct ustctl_enum_value {
+ uint64_t value;
+ uint8_t signedness;
+ char padding[USTCTL_UST_ENUM_VALUE_PADDING];
+} LTTNG_PACKED;
+
+#define USTCTL_UST_ENUM_ENTRY_PADDING 32
+struct ustctl_enum_entry {
+ struct ustctl_enum_value start, end; /* start and end are inclusive */
+ char string[LTTNG_UST_SYM_NAME_LEN];
+ char padding[USTCTL_UST_ENUM_ENTRY_PADDING];
+} LTTNG_PACKED;
+
#define USTCTL_UST_BASIC_TYPE_PADDING 296
union _ustctl_basic_type {
struct ustctl_integer_type integer;
enum ustctl_string_encodings encoding;
} string;
struct ustctl_float_type _float;
+ struct {
+ char name[LTTNG_UST_SYM_NAME_LEN];
+ } enumeration;
char padding[USTCTL_UST_BASIC_TYPE_PADDING];
} LTTNG_PACKED;
uint32_t id, /* event id (input) */
int ret_code); /* return code. 0 ok, negative error */
+/*
+ * Returns 0 on success, negative UST or system error value on error.
+ */
+int ustctl_recv_register_enum(int sock,
+ int *session_objd,
+ char *enum_name,
+ struct ustctl_enum_entry **entries,
+ unsigned int *nr_entries);
+
+/*
+ * Returns 0 on success, negative error value on error.
+ */
+int ustctl_reply_register_enum(int sock,
+ int64_t id, /* enum id (input) */
+ int ret_code);
+
/*
* Returns 0 on success, negative UST or system error value on error.
*/