struct lttng_channel;
struct lttng_session;
struct lttng_ust_lib_ring_buffer_ctx;
+struct lttng_ust_context_app;
+struct lttng_event_field;
/*
* Data structures used by tracepoint event declarations, and by the
atype_sequence,
atype_string,
atype_float,
+ atype_dynamic,
+ atype_struct,
NR_ABSTRACT_TYPES,
};
union _lttng_basic_type {
struct lttng_integer_type integer;
struct {
- const char *name;
+ const struct lttng_enum_desc *desc; /* Enumeration mapping */
+ struct lttng_integer_type container_type;
} enumeration;
struct {
enum lttng_string_encodings encoding;
struct lttng_basic_type length_type;
struct lttng_basic_type elem_type;
} sequence;
+ struct {
+ uint32_t nr_fields;
+ struct lttng_event_field *fields; /* Array of fields. */
+ } _struct;
char padding[LTTNG_UST_TYPE_PADDING];
} u;
};
#define LTTNG_UST_ENUM_TYPE_PADDING 24
-struct lttng_enum {
+struct lttng_enum_desc {
const char *name;
- struct lttng_type container_type;
const struct lttng_enum_entry *entries;
- unsigned int len;
+ unsigned int nr_entries;
char padding[LTTNG_UST_ENUM_TYPE_PADDING];
};
char padding[LTTNG_UST_EVENT_FIELD_PADDING];
};
-union lttng_ctx_value {
- int64_t s64;
- const char *str;
- double d;
+enum lttng_ust_dynamic_type {
+ LTTNG_UST_DYNAMIC_TYPE_NONE,
+ LTTNG_UST_DYNAMIC_TYPE_S8,
+ LTTNG_UST_DYNAMIC_TYPE_S16,
+ LTTNG_UST_DYNAMIC_TYPE_S32,
+ LTTNG_UST_DYNAMIC_TYPE_S64,
+ LTTNG_UST_DYNAMIC_TYPE_U8,
+ LTTNG_UST_DYNAMIC_TYPE_U16,
+ LTTNG_UST_DYNAMIC_TYPE_U32,
+ LTTNG_UST_DYNAMIC_TYPE_U64,
+ LTTNG_UST_DYNAMIC_TYPE_FLOAT,
+ LTTNG_UST_DYNAMIC_TYPE_DOUBLE,
+ LTTNG_UST_DYNAMIC_TYPE_STRING,
+ _NR_LTTNG_UST_DYNAMIC_TYPES,
+};
+
+struct lttng_ctx_value {
+ enum lttng_ust_dynamic_type sel;
+ union {
+ int64_t s64;
+ const char *str;
+ double d;
+ } u;
};
struct lttng_perf_counter_field;
#define LTTNG_UST_CTX_FIELD_PADDING 40
struct lttng_ctx_field {
struct lttng_event_field event_field;
- size_t (*get_size)(size_t offset);
+ size_t (*get_size)(struct lttng_ctx_field *field, size_t offset);
void (*record)(struct lttng_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan);
void (*get_value)(struct lttng_ctx_field *field,
- union lttng_ctx_value *value);
+ struct lttng_ctx_value *value);
union {
struct lttng_perf_counter_field *perf_counter;
char padding[LTTNG_UST_CTX_FIELD_PADDING];
} u;
void (*destroy)(struct lttng_ctx_field *field);
+ char *field_name; /* Has ownership, dynamically allocated. */
};
#define LTTNG_UST_CTX_PADDING 20
uint64_t (*filter)(void *filter_data, const char *filter_stack_data);
int link_failed;
struct cds_list_head node; /* list of bytecode runtime in event */
+ struct lttng_session *session;
};
/*
void *_deprecated1;
struct lttng_ctx *ctx;
enum lttng_ust_instrumentation instrumentation;
- union {
- } u;
struct cds_list_head node; /* Event list in session */
struct cds_list_head _deprecated2;
void *_deprecated3;
int registered; /* has reg'd tracepoint probe */
};
+struct lttng_enum {
+ const struct lttng_enum_desc *desc;
+ struct lttng_session *session;
+ struct cds_list_head node; /* Enum list in session */
+ struct cds_hlist_node hlist; /* Session ht of enums */
+ uint64_t id; /* Enumeration ID in sessiond */
+};
+
struct channel;
struct lttng_ust_shm_handle;
int tstate:1; /* Transient enable state */
};
+#define LTTNG_UST_STACK_CTX_PADDING 32
+struct lttng_stack_ctx {
+ struct lttng_event *event;
+ struct lttng_ctx *chan_ctx; /* RCU dereferenced. */
+ struct lttng_ctx *event_ctx; /* RCU dereferenced. */
+ char padding[LTTNG_UST_STACK_CTX_PADDING];
+};
+
#define LTTNG_UST_EVENT_HT_BITS 12
#define LTTNG_UST_EVENT_HT_SIZE (1U << LTTNG_UST_EVENT_HT_BITS)
struct cds_hlist_head table[LTTNG_UST_EVENT_HT_SIZE];
};
+#define LTTNG_UST_ENUM_HT_BITS 12
+#define LTTNG_UST_ENUM_HT_SIZE (1U << LTTNG_UST_ENUM_HT_BITS)
+
+struct lttng_ust_enum_ht {
+ struct cds_hlist_head table[LTTNG_UST_ENUM_HT_SIZE];
+};
+
/*
* IMPORTANT: this structure is part of the ABI between the probe and
* UST. Fields need to be only added at the end, never reordered, never
/* New UST 2.4 */
int statedump_pending:1;
+
+ /* New UST 2.8 */
+ struct lttng_ust_enum_ht enums_ht; /* ht of enumerations */
+ struct cds_list_head enums_head;
+ struct lttng_ctx *ctx; /* contexts for filters. */
};
struct lttng_transport {
int lttng_attach_context(struct lttng_ust_context *context_param,
struct lttng_ctx **ctx, struct lttng_session *session);
-void lttng_context_init(void);
-void lttng_context_exit(void);
-extern struct lttng_ctx *lttng_static_ctx; /* Used by filtering */
+int lttng_session_context_init(struct lttng_ctx **ctx);
void lttng_transport_register(struct lttng_transport *transport);
void lttng_transport_unregister(struct lttng_transport *transport);
int lttng_add_pthread_id_to_ctx(struct lttng_ctx **ctx);
int lttng_add_procname_to_ctx(struct lttng_ctx **ctx);
int lttng_add_ip_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_cpu_id_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_dyntest_to_ctx(struct lttng_ctx **ctx);
void lttng_context_vtid_reset(void);
void lttng_context_vpid_reset(void);
typedef int (*t_statedump_func_ptr)(struct lttng_session *session);
void lttng_handle_pending_statedump(void *owner);
struct cds_list_head *_lttng_get_sessions(void);
+struct lttng_enum *lttng_ust_enum_get(struct lttng_session *session,
+ const char *enum_name);
#ifdef __cplusplus
}