blob: 08fa7fd21f2babb6c6abbaabf1092ed90f5bf017 [file] [log] [blame]
Austin Schuh54cf95f2019-11-29 13:14:18 -08001#include "aos/events/event_loop.h"
2
3#include "aos/configuration.h"
4#include "aos/configuration_generated.h"
Tyler Chatow67ddb032020-01-12 14:30:04 -08005#include "aos/logging/implementations.h"
Austin Schuh54cf95f2019-11-29 13:14:18 -08006#include "glog/logging.h"
7
Austin Schuh39788ff2019-12-01 18:22:57 -08008DEFINE_bool(timing_reports, true, "Publish timing reports.");
9DEFINE_int32(timing_report_ms, 1000,
10 "Period in milliseconds to publish timing reports at.");
11
Austin Schuh54cf95f2019-11-29 13:14:18 -080012namespace aos {
Austin Schuhd54780b2020-10-03 16:26:02 -070013namespace {
14void CheckAlignment(const Channel *channel) {
15 if (channel->max_size() % alignof(flatbuffers::largest_scalar_t) != 0) {
16 LOG(FATAL) << "max_size() (" << channel->max_size()
17 << ") is not a multiple of alignment ("
18 << alignof(flatbuffers::largest_scalar_t) << ") for channel "
19 << configuration::CleanedChannelToString(channel) << ".";
20 }
21}
22} // namespace
Austin Schuh54cf95f2019-11-29 13:14:18 -080023
Austin Schuh39788ff2019-12-01 18:22:57 -080024RawSender::RawSender(EventLoop *event_loop, const Channel *channel)
25 : event_loop_(event_loop),
26 channel_(channel),
Brian Silverman79ec7fc2020-06-08 20:11:22 -050027 ftrace_prefix_(configuration::StrippedChannelToString(channel)),
Austin Schuh39788ff2019-12-01 18:22:57 -080028 timing_(event_loop_->ChannelIndex(channel)) {
29 event_loop_->NewSender(this);
30}
31
32RawSender::~RawSender() { event_loop_->DeleteSender(this); }
33
34RawFetcher::RawFetcher(EventLoop *event_loop, const Channel *channel)
35 : event_loop_(event_loop),
36 channel_(channel),
Brian Silverman79ec7fc2020-06-08 20:11:22 -050037 ftrace_prefix_(configuration::StrippedChannelToString(channel)),
Austin Schuh39788ff2019-12-01 18:22:57 -080038 timing_(event_loop_->ChannelIndex(channel)) {
Austin Schuhad154822019-12-27 15:45:13 -080039 context_.monotonic_event_time = monotonic_clock::min_time;
40 context_.monotonic_remote_time = monotonic_clock::min_time;
41 context_.realtime_event_time = realtime_clock::min_time;
42 context_.realtime_remote_time = realtime_clock::min_time;
Austin Schuh39788ff2019-12-01 18:22:57 -080043 context_.queue_index = 0xffffffff;
44 context_.size = 0;
45 context_.data = nullptr;
Brian Silverman4f4e0612020-08-12 19:54:41 -070046 context_.buffer_index = -1;
Austin Schuh39788ff2019-12-01 18:22:57 -080047 event_loop_->NewFetcher(this);
48}
49
50RawFetcher::~RawFetcher() { event_loop_->DeleteFetcher(this); }
51
52TimerHandler::TimerHandler(EventLoop *event_loop, std::function<void()> fn)
53 : event_loop_(event_loop), fn_(std::move(fn)) {}
54
55TimerHandler::~TimerHandler() {}
56
57PhasedLoopHandler::PhasedLoopHandler(EventLoop *event_loop,
58 std::function<void(int)> fn,
59 const monotonic_clock::duration interval,
60 const monotonic_clock::duration offset)
61 : event_loop_(event_loop),
62 fn_(std::move(fn)),
63 phased_loop_(interval, event_loop_->monotonic_now(), offset) {
64 event_loop_->OnRun([this]() {
65 const monotonic_clock::time_point monotonic_now =
66 event_loop_->monotonic_now();
67 phased_loop_.Reset(monotonic_now);
68 Reschedule(
69 [this](monotonic_clock::time_point sleep_time) {
70 Schedule(sleep_time);
71 },
72 monotonic_now);
73 // The first time, we'll double count. Reschedule here will count cycles
74 // elapsed before now, and then the reschedule before runing the handler
75 // will count the time that elapsed then. So clear the count here.
76 cycles_elapsed_ = 0;
77 });
78}
79
80PhasedLoopHandler::~PhasedLoopHandler() {}
81
Tyler Chatow67ddb032020-01-12 14:30:04 -080082EventLoop::EventLoop(const Configuration *configuration)
83 : timing_report_(flatbuffers::DetachedBuffer()),
Austin Schuh56196432020-10-24 20:15:21 -070084 configuration_(configuration) {}
Tyler Chatow67ddb032020-01-12 14:30:04 -080085
Austin Schuh39788ff2019-12-01 18:22:57 -080086EventLoop::~EventLoop() {
87 CHECK_EQ(senders_.size(), 0u) << ": Not all senders destroyed";
Austin Schuh7d87b672019-12-01 20:23:49 -080088 CHECK_EQ(events_.size(), 0u) << ": Not all events unregistered";
Austin Schuh39788ff2019-12-01 18:22:57 -080089}
90
91int EventLoop::ChannelIndex(const Channel *channel) {
Austin Schuhc9e10ec2020-01-26 16:08:28 -080092 return configuration::ChannelIndex(configuration_, channel);
Austin Schuh39788ff2019-12-01 18:22:57 -080093}
94
Brian Silverman5120afb2020-01-31 17:44:35 -080095WatcherState *EventLoop::GetWatcherState(const Channel *channel) {
96 const int channel_index = ChannelIndex(channel);
97 for (const std::unique_ptr<WatcherState> &watcher : watchers_) {
98 if (watcher->channel_index() == channel_index) {
99 return watcher.get();
100 }
101 }
102 LOG(FATAL) << "No watcher found for channel";
103}
104
Austin Schuh39788ff2019-12-01 18:22:57 -0800105void EventLoop::NewSender(RawSender *sender) {
106 senders_.emplace_back(sender);
107 UpdateTimingReport();
108}
109void EventLoop::DeleteSender(RawSender *sender) {
110 CHECK(!is_running());
111 auto s = std::find(senders_.begin(), senders_.end(), sender);
112 CHECK(s != senders_.end()) << ": Sender not in senders list";
113 senders_.erase(s);
114 UpdateTimingReport();
115}
116
117TimerHandler *EventLoop::NewTimer(std::unique_ptr<TimerHandler> timer) {
118 timers_.emplace_back(std::move(timer));
119 UpdateTimingReport();
120 return timers_.back().get();
121}
122
123PhasedLoopHandler *EventLoop::NewPhasedLoop(
124 std::unique_ptr<PhasedLoopHandler> phased_loop) {
125 phased_loops_.emplace_back(std::move(phased_loop));
126 UpdateTimingReport();
127 return phased_loops_.back().get();
128}
129
130void EventLoop::NewFetcher(RawFetcher *fetcher) {
Austin Schuhd54780b2020-10-03 16:26:02 -0700131 CheckAlignment(fetcher->channel());
132
Austin Schuh39788ff2019-12-01 18:22:57 -0800133 fetchers_.emplace_back(fetcher);
134 UpdateTimingReport();
135}
136
137void EventLoop::DeleteFetcher(RawFetcher *fetcher) {
138 CHECK(!is_running());
139 auto f = std::find(fetchers_.begin(), fetchers_.end(), fetcher);
140 CHECK(f != fetchers_.end()) << ": Fetcher not in fetchers list";
141 fetchers_.erase(f);
142 UpdateTimingReport();
143}
144
145WatcherState *EventLoop::NewWatcher(std::unique_ptr<WatcherState> watcher) {
146 watchers_.emplace_back(std::move(watcher));
147
148 UpdateTimingReport();
149
150 return watchers_.back().get();
151}
152
Brian Silverman0fc69932020-01-24 21:54:02 -0800153void EventLoop::TakeWatcher(const Channel *channel) {
154 CHECK(!is_running()) << ": Cannot add new objects while running.";
155 ChannelIndex(channel);
156
Austin Schuhd54780b2020-10-03 16:26:02 -0700157 CheckAlignment(channel);
158
Brian Silverman0fc69932020-01-24 21:54:02 -0800159 CHECK(taken_senders_.find(channel) == taken_senders_.end())
Austin Schuh8072f922020-02-16 21:51:47 -0800160 << ": " << configuration::CleanedChannelToString(channel)
161 << " is already being used.";
Brian Silverman0fc69932020-01-24 21:54:02 -0800162
163 auto result = taken_watchers_.insert(channel);
Austin Schuh8072f922020-02-16 21:51:47 -0800164 CHECK(result.second) << ": " << configuration::CleanedChannelToString(channel)
Brian Silverman0fc69932020-01-24 21:54:02 -0800165 << " is already being used.";
166
167 if (!configuration::ChannelIsReadableOnNode(channel, node())) {
Austin Schuh8072f922020-02-16 21:51:47 -0800168 LOG(FATAL) << ": " << configuration::CleanedChannelToString(channel)
Brian Silverman0fc69932020-01-24 21:54:02 -0800169 << " is not able to be watched on this node. Check your "
170 "configuration.";
171 }
172}
173
174void EventLoop::TakeSender(const Channel *channel) {
175 CHECK(!is_running()) << ": Cannot add new objects while running.";
176 ChannelIndex(channel);
177
Austin Schuhd54780b2020-10-03 16:26:02 -0700178 CheckAlignment(channel);
179
Brian Silverman0fc69932020-01-24 21:54:02 -0800180 CHECK(taken_watchers_.find(channel) == taken_watchers_.end())
Austin Schuh8072f922020-02-16 21:51:47 -0800181 << ": Channel " << configuration::CleanedChannelToString(channel)
182 << " is already being used.";
Brian Silverman0fc69932020-01-24 21:54:02 -0800183
184 // We don't care if this is a duplicate.
185 taken_senders_.insert(channel);
186}
187
Austin Schuh39788ff2019-12-01 18:22:57 -0800188void EventLoop::SendTimingReport() {
189 // We need to do a fancy dance here to get all the accounting to work right.
190 // We want to copy the memory here, but then send after resetting. Otherwise
191 // the send for the timing report won't be counted in the timing report.
192 //
193 // Also, flatbuffers build from the back end. So place this at the back end
194 // of the buffer. We only have to care because we are using this in a very
195 // raw fashion.
Austin Schuhadd6eb32020-11-09 21:24:26 -0800196 CHECK_LE(timing_report_.span().size(), timing_report_sender_->size())
Austin Schuh39788ff2019-12-01 18:22:57 -0800197 << ": Timing report bigger than the sender size.";
Austin Schuhadd6eb32020-11-09 21:24:26 -0800198 std::copy(timing_report_.span().data(),
199 timing_report_.span().data() + timing_report_.span().size(),
Austin Schuh39788ff2019-12-01 18:22:57 -0800200 reinterpret_cast<uint8_t *>(timing_report_sender_->data()) +
Austin Schuhadd6eb32020-11-09 21:24:26 -0800201 timing_report_sender_->size() - timing_report_.span().size());
Austin Schuh39788ff2019-12-01 18:22:57 -0800202
203 for (const std::unique_ptr<TimerHandler> &timer : timers_) {
204 timer->timing_.ResetTimingReport();
205 }
206 for (const std::unique_ptr<WatcherState> &watcher : watchers_) {
207 watcher->ResetReport();
208 }
209 for (const std::unique_ptr<PhasedLoopHandler> &phased_loop : phased_loops_) {
210 phased_loop->timing_.ResetTimingReport();
211 }
212 for (RawSender *sender : senders_) {
213 sender->timing_.ResetTimingReport();
214 }
215 for (RawFetcher *fetcher : fetchers_) {
216 fetcher->timing_.ResetTimingReport();
217 }
Austin Schuhadd6eb32020-11-09 21:24:26 -0800218 timing_report_sender_->Send(timing_report_.span().size());
Austin Schuh39788ff2019-12-01 18:22:57 -0800219}
220
221void EventLoop::UpdateTimingReport() {
222 // We need to support senders and fetchers changing while we are setting up
223 // the event loop. Otherwise we can't fetch or send until the loop runs. This
224 // means that on each change, we need to redo all this work. This makes setup
225 // more expensive, but not by all that much on a modern processor.
226
227 // Now, build up a report with everything pre-filled out.
228 flatbuffers::FlatBufferBuilder fbb;
Austin Schuhd7b15da2020-02-17 15:06:11 -0800229 fbb.ForceDefaults(true);
Austin Schuh39788ff2019-12-01 18:22:57 -0800230
231 // Pre-fill in the defaults for timers.
232 std::vector<flatbuffers::Offset<timing::Timer>> timer_offsets;
233 for (const std::unique_ptr<TimerHandler> &timer : timers_) {
234 flatbuffers::Offset<timing::Statistic> wakeup_latency_offset =
235 timing::CreateStatistic(fbb);
236 flatbuffers::Offset<timing::Statistic> handler_time_offset =
237 timing::CreateStatistic(fbb);
238 flatbuffers::Offset<flatbuffers::String> name_offset;
239 if (timer->name().size() != 0) {
240 name_offset = fbb.CreateString(timer->name());
241 }
242
243 timing::Timer::Builder timer_builder(fbb);
244
245 if (timer->name().size() != 0) {
246 timer_builder.add_name(name_offset);
247 }
248 timer_builder.add_wakeup_latency(wakeup_latency_offset);
249 timer_builder.add_handler_time(handler_time_offset);
250 timer_builder.add_count(0);
251 timer_offsets.emplace_back(timer_builder.Finish());
252 }
253
254 // Pre-fill in the defaults for phased_loops.
255 std::vector<flatbuffers::Offset<timing::Timer>> phased_loop_offsets;
256 for (const std::unique_ptr<PhasedLoopHandler> &phased_loop : phased_loops_) {
257 flatbuffers::Offset<timing::Statistic> wakeup_latency_offset =
258 timing::CreateStatistic(fbb);
259 flatbuffers::Offset<timing::Statistic> handler_time_offset =
260 timing::CreateStatistic(fbb);
261 flatbuffers::Offset<flatbuffers::String> name_offset;
262 if (phased_loop->name().size() != 0) {
263 name_offset = fbb.CreateString(phased_loop->name());
264 }
265
266 timing::Timer::Builder timer_builder(fbb);
267
268 if (phased_loop->name().size() != 0) {
269 timer_builder.add_name(name_offset);
270 }
271 timer_builder.add_wakeup_latency(wakeup_latency_offset);
272 timer_builder.add_handler_time(handler_time_offset);
273 timer_builder.add_count(0);
274 phased_loop_offsets.emplace_back(timer_builder.Finish());
275 }
276
277 // Pre-fill in the defaults for watchers.
278 std::vector<flatbuffers::Offset<timing::Watcher>> watcher_offsets;
279 for (const std::unique_ptr<WatcherState> &watcher : watchers_) {
280 flatbuffers::Offset<timing::Statistic> wakeup_latency_offset =
281 timing::CreateStatistic(fbb);
282 flatbuffers::Offset<timing::Statistic> handler_time_offset =
283 timing::CreateStatistic(fbb);
284
285 timing::Watcher::Builder watcher_builder(fbb);
286
287 watcher_builder.add_channel_index(watcher->channel_index());
288 watcher_builder.add_wakeup_latency(wakeup_latency_offset);
289 watcher_builder.add_handler_time(handler_time_offset);
290 watcher_builder.add_count(0);
291 watcher_offsets.emplace_back(watcher_builder.Finish());
292 }
293
294 // Pre-fill in the defaults for senders.
295 std::vector<flatbuffers::Offset<timing::Sender>> sender_offsets;
296 for (const RawSender *sender : senders_) {
297 flatbuffers::Offset<timing::Statistic> size_offset =
298 timing::CreateStatistic(fbb);
299
300 timing::Sender::Builder sender_builder(fbb);
301
302 sender_builder.add_channel_index(sender->timing_.channel_index);
303 sender_builder.add_size(size_offset);
304 sender_builder.add_count(0);
305 sender_offsets.emplace_back(sender_builder.Finish());
306 }
307
308 // Pre-fill in the defaults for fetchers.
309 std::vector<flatbuffers::Offset<timing::Fetcher>> fetcher_offsets;
310 for (RawFetcher *fetcher : fetchers_) {
311 flatbuffers::Offset<timing::Statistic> latency_offset =
312 timing::CreateStatistic(fbb);
313
314 timing::Fetcher::Builder fetcher_builder(fbb);
315
316 fetcher_builder.add_channel_index(fetcher->timing_.channel_index);
317 fetcher_builder.add_count(0);
318 fetcher_builder.add_latency(latency_offset);
319 fetcher_offsets.emplace_back(fetcher_builder.Finish());
320 }
321
322 // Then build the final report.
323 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<timing::Timer>>>
324 timers_offset;
325 if (timer_offsets.size() > 0) {
326 timers_offset = fbb.CreateVector(timer_offsets);
327 }
328
329 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<timing::Timer>>>
330 phased_loops_offset;
331 if (phased_loop_offsets.size() > 0) {
332 phased_loops_offset = fbb.CreateVector(phased_loop_offsets);
333 }
334
335 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<timing::Watcher>>>
336 watchers_offset;
337 if (watcher_offsets.size() > 0) {
338 watchers_offset = fbb.CreateVector(watcher_offsets);
339 }
340
341 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<timing::Sender>>>
342 senders_offset;
343 if (sender_offsets.size() > 0) {
344 senders_offset = fbb.CreateVector(sender_offsets);
345 }
346
347 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<timing::Fetcher>>>
348 fetchers_offset;
349 if (fetcher_offsets.size() > 0) {
350 fetchers_offset = fbb.CreateVector(fetcher_offsets);
351 }
352
353 flatbuffers::Offset<flatbuffers::String> name_offset =
354 fbb.CreateString(name());
355
356 timing::Report::Builder report_builder(fbb);
357 report_builder.add_name(name_offset);
358 report_builder.add_pid(GetTid());
359 if (timer_offsets.size() > 0) {
360 report_builder.add_timers(timers_offset);
361 }
362 if (phased_loop_offsets.size() > 0) {
363 report_builder.add_phased_loops(phased_loops_offset);
364 }
365 if (watcher_offsets.size() > 0) {
366 report_builder.add_watchers(watchers_offset);
367 }
368 if (sender_offsets.size() > 0) {
369 report_builder.add_senders(senders_offset);
370 }
371 if (fetcher_offsets.size() > 0) {
372 report_builder.add_fetchers(fetchers_offset);
373 }
374 fbb.Finish(report_builder.Finish());
375
376 timing_report_ = FlatbufferDetachedBuffer<timing::Report>(fbb.Release());
377
378 // Now that the pointers are stable, pass them to the timers and watchers to
379 // be updated.
380 for (size_t i = 0; i < timers_.size(); ++i) {
381 timers_[i]->timing_.set_timing_report(
382 timing_report_.mutable_message()->mutable_timers()->GetMutableObject(
383 i));
384 }
385
386 for (size_t i = 0; i < phased_loops_.size(); ++i) {
387 phased_loops_[i]->timing_.set_timing_report(
388 timing_report_.mutable_message()
389 ->mutable_phased_loops()
390 ->GetMutableObject(i));
391 }
392
393 for (size_t i = 0; i < watchers_.size(); ++i) {
394 watchers_[i]->set_timing_report(
395 timing_report_.mutable_message()->mutable_watchers()->GetMutableObject(
396 i));
397 }
398
399 for (size_t i = 0; i < senders_.size(); ++i) {
400 senders_[i]->timing_.set_timing_report(
401 timing_report_.mutable_message()->mutable_senders()->GetMutableObject(
402 i));
403 }
404
405 for (size_t i = 0; i < fetchers_.size(); ++i) {
406 fetchers_[i]->timing_.set_timing_report(
407 timing_report_.mutable_message()->mutable_fetchers()->GetMutableObject(
408 i));
409 }
410}
411
412void EventLoop::MaybeScheduleTimingReports() {
413 if (FLAGS_timing_reports && !skip_timing_report_) {
414 CHECK(!timing_report_sender_) << ": Timing reports already scheduled.";
415 // Make a raw sender for the report.
416 const Channel *channel = configuration::GetChannel(
417 configuration(), "/aos", timing::Report::GetFullyQualifiedName(),
Austin Schuhbca6cf02019-12-22 17:28:34 -0800418 name(), node());
Austin Schuh196a4452020-03-15 23:12:03 -0700419 CHECK(channel != nullptr) << ": Failed to look up {\"name\": \"/aos\", "
420 "\"type\": \"aos.timing.Report\"} on node "
421 << FlatbufferToJson(node());
Austin Schuhbca6cf02019-12-22 17:28:34 -0800422
423 // Since we are using a RawSender, validity isn't checked. So check it
424 // ourselves.
Austin Schuhca4828c2019-12-28 14:21:35 -0800425 if (!configuration::ChannelIsSendableOnNode(channel, node())) {
426 LOG(FATAL) << "Channel { \"name\": \"/aos"
427 << channel->name()->string_view() << "\", \"type\": \""
428 << channel->type()->string_view()
429 << "\" } is not able to be sent on this node. Check your "
430 "configuration.";
Austin Schuhbca6cf02019-12-22 17:28:34 -0800431 }
Austin Schuh39788ff2019-12-01 18:22:57 -0800432 CHECK(channel != nullptr) << ": Channel { \"name\": \"/aos\", \"type\": \""
433 << timing::Report::GetFullyQualifiedName()
434 << "\" } not found in config.";
435 timing_report_sender_ = MakeRawSender(channel);
436
437 // Register a handler which sends the report out by copying the raw data
438 // from the prebuilt and subsequently modified report.
439 TimerHandler *timing_reports_timer =
440 AddTimer([this]() { SendTimingReport(); });
441
442 // Set it up to send once per second.
443 timing_reports_timer->set_name("timing_reports");
444 OnRun([this, timing_reports_timer]() {
445 timing_reports_timer->Setup(
446 monotonic_now() + std::chrono::milliseconds(FLAGS_timing_report_ms),
447 std::chrono::milliseconds(FLAGS_timing_report_ms));
448 });
449
450 UpdateTimingReport();
451 }
452}
453
Austin Schuh7d87b672019-12-01 20:23:49 -0800454void EventLoop::ReserveEvents() {
455 events_.reserve(timers_.size() + phased_loops_.size() + watchers_.size());
456}
457
458namespace {
459bool CompareEvents(const EventLoopEvent *first, const EventLoopEvent *second) {
Brian Silvermanbd405c02020-06-23 16:25:23 -0700460 if (first->event_time() > second->event_time()) {
461 return true;
462 }
463 if (first->event_time() < second->event_time()) {
464 return false;
465 }
466 return first->generation() > second->generation();
Austin Schuh7d87b672019-12-01 20:23:49 -0800467}
468} // namespace
469
470void EventLoop::AddEvent(EventLoopEvent *event) {
471 DCHECK(std::find(events_.begin(), events_.end(), event) == events_.end());
Brian Silvermanbd405c02020-06-23 16:25:23 -0700472 DCHECK(event->generation() == 0);
473 event->set_generation(++event_generation_);
Austin Schuh7d87b672019-12-01 20:23:49 -0800474 events_.push_back(event);
475 std::push_heap(events_.begin(), events_.end(), CompareEvents);
476}
477
478void EventLoop::RemoveEvent(EventLoopEvent *event) {
479 auto e = std::find(events_.begin(), events_.end(), event);
480 if (e != events_.end()) {
Brian Silvermanbd405c02020-06-23 16:25:23 -0700481 DCHECK(event->generation() != 0);
Austin Schuh7d87b672019-12-01 20:23:49 -0800482 events_.erase(e);
483 std::make_heap(events_.begin(), events_.end(), CompareEvents);
484 event->Invalidate();
485 }
486}
487
488EventLoopEvent *EventLoop::PopEvent() {
489 EventLoopEvent *result = events_.front();
490 std::pop_heap(events_.begin(), events_.end(), CompareEvents);
491 events_.pop_back();
492 result->Invalidate();
493 return result;
494}
495
Austin Schuh39788ff2019-12-01 18:22:57 -0800496void WatcherState::set_timing_report(timing::Watcher *watcher) {
497 CHECK_NOTNULL(watcher);
498 watcher_ = watcher;
499 wakeup_latency_.set_statistic(watcher->mutable_wakeup_latency());
500 handler_time_.set_statistic(watcher->mutable_handler_time());
501}
502
503void WatcherState::ResetReport() {
504 wakeup_latency_.Reset();
505 handler_time_.Reset();
506 watcher_->mutate_count(0);
Austin Schuh54cf95f2019-11-29 13:14:18 -0800507}
508
509} // namespace aos