X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fbuffer-registry.h;h=00be7b65ef66fac15862e7538e5a14d3fe9c37cc;hp=0812414e5b4f260253f10f58d5dad2cbf4035e43;hb=refs%2Fheads%2Fsow-2020-0002-rev2;hpb=11f6ce94d8fb73f017888681aaba5d7df55fc735 diff --git a/src/bin/lttng-sessiond/buffer-registry.h b/src/bin/lttng-sessiond/buffer-registry.h index 0812414e5..00be7b65e 100644 --- a/src/bin/lttng-sessiond/buffer-registry.h +++ b/src/bin/lttng-sessiond/buffer-registry.h @@ -26,6 +26,14 @@ struct buffer_reg_stream { } obj; }; +struct buffer_reg_map_counter { + struct cds_list_head lnode; + union { + /* Original object data that MUST be copied over. */ + struct lttng_ust_object_data *ust; + } obj; +}; + struct buffer_reg_channel { /* This key is the same as a tracing channel key. */ uint32_t key; @@ -49,6 +57,25 @@ struct buffer_reg_channel { } obj; }; +struct buffer_reg_map { + /* This key is the same as a tracing map key. */ + uint32_t key; + /* Per cpu counter registry object of this map registry. */ + struct cds_list_head counters; + /* Total number of stream in the list. */ + uint64_t counter_count; + /* Used to ensure mutual exclusion to the counter's list. */ + pthread_mutex_t counter_list_lock; + /* Node for hash table usage. */ + struct lttng_ht_node_u64 node; + union { + /* Original object data that MUST be copied over. */ + struct lttng_ust_object_data *ust; + } obj; + + struct ustctl_daemon_counter *daemon_counter; +}; + struct buffer_reg_session { /* Registry per domain. */ union { @@ -57,6 +84,8 @@ struct buffer_reg_session { /* Contains buffer registry channel indexed by tracing channel key. */ struct lttng_ht *channels; + /* Contains buffer registry map indexed by tracing map key. */ + struct lttng_ht *maps; }; /* @@ -130,6 +159,17 @@ void buffer_reg_channel_remove(struct buffer_reg_session *session, void buffer_reg_channel_destroy(struct buffer_reg_channel *regp, enum lttng_domain_type domain); +/* Map */ +int buffer_reg_map_create(uint64_t key, struct buffer_reg_map **regp); +void buffer_reg_map_add(struct buffer_reg_session *session, + struct buffer_reg_map *map); +struct buffer_reg_map *buffer_reg_map_find(uint64_t key, + struct buffer_reg_uid *reg); +void buffer_reg_map_remove(struct buffer_reg_session *session, + struct buffer_reg_map *regp); +void buffer_reg_map_destroy(struct buffer_reg_map *regp, + enum lttng_domain_type domain); + /* Stream */ int buffer_reg_stream_create(struct buffer_reg_stream **regp); void buffer_reg_stream_add(struct buffer_reg_stream *stream, @@ -137,6 +177,13 @@ void buffer_reg_stream_add(struct buffer_reg_stream *stream, void buffer_reg_stream_destroy(struct buffer_reg_stream *regp, enum lttng_domain_type domain); +/* Map counter */ +int buffer_reg_map_counter_create(struct buffer_reg_map_counter **regp); +void buffer_reg_map_counter_add(struct buffer_reg_map_counter *map_counter, + struct buffer_reg_map *map); +void buffer_reg_map_counter_destroy(struct buffer_reg_map_counter *regp, + enum lttng_domain_type domain); + /* Global registry. */ void buffer_reg_destroy_registries(void);