| 1 | /* |
| 2 | * SPDX-FileCopyrightText: 2025 Jérémie Galarneau <[email protected]> |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0-only |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef LTTNG_SESSIOND_CMD_RECLAIM_CHANNEL_MEMORY_HPP |
| 9 | #define LTTNG_SESSIOND_CMD_RECLAIM_CHANNEL_MEMORY_HPPcxx . . $ `src/bin/lttng-sessiond/commands/reclaim-channel-memory.hpp:9:9`! |
| 10 | |
| 11 | #include <common/string-utils/c-string-view.hpp>cxx . . $ `<file>/src/common/string-utils/c-string-view.hpp`/ |
| 12 | |
| 13 | #include <vendor/optional.hpp>cxx . . $ `<file>/src/vendor/optional.hpp`/ |
| 14 | |
| 15 | #include <bin/lttng-sessiond/commands/get-channel-memory-usage.hpp>cxx . . $ `<file>/src/bin/lttng-sessiond/commands/get-channel-memory-usage.hpp`/ |
| 16 | #include <bin/lttng-sessiond/domain.hpp>cxx . . $ `<file>/src/bin/lttng-sessiond/domain.hpp`/ |
| 17 | #include <bin/lttng-sessiond/pending-memory-reclamation-request.hpp>cxx . . $ `<file>/src/bin/lttng-sessiond/pending-memory-reclamation-request.hpp`/ |
| 18 | #include <bin/lttng-sessiond/session.hpp>cxx . . $ `<file>/src/bin/lttng-sessiond/session.hpp`/ |
| 19 | #include <chrono> |
| 20 | #include <vector> |
| 21 | |
| 22 | namespace lttngcxx . . $ lttng/ { |
| 23 | namespace sessiondcxx . . $ lttng/sessiond/ { |
| 24 | namespace commandscxx . . $ lttng/sessiond/commands/ { |
| 25 | |
| 26 | struct stream_memory_reclamation_resultcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result# { |
| 27 | stream_memory_reclamation_resultcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result#stream_memory_reclamation_result(af6b45e9cafb74b1).(stream_identifiercxx . . $ lttng/sessiond/commands/stream_identifier# _id, |
| 28 | stdcxx . . $ std/::uint64_tcxx . . $ std/uint64_t# subbuffers_reclaimed_, |
| 29 | stdcxx . . $ std/::uint64_tcxx . . $ std/uint64_t# pending_subbuffers_to_reclaim_) : |
| 30 | idcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result#id.(stdcxx . . $ std/::movecxx . . $ std/move(e7c6c0c8363dcc46).(_id)), |
| 31 | subbuffers_reclaimedcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result#subbuffers_reclaimed.(subbuffers_reclaimed_), |
| 32 | pending_subbuffers_to_reclaimcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result#pending_subbuffers_to_reclaim.(pending_subbuffers_to_reclaim_) |
| 33 | { |
| 34 | } |
| 35 | |
| 36 | const stream_identifiercxx . . $ lttng/sessiond/commands/stream_identifier# idcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result#id.; |
| 37 | const stdcxx . . $ std/::uint64_tcxx . . $ std/uint64_t# subbuffers_reclaimedcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result#subbuffers_reclaimed.; |
| 38 | const stdcxx . . $ std/::uint64_tcxx . . $ std/uint64_t# pending_subbuffers_to_reclaimcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result#pending_subbuffers_to_reclaim.; |
| 39 | }; |
| 40 | |
| 41 | struct stream_memory_reclamation_result_groupcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result_group# { |
| 42 | stream_memory_reclamation_result_groupcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result_group#stream_memory_reclamation_result_group(e55ac28bc7d6f98f).( |
| 43 | stream_group_ownercxx . . $ lttng/sessiond/commands/stream_group_owner# owner_, |
| 44 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stream_memory_reclamation_resultcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result#> reclaimed_streams_memory_) : |
| 45 | ownercxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result_group#owner.(stdcxx . . $ std/::movecxx . . $ std/move(e7c6c0c8363dcc46).(owner_)), |
| 46 | reclaimed_streams_memorycxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result_group#reclaimed_streams_memory.(stdcxx . . $ std/::movecxx . . $ std/move(e7c6c0c8363dcc46).(reclaimed_streams_memory_)) |
| 47 | { |
| 48 | } |
| 49 | |
| 50 | const stream_group_ownercxx . . $ lttng/sessiond/commands/stream_group_owner# ownercxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result_group#owner.; |
| 51 | const stdcxx . . $ std/::vectorcxx . . $ std/vector#<stream_memory_reclamation_resultcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result#> reclaimed_streams_memorycxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result_group#reclaimed_streams_memory.; |
| 52 | }; |
| 53 | |
| 54 | struct reclaim_channel_memory_resultcxx . . $ lttng/sessiond/commands/reclaim_channel_memory_result# { |
| 55 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stream_memory_reclamation_result_groupcxx . . $ lttng/sessiond/commands/stream_memory_reclamation_result_group#> groupscxx . . $ lttng/sessiond/commands/reclaim_channel_memory_result#groups.; |
| 56 | /* Token for tracking async completion. */ |
| 57 | lttngcxx . . $ lttng/::sessiondcxx . . $ lttng/sessiond/::pending_memory_reclamation_registrycxx . . $ lttng/sessiond/pending_memory_reclamation_registry#::token_tcxx . . $ lttng/sessiond/pending_memory_reclamation_registry#token_t# tokencxx . . $ lttng/sessiond/commands/reclaim_channel_memory_result#token.; |
| 58 | }; |
| 59 | |
| 60 | /* Completion callback signature: bool parameter indicates success (true) or failure (false). */ |
| 61 | using completion_callback_tcxx . . $ lttng/sessiond/commands/completion_callback_t# = stdcxx . . $ std/::functioncxx . . $ std/function#<void(bool)>; |
| 62 | using cancellation_callback_tcxx . . $ lttng/sessiond/commands/cancellation_callback_t# = stdcxx . . $ std/::functioncxx . . $ std/function#<void()>; |
| 63 | |
| 64 | reclaim_channel_memory_resultcxx . . $ lttng/sessiond/commands/reclaim_channel_memory_result# |
| 65 | reclaim_channel_memorycxx . . $ lttng/sessiond/commands/reclaim_channel_memory(a6ecb8e240f46ee6).(const ltt_sessioncxx . . $ ltt_session#::locked_refcxx . . $ ltt_session#locked_ref#& session, |
| 66 | lttngcxx . . $ lttng/::domain_classcxx . . $ lttng/domain_class# domain, |
| 67 | lttngcxx . . $ lttng/::c_string_viewcxx . . $ lttng/c_string_view# channel_name, |
| 68 | const nonstdcxx . . $ nonstd/::optionalcxx . . $ nonstd/optional#<stdcxx . . $ std/::chronocxx . . $ std/chrono/::microsecondscxx . . $ std/chrono/microseconds#>& reclaim_older_than_age, |
| 69 | bool require_consumed, |
| 70 | completion_callback_tcxx . . $ lttng/sessiond/commands/completion_callback_t# on_complete, |
| 71 | cancellation_callback_tcxx . . $ lttng/sessiond/commands/cancellation_callback_t# on_cancel); |
| 72 | |
| 73 | } /* namespace commands */ |
| 74 | } /* namespace sessiond */ |
| 75 | } /* namespace lttng */ |
| 76 | |
| 77 | /* |
| 78 | * Due to a bug in g++ < 7.1, this specialization must be enclosed in the fmt |
| 79 | * namespace, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480. |
| 80 | */ |
| 81 | namespace fmtcxx . . $ fmt/ { |
| 82 | |
| 83 | } /* namespace fmt */ |
| 84 | |
| 85 | #endif /* LTTNG_SESSIOND_CMD_RECLAIM_CHANNEL_MEMORY_HPP */ |