Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 1 | #include "aos/starter/starterd_lib.h" |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 2 | |
Stephan Pleines | f581a07 | 2024-05-23 20:59:27 -0700 | [diff] [blame] | 3 | #include <string.h> |
| 4 | |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 5 | #include <algorithm> |
Stephan Pleines | f581a07 | 2024-05-23 20:59:27 -0700 | [diff] [blame] | 6 | #include <chrono> |
| 7 | #include <functional> |
| 8 | #include <ostream> |
| 9 | #include <set> |
| 10 | #include <string_view> |
| 11 | #include <thread> |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 12 | #include <utility> |
| 13 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 14 | #include "absl/flags/declare.h" |
| 15 | #include "absl/flags/flag.h" |
| 16 | #include "absl/log/check.h" |
| 17 | #include "absl/log/log.h" |
Stephan Pleines | f581a07 | 2024-05-23 20:59:27 -0700 | [diff] [blame] | 18 | #include "flatbuffers/buffer.h" |
| 19 | #include "flatbuffers/flatbuffer_builder.h" |
| 20 | #include "flatbuffers/string.h" |
| 21 | #include "flatbuffers/vector.h" |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 22 | |
Stephan Pleines | f581a07 | 2024-05-23 20:59:27 -0700 | [diff] [blame] | 23 | #include "aos/events/context.h" |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 24 | #include "aos/json_to_flatbuffer.h" |
| 25 | |
Austin Schuh | 4d275fc | 2022-09-16 15:42:45 -0700 | [diff] [blame] | 26 | // FLAGS_shm_base is defined elsewhere, declare it here so it can be used |
| 27 | // to override the shared memory folder for unit testing. |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 28 | ABSL_DECLARE_FLAG(std::string, shm_base); |
Austin Schuh | 4d275fc | 2022-09-16 15:42:45 -0700 | [diff] [blame] | 29 | // FLAGS_permissions is defined elsewhere, declare it here so it can be used |
| 30 | // to set the file permissions on the shared memory block. |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 31 | ABSL_DECLARE_FLAG(uint32_t, permissions); |
Austin Schuh | 4d275fc | 2022-09-16 15:42:45 -0700 | [diff] [blame] | 32 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 33 | ABSL_FLAG(uint32_t, queue_initialization_threads, 0, |
| 34 | "Number of threads to spin up to initialize the queue. 0 means " |
| 35 | "use the main thread."); |
| 36 | ABSL_DECLARE_FLAG(bool, enable_ftrace); |
Austin Schuh | 816a116 | 2023-05-31 16:29:47 -0700 | [diff] [blame] | 37 | |
Stephan Pleines | f63bde8 | 2024-01-13 15:59:33 -0800 | [diff] [blame] | 38 | namespace aos::starter { |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 39 | |
James Kuszmaul | 293b217 | 2021-11-10 16:20:48 -0800 | [diff] [blame] | 40 | const aos::Channel *StatusChannelForNode(const aos::Configuration *config, |
| 41 | const aos::Node *node) { |
| 42 | return configuration::GetChannel<Status>(config, "/aos", "", node); |
| 43 | } |
| 44 | const aos::Channel *StarterRpcChannelForNode(const aos::Configuration *config, |
| 45 | const aos::Node *node) { |
| 46 | return configuration::GetChannel<StarterRpc>(config, "/aos", "", node); |
| 47 | } |
| 48 | |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 49 | Starter::Starter(const aos::Configuration *event_loop_config) |
| 50 | : config_msg_(event_loop_config), |
| 51 | event_loop_(event_loop_config), |
| 52 | status_sender_(event_loop_.MakeSender<aos::starter::Status>("/aos")), |
James Kuszmaul | 2c10e05 | 2023-08-09 10:22:36 -0700 | [diff] [blame] | 53 | status_timer_(event_loop_.AddPhasedLoop( |
| 54 | [this](int elapsed_cycles) { |
| 55 | ServiceTimingReportFetcher(elapsed_cycles); |
| 56 | SendStatus(); |
| 57 | status_count_ = 0; |
| 58 | }, |
| 59 | std::chrono::milliseconds(1000))), |
Austin Schuh | 59398d3 | 2023-05-03 08:10:55 -0700 | [diff] [blame] | 60 | cleanup_timer_(event_loop_.AddTimer([this] { |
| 61 | event_loop_.Exit(); |
| 62 | LOG(INFO) << "Starter event loop exit finished."; |
| 63 | })), |
Austin Schuh | fc30494 | 2021-10-16 14:20:05 -0700 | [diff] [blame] | 64 | max_status_count_( |
| 65 | event_loop_.GetChannel<aos::starter::Status>("/aos")->frequency() - |
| 66 | 1), |
James Kuszmaul | 8544c49 | 2023-07-31 15:00:38 -0700 | [diff] [blame] | 67 | timing_report_fetcher_( |
| 68 | event_loop_.MakeFetcher<aos::timing::Report>("/aos")), |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 69 | shm_base_(absl::GetFlag(FLAGS_shm_base)), |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 70 | listener_(&event_loop_, |
James Kuszmaul | 6295a64 | 2022-03-22 15:23:59 -0700 | [diff] [blame] | 71 | [this](signalfd_siginfo signal) { OnSignal(signal); }), |
Maxwell Gumley | b27245f | 2024-04-11 15:46:22 -0600 | [diff] [blame] | 72 | top_(&event_loop_, aos::util::Top::TrackThreadsMode::kDisabled, |
| 73 | aos::util::Top::TrackPerThreadInfoMode::kEnabled) { |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 74 | event_loop_.SkipAosLog(); |
| 75 | |
James Kuszmaul | 06a8f35 | 2024-03-15 14:15:57 -0700 | [diff] [blame] | 76 | cleanup_timer_->set_name("cleanup"); |
| 77 | |
James Kuszmaul | 293b217 | 2021-11-10 16:20:48 -0800 | [diff] [blame] | 78 | if (!aos::configuration::MultiNode(config_msg_)) { |
| 79 | event_loop_.MakeWatcher( |
| 80 | "/aos", |
| 81 | [this](const aos::starter::StarterRpc &cmd) { HandleStarterRpc(cmd); }); |
| 82 | } else { |
| 83 | for (const aos::Node *node : aos::configuration::GetNodes(config_msg_)) { |
| 84 | const Channel *channel = StarterRpcChannelForNode(config_msg_, node); |
| 85 | CHECK(channel != nullptr) << ": Failed to find channel /aos for " |
| 86 | << StarterRpc::GetFullyQualifiedName() << " on " |
| 87 | << node->name()->string_view(); |
| 88 | if (!aos::configuration::ChannelIsReadableOnNode(channel, |
| 89 | event_loop_.node())) { |
| 90 | LOG(INFO) << "StarterRpc channel " |
| 91 | << aos::configuration::StrippedChannelToString(channel) |
| 92 | << " is not readable on " |
| 93 | << event_loop_.node()->name()->string_view(); |
| 94 | } else { |
| 95 | event_loop_.MakeWatcher(channel->name()->string_view(), |
| 96 | [this](const aos::starter::StarterRpc &cmd) { |
| 97 | HandleStarterRpc(cmd); |
| 98 | }); |
| 99 | } |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 100 | } |
James Kuszmaul | 293b217 | 2021-11-10 16:20:48 -0800 | [diff] [blame] | 101 | } |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 102 | |
Austin Schuh | 4d275fc | 2022-09-16 15:42:45 -0700 | [diff] [blame] | 103 | // Catalogue all the applications for this node, so we can keep an eye on |
| 104 | // them. |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 105 | if (config_msg_->has_applications()) { |
| 106 | const flatbuffers::Vector<flatbuffers::Offset<aos::Application>> |
| 107 | *applications = config_msg_->applications(); |
Ravago Jones | 7e2dd32 | 2020-11-21 15:58:58 -0800 | [diff] [blame] | 108 | |
| 109 | if (aos::configuration::MultiNode(config_msg_)) { |
| 110 | std::string_view current_node = event_loop_.node()->name()->string_view(); |
| 111 | for (const aos::Application *application : *applications) { |
Austin Schuh | 228609b | 2023-03-21 15:43:11 -0700 | [diff] [blame] | 112 | CHECK(application->has_nodes()) |
| 113 | << ": Missing nodes on " << aos::FlatbufferToJson(application); |
Ravago Jones | 7e2dd32 | 2020-11-21 15:58:58 -0800 | [diff] [blame] | 114 | for (const flatbuffers::String *node : *application->nodes()) { |
| 115 | if (node->string_view() == current_node) { |
| 116 | AddApplication(application); |
| 117 | break; |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | } else { |
| 122 | for (const aos::Application *application : *applications) { |
| 123 | AddApplication(application); |
| 124 | } |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 125 | } |
| 126 | } |
Austin Schuh | 4d275fc | 2022-09-16 15:42:45 -0700 | [diff] [blame] | 127 | |
| 128 | // Catalogue all the intranode channels for this node, and create |
| 129 | // MemoryMappedQueues for each one to allocate the shared memory before |
| 130 | // spawning any shasta process. |
| 131 | if (config_msg_->has_channels()) { |
Austin Schuh | 816a116 | 2023-05-31 16:29:47 -0700 | [diff] [blame] | 132 | LOG(INFO) << "Starting to initialize shared memory."; |
Austin Schuh | 4d275fc | 2022-09-16 15:42:45 -0700 | [diff] [blame] | 133 | const aos::Node *this_node = event_loop_.node(); |
Austin Schuh | 816a116 | 2023-05-31 16:29:47 -0700 | [diff] [blame] | 134 | std::vector<const aos::Channel *> channels_to_construct; |
Austin Schuh | 4d275fc | 2022-09-16 15:42:45 -0700 | [diff] [blame] | 135 | for (const aos::Channel *channel : *config_msg_->channels()) { |
| 136 | if (aos::configuration::ChannelIsReadableOnNode(channel, this_node)) { |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 137 | if (absl::GetFlag(FLAGS_queue_initialization_threads) == 0) { |
Austin Schuh | 816a116 | 2023-05-31 16:29:47 -0700 | [diff] [blame] | 138 | AddChannel(channel); |
| 139 | } else { |
| 140 | channels_to_construct.push_back(channel); |
| 141 | } |
Austin Schuh | 4d275fc | 2022-09-16 15:42:45 -0700 | [diff] [blame] | 142 | } |
| 143 | } |
Austin Schuh | 816a116 | 2023-05-31 16:29:47 -0700 | [diff] [blame] | 144 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 145 | if (absl::GetFlag(FLAGS_queue_initialization_threads) != 0) { |
Austin Schuh | 816a116 | 2023-05-31 16:29:47 -0700 | [diff] [blame] | 146 | std::mutex pool_mutex; |
| 147 | std::vector<std::thread> threads; |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 148 | threads.reserve(absl::GetFlag(FLAGS_queue_initialization_threads)); |
| 149 | for (size_t i = 0; i < absl::GetFlag(FLAGS_queue_initialization_threads); |
| 150 | ++i) { |
Austin Schuh | 816a116 | 2023-05-31 16:29:47 -0700 | [diff] [blame] | 151 | threads.emplace_back([this, &pool_mutex, &channels_to_construct]() { |
| 152 | while (true) { |
| 153 | const aos::Channel *channel; |
| 154 | { |
| 155 | std::unique_lock<std::mutex> locker(pool_mutex); |
| 156 | if (channels_to_construct.empty()) { |
| 157 | return; |
| 158 | } |
| 159 | channel = channels_to_construct.back(); |
| 160 | channels_to_construct.pop_back(); |
| 161 | } |
| 162 | AddChannel(channel); |
| 163 | } |
| 164 | }); |
| 165 | } |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 166 | for (size_t i = 0; i < absl::GetFlag(FLAGS_queue_initialization_threads); |
| 167 | ++i) { |
Austin Schuh | 816a116 | 2023-05-31 16:29:47 -0700 | [diff] [blame] | 168 | threads[i].join(); |
| 169 | } |
| 170 | } |
| 171 | LOG(INFO) << "Starting applications."; |
Austin Schuh | 4d275fc | 2022-09-16 15:42:45 -0700 | [diff] [blame] | 172 | } |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 173 | } |
| 174 | |
James Kuszmaul | 293b217 | 2021-11-10 16:20:48 -0800 | [diff] [blame] | 175 | void Starter::HandleStarterRpc(const StarterRpc &command) { |
| 176 | if (!command.has_command() || !command.has_name() || exiting_) { |
| 177 | return; |
| 178 | } |
| 179 | |
| 180 | LOG(INFO) << "Received " << aos::FlatbufferToJson(&command); |
| 181 | |
| 182 | if (command.has_nodes()) { |
| 183 | CHECK(aos::configuration::MultiNode(config_msg_)); |
| 184 | bool relevant_to_this_node = false; |
| 185 | for (const flatbuffers::String *node : *command.nodes()) { |
| 186 | if (node->string_view() == event_loop_.node()->name()->string_view()) { |
| 187 | relevant_to_this_node = true; |
| 188 | } |
| 189 | } |
| 190 | if (!relevant_to_this_node) { |
| 191 | return; |
| 192 | } |
| 193 | } |
| 194 | // If not populated, restart regardless of node. |
| 195 | |
| 196 | auto search = applications_.find(command.name()->str()); |
| 197 | if (search != applications_.end()) { |
| 198 | // If an applicatione exists by the given name, dispatch the command |
| 199 | search->second.HandleCommand(command.command()); |
| 200 | } |
| 201 | } |
| 202 | |
James Kuszmaul | 6295a64 | 2022-03-22 15:23:59 -0700 | [diff] [blame] | 203 | void Starter::HandleStateChange() { |
| 204 | std::set<pid_t> all_pids; |
| 205 | for (const auto &pair : applications_) { |
| 206 | if (pair.second.get_pid() > 0 && |
| 207 | pair.second.status() != aos::starter::State::STOPPED) { |
| 208 | all_pids.insert(pair.second.get_pid()); |
| 209 | } |
| 210 | } |
| 211 | top_.set_track_pids(all_pids); |
| 212 | |
Austin Schuh | fc30494 | 2021-10-16 14:20:05 -0700 | [diff] [blame] | 213 | if (status_count_ < max_status_count_) { |
| 214 | SendStatus(); |
| 215 | ++status_count_; |
| 216 | } else { |
| 217 | VLOG(1) << "That's enough " << status_count_ << " " << max_status_count_; |
| 218 | } |
| 219 | } |
| 220 | |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 221 | void Starter::Cleanup() { |
| 222 | if (exiting_) { |
| 223 | return; |
| 224 | } |
| 225 | exiting_ = true; |
| 226 | for (auto &application : applications_) { |
| 227 | application.second.Terminate(); |
| 228 | } |
Philipp Schrader | a671252 | 2023-07-05 20:25:11 -0700 | [diff] [blame] | 229 | cleanup_timer_->Schedule(event_loop_.monotonic_now() + |
| 230 | std::chrono::milliseconds(1500)); |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | void Starter::OnSignal(signalfd_siginfo info) { |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 234 | if (info.ssi_signo == SIGCHLD) { |
| 235 | // SIGCHLD messages can be collapsed if multiple are received, so all |
| 236 | // applications must check their status. |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 237 | if (absl::GetFlag(FLAGS_enable_ftrace)) { |
Pallavi Madhukar | aa17d24 | 2023-12-20 13:42:41 -0800 | [diff] [blame] | 238 | ftrace_.FormatMessage("SIGCHLD"); |
| 239 | ftrace_.TurnOffOrDie(); |
| 240 | } |
| 241 | |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 242 | for (auto iter = applications_.begin(); iter != applications_.end();) { |
| 243 | if (iter->second.MaybeHandleSignal()) { |
| 244 | iter = applications_.erase(iter); |
| 245 | } else { |
| 246 | ++iter; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | if (exiting_ && applications_.empty()) { |
| 251 | event_loop_.Exit(); |
| 252 | } |
Austin Schuh | 3204b33 | 2021-10-16 14:20:10 -0700 | [diff] [blame] | 253 | } else { |
| 254 | LOG(INFO) << "Received signal '" << strsignal(info.ssi_signo) << "'"; |
| 255 | |
| 256 | if (std::find(kStarterDeath.begin(), kStarterDeath.end(), info.ssi_signo) != |
| 257 | kStarterDeath.end()) { |
| 258 | LOG(WARNING) << "Starter shutting down"; |
| 259 | Cleanup(); |
| 260 | } |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 261 | } |
| 262 | } |
| 263 | |
| 264 | Application *Starter::AddApplication(const aos::Application *application) { |
James Kuszmaul | 6295a64 | 2022-03-22 15:23:59 -0700 | [diff] [blame] | 265 | auto [iter, success] = applications_.try_emplace( |
| 266 | application->name()->str(), application, &event_loop_, |
| 267 | [this]() { HandleStateChange(); }); |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 268 | if (success) { |
James Kuszmaul | d42edb4 | 2022-01-07 18:00:16 -0800 | [diff] [blame] | 269 | // We should be catching and handling SIGCHLD correctly in the starter, so |
| 270 | // don't leave in the crutch for polling for the child process status (this |
| 271 | // is less about efficiency, and more about making sure bit rot doesn't |
| 272 | // result in the signal handling breaking). |
| 273 | iter->second.DisableChildDeathPolling(); |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 274 | return &(iter->second); |
| 275 | } |
| 276 | return nullptr; |
| 277 | } |
| 278 | |
| 279 | void Starter::Run() { |
Tyler Chatow | 03fdb2a | 2020-12-26 18:39:36 -0800 | [diff] [blame] | 280 | #ifdef AOS_ARCHITECTURE_arm_frc |
| 281 | PCHECK(setuid(0) == 0) << "Failed to change user to root"; |
| 282 | #endif |
| 283 | |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 284 | for (auto &application : applications_) { |
Austin Schuh | 5f79a5a | 2021-10-12 17:46:50 -0700 | [diff] [blame] | 285 | if (application.second.autostart()) { |
| 286 | application.second.Start(); |
| 287 | } |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | event_loop_.Run(); |
| 291 | } |
| 292 | |
James Kuszmaul | 2c10e05 | 2023-08-09 10:22:36 -0700 | [diff] [blame] | 293 | void Starter::ServiceTimingReportFetcher(int elapsed_cycles) { |
| 294 | // If there is any chance that it has been longer than one cycle since we last |
| 295 | // serviced the fetcher, call Fetch(). This reduces the chances that the |
| 296 | // fetcher falls behind when the system is under heavy load. Dropping a few |
| 297 | // timing report messages when the system is under stress is fine. |
| 298 | if (timing_report_fetcher_.get() == nullptr || elapsed_cycles > 1) { |
| 299 | timing_report_fetcher_.Fetch(); |
| 300 | } |
James Kuszmaul | 8544c49 | 2023-07-31 15:00:38 -0700 | [diff] [blame] | 301 | while (timing_report_fetcher_.FetchNext()) { |
| 302 | for (auto &application : applications_) { |
| 303 | application.second.ObserveTimingReport( |
| 304 | timing_report_fetcher_.context().monotonic_event_time, |
| 305 | timing_report_fetcher_.get()); |
| 306 | } |
| 307 | } |
| 308 | } |
| 309 | |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 310 | void Starter::SendStatus() { |
| 311 | aos::Sender<aos::starter::Status>::Builder builder = |
| 312 | status_sender_.MakeBuilder(); |
| 313 | |
| 314 | std::vector<flatbuffers::Offset<aos::starter::ApplicationStatus>> statuses; |
| 315 | |
| 316 | for (auto &application : applications_) { |
James Kuszmaul | 6295a64 | 2022-03-22 15:23:59 -0700 | [diff] [blame] | 317 | statuses.push_back(application.second.PopulateStatus(builder.fbb(), &top_)); |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 318 | } |
| 319 | |
| 320 | auto statuses_fbs = builder.fbb()->CreateVector(statuses); |
| 321 | |
| 322 | aos::starter::Status::Builder status_builder(*builder.fbb()); |
| 323 | status_builder.add_statuses(statuses_fbs); |
milind | 1f1dca3 | 2021-07-03 13:50:07 -0700 | [diff] [blame] | 324 | builder.CheckOk(builder.Send(status_builder.Finish())); |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 325 | } |
| 326 | |
Austin Schuh | 4d275fc | 2022-09-16 15:42:45 -0700 | [diff] [blame] | 327 | void Starter::AddChannel(const aos::Channel *channel) { |
Austin Schuh | 6bdcc37 | 2024-06-27 14:49:11 -0700 | [diff] [blame] | 328 | CHECK(channel != nullptr); |
Austin Schuh | 816a116 | 2023-05-31 16:29:47 -0700 | [diff] [blame] | 329 | std::unique_ptr<aos::ipc_lib::MemoryMappedQueue> queue = |
| 330 | std::make_unique<aos::ipc_lib::MemoryMappedQueue>( |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 331 | shm_base_, absl::GetFlag(FLAGS_permissions), |
| 332 | event_loop_.configuration(), channel); |
Austin Schuh | 816a116 | 2023-05-31 16:29:47 -0700 | [diff] [blame] | 333 | |
| 334 | { |
| 335 | std::unique_lock<std::mutex> locker(queue_mutex_); |
| 336 | shm_queues_.emplace_back(std::move(queue)); |
| 337 | } |
Austin Schuh | 4d275fc | 2022-09-16 15:42:45 -0700 | [diff] [blame] | 338 | VLOG(1) << "Created MemoryMappedQueue for " |
| 339 | << aos::configuration::StrippedChannelToString(channel) << " under " |
| 340 | << shm_base_; |
| 341 | } |
| 342 | |
Stephan Pleines | f63bde8 | 2024-01-13 15:59:33 -0800 | [diff] [blame] | 343 | } // namespace aos::starter |