X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmap.h;fp=src%2Fbin%2Flttng-sessiond%2Fmap.h;h=1c84fe6678c0cb69ab8ca3689f2cc675c1af85c3;hb=c3e68e71e0bca1c067bf24447163ac6850a9b09e;hp=0000000000000000000000000000000000000000;hpb=11f6ce94d8fb73f017888681aaba5d7df55fc735;p=deliverable%2Flttng-tools.git diff --git a/src/bin/lttng-sessiond/map.h b/src/bin/lttng-sessiond/map.h new file mode 100644 index 000000000..1c84fe667 --- /dev/null +++ b/src/bin/lttng-sessiond/map.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2020 Francis Deslauriers + * + * SPDX-License-Identifier: GPL-2.0-only + * + */ +#ifndef _LTT_MAP_H +#define _LTT_MAP_H + +#include +#include +#include "trace-kernel.h" +#include "trace-ust.h" + +struct map_kv_ht_entry { + struct lttng_ht_node_str node; + char *key; + int64_t value; + bool has_overflowed; + bool has_underflowed; +}; + +enum lttng_error_code map_kernel_add(struct ltt_kernel_session *ksession, + struct lttng_map *map); +enum lttng_error_code map_kernel_enable(struct ltt_kernel_session *ksession, + struct ltt_kernel_map *kmap); +enum lttng_error_code map_kernel_disable(struct ltt_kernel_session *ksession, + struct ltt_kernel_map *kmap); + +int map_ust_add(struct ltt_ust_session *usession, + struct lttng_map *map); +int map_ust_enable(struct ltt_ust_session *usess, + struct ltt_ust_map *umap); +int map_ust_disable(struct ltt_ust_session *usess, + struct ltt_ust_map *umap); + +void map_add_or_increment_map_values(struct lttng_ht *map_values, const char *key, + int64_t value, bool has_underflowed, bool has_overflowed); + +int map_new_content_section(struct lttng_map_content *map_content, + enum lttng_map_key_value_pair_list_type list_type, + bool summed_all_cpus, unsigned int identifier, + int cpu, struct lttng_ht *values); + +#endif /* _LTT_MAP_H */