X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fbuffer-registry.h;h=00be7b65ef66fac15862e7538e5a14d3fe9c37cc;hb=refs%2Fheads%2Fsow-2020-0002-rev2;hp=415793c9511e4387c4c4529a074ecfe68b35db8d;hpb=75018ab6aaa9b49e6248b002d9795319a0e5bb9a;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/buffer-registry.h b/src/bin/lttng-sessiond/buffer-registry.h index 415793c95..00be7b65e 100644 --- a/src/bin/lttng-sessiond/buffer-registry.h +++ b/src/bin/lttng-sessiond/buffer-registry.h @@ -1,18 +1,8 @@ /* - * Copyright (C) 2013 - David Goulet + * Copyright (C) 2013 David Goulet * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License, version 2 only, as - * published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef LTTNG_BUFFER_REGISTRY_H @@ -36,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; @@ -59,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 { @@ -67,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; }; /* @@ -140,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, @@ -147,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);