X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=include%2Flttng%2Fust-events.h;h=b34c9d1ba696d19615a366e1e98ebb5273d51124;hb=c082d14bd6b59a5c08a5732693cd31229151fbdd;hp=3d473407613b85f312cfc3b33dae15f59d4a5b9d;hpb=a44c74d96a15230cec7c09c770bf7fc745f0df15;p=lttng-ust.git diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 3d473407..b34c9d1b 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -30,10 +30,14 @@ #include #include #include +#include #include #include #include #include +#include +#include +#include #ifdef __cplusplus extern "C" { @@ -236,6 +240,8 @@ union lttng_ctx_value { double d; }; +struct lttng_perf_counter_field; + #define LTTNG_UST_CTX_FIELD_PADDING 40 struct lttng_ctx_field { struct lttng_event_field event_field; @@ -246,16 +252,18 @@ struct lttng_ctx_field { void (*get_value)(struct lttng_ctx_field *field, union 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); }; -#define LTTNG_UST_CTX_PADDING 24 +#define LTTNG_UST_CTX_PADDING 20 struct lttng_ctx { struct lttng_ctx_field *fields; unsigned int nr_fields; unsigned int allocated_fields; + unsigned int largest_align; char padding[LTTNG_UST_CTX_PADDING]; }; @@ -399,8 +407,6 @@ struct lttng_event { 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; @@ -431,7 +437,8 @@ struct lttng_channel_ops { unsigned int switch_timer_interval, unsigned int read_timer_interval, unsigned char *uuid, - uint32_t chan_id); + uint32_t chan_id, + const int *stream_fds, int nr_stream_fds); void (*channel_destroy)(struct lttng_channel *chan); union { void *_deprecated1; @@ -583,6 +590,7 @@ void lttng_probes_exit(void); int lttng_find_context(struct lttng_ctx *ctx, const char *name); int lttng_get_context_index(struct lttng_ctx *ctx, const char *name); struct lttng_ctx_field *lttng_append_context(struct lttng_ctx **ctx_p); +void lttng_context_update(struct lttng_ctx *ctx); void lttng_remove_context_field(struct lttng_ctx **ctx_p, struct lttng_ctx_field *field); void lttng_destroy_context(struct lttng_ctx *ctx); @@ -591,9 +599,37 @@ int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx); 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); void lttng_context_vtid_reset(void); void lttng_context_vpid_reset(void); +#ifdef LTTNG_UST_HAVE_PERF_EVENT +int lttng_add_perf_counter_to_ctx(uint32_t type, + uint64_t config, + const char *name, + struct lttng_ctx **ctx); +int lttng_perf_counter_init(void); +void lttng_perf_counter_exit(void); +#else /* #ifdef LTTNG_UST_HAVE_PERF_EVENT */ +static inline +int lttng_add_perf_counter_to_ctx(uint32_t type, + uint64_t config, + const char *name, + struct lttng_ctx **ctx) +{ + return -ENOSYS; +} +static inline +int lttng_perf_counter_init(void) +{ + return 0; +} +static inline +void lttng_perf_counter_exit(void) +{ +} +#endif /* #else #ifdef LTTNG_UST_HAVE_PERF_EVENT */ + extern const struct lttng_ust_client_lib_ring_buffer_client_cb *lttng_client_callbacks_metadata; extern const struct lttng_ust_client_lib_ring_buffer_client_cb *lttng_client_callbacks_discard; extern const struct lttng_ust_client_lib_ring_buffer_client_cb *lttng_client_callbacks_overwrite;