Commit | Line | Data |
---|---|---|
358340ec | 1 | /* |
0235b0db | 2 | * SPDX-License-Identifier: MIT |
358340ec | 3 | * |
0235b0db | 4 | * Copyright 2017 Philippe Proulx <pproulx@efficios.com> |
358340ec PP |
5 | */ |
6 | ||
ae2be88d SM |
7 | #ifndef BABELTRACE_PLUGINS_UTILS_COUNTER_COUNTER_H |
8 | #define BABELTRACE_PLUGINS_UTILS_COUNTER_COUNTER_H | |
0235b0db | 9 | |
358340ec | 10 | #include <glib.h> |
3fadfbc0 | 11 | #include <babeltrace2/babeltrace.h> |
358340ec PP |
12 | #include <stdbool.h> |
13 | #include <stdint.h> | |
91d81473 | 14 | #include "common/macros.h" |
358340ec | 15 | |
fca1d0f5 PP |
16 | #ifdef __cplusplus |
17 | extern "C" { | |
18 | #endif | |
19 | ||
358340ec | 20 | struct counter { |
9a2c8b8e | 21 | bt_message_iterator *msg_iter; |
358340ec PP |
22 | struct { |
23 | uint64_t event; | |
24 | uint64_t stream_begin; | |
25 | uint64_t stream_end; | |
26 | uint64_t packet_begin; | |
27 | uint64_t packet_end; | |
0e847b69 PP |
28 | uint64_t disc_events; |
29 | uint64_t disc_packets; | |
b9fd9cbb | 30 | uint64_t msg_iter_inactivity; |
358340ec PP |
31 | uint64_t other; |
32 | } count; | |
33 | uint64_t last_printed_total; | |
d4393e08 | 34 | uint64_t at; |
358340ec PP |
35 | uint64_t step; |
36 | bool hide_zero; | |
9d87d0ea | 37 | bt_logging_level log_level; |
82e80647 | 38 | bt_self_component *self_comp; |
358340ec PP |
39 | }; |
40 | ||
497c1e20 SM |
41 | bt_component_class_get_supported_mip_versions_method_status |
42 | counter_supported_mip_versions(bt_self_component_class_sink *self_component_class, | |
43 | const bt_value *params, void *initialize_method_data, | |
44 | bt_logging_level logging_level, | |
45 | bt_integer_range_set_unsigned *supported_versions); | |
46 | ||
21a9f056 | 47 | bt_component_class_initialize_method_status counter_init( |
b19ff26f | 48 | bt_self_component_sink *component, |
59225a3e | 49 | bt_self_component_sink_configuration *config, |
b19ff26f | 50 | const bt_value *params, void *init_method_data); |
d94d92ac | 51 | |
b19ff26f | 52 | void counter_finalize(bt_self_component_sink *component); |
d94d92ac | 53 | |
d24d5663 | 54 | bt_component_class_sink_graph_is_configured_method_status counter_graph_is_configured( |
5badd463 | 55 | bt_self_component_sink *component); |
d94d92ac | 56 | |
d24d5663 | 57 | bt_component_class_sink_consume_method_status counter_consume(bt_self_component_sink *component); |
358340ec | 58 | |
fca1d0f5 PP |
59 | #ifdef __cplusplus |
60 | } | |
61 | #endif | |
62 | ||
ae2be88d | 63 | #endif /* BABELTRACE_PLUGINS_UTILS_COUNTER_COUNTER_H */ |