Clang-format aos
It has drifted... Clean it up a bit.
Change-Id: I2fe31a2187b4f690634ae6942786575db20192af
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/events/logging/boot_timestamp.cc b/aos/events/logging/boot_timestamp.cc
index b3511f4..ef65171 100644
--- a/aos/events/logging/boot_timestamp.cc
+++ b/aos/events/logging/boot_timestamp.cc
@@ -19,8 +19,8 @@
std::ostream &operator<<(std::ostream &os,
const struct BootQueueIndex &queue_index) {
- return os << "{.boot=" << queue_index.boot
- << ", .index=" << queue_index.index << "}";
+ return os << "{.boot=" << queue_index.boot << ", .index=" << queue_index.index
+ << "}";
}
} // namespace aos::logger
diff --git a/aos/events/logging/buffer_encoder_param_test.h b/aos/events/logging/buffer_encoder_param_test.h
index fd1a00c..871e25e 100644
--- a/aos/events/logging/buffer_encoder_param_test.h
+++ b/aos/events/logging/buffer_encoder_param_test.h
@@ -6,12 +6,11 @@
#include <random>
#include <vector>
-#include "glog/logging.h"
-#include "gtest/gtest.h"
-
#include "aos/events/logging/logfile_utils.h"
#include "aos/events/logging/logger_generated.h"
#include "aos/testing/random_seed.h"
+#include "glog/logging.h"
+#include "gtest/gtest.h"
namespace aos::logger::testing {
diff --git a/aos/events/logging/buffer_encoder_test.cc b/aos/events/logging/buffer_encoder_test.cc
index 0687f83..5a9b85f 100644
--- a/aos/events/logging/buffer_encoder_test.cc
+++ b/aos/events/logging/buffer_encoder_test.cc
@@ -4,12 +4,11 @@
#include <fstream>
#include <string>
+#include "aos/events/logging/buffer_encoder_param_test.h"
#include "glog/logging.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-#include "aos/events/logging/buffer_encoder_param_test.h"
-
namespace aos::logger::testing {
class DummyEncoderTest : public BufferEncoderBaseTest {};
diff --git a/aos/events/logging/log_cat.cc b/aos/events/logging/log_cat.cc
index d85b79b..3e1dd1e 100644
--- a/aos/events/logging/log_cat.cc
+++ b/aos/events/logging/log_cat.cc
@@ -315,30 +315,29 @@
VLOG(1) << "Listening on " << name << " " << type;
CHECK_NOTNULL(channel->schema());
- event_loop_->MakeRawWatcher(
- channel,
- [this, channel, start_time, end_time](const aos::Context &context,
- const void * /*message*/) {
- if (!FLAGS_print) {
- return;
- }
+ event_loop_->MakeRawWatcher(channel, [this, channel, start_time,
+ end_time](
+ const aos::Context &context,
+ const void * /*message*/) {
+ if (!FLAGS_print) {
+ return;
+ }
- if (!FLAGS_fetch && !started_) {
- return;
- }
+ if (!FLAGS_fetch && !started_) {
+ return;
+ }
- if (context.monotonic_event_time < start_time ||
- context.monotonic_event_time > end_time) {
- return;
- }
+ if (context.monotonic_event_time < start_time ||
+ context.monotonic_event_time > end_time) {
+ return;
+ }
- PrintMessage(node_name_, node_factory_, channel, context,
- builder_);
- ++(*message_print_counter_);
- if (FLAGS_count > 0 && *message_print_counter_ >= FLAGS_count) {
- factory_->Exit();
- }
- });
+ PrintMessage(node_name_, node_factory_, channel, context, builder_);
+ ++(*message_print_counter_);
+ if (FLAGS_count > 0 && *message_print_counter_ >= FLAGS_count) {
+ factory_->Exit();
+ }
+ });
}
}
}
diff --git a/aos/events/logging/log_namer.h b/aos/events/logging/log_namer.h
index 4a1e74f..7947ebe 100644
--- a/aos/events/logging/log_namer.h
+++ b/aos/events/logging/log_namer.h
@@ -220,9 +220,7 @@
UUID::FromString(header_.message().logger_node_boot_uuid());
}
- void ClearStartTimes() {
- node_states_.clear();
- }
+ void ClearStartTimes() { node_states_.clear(); }
void SetStartTimes(size_t node_index, const UUID &boot_uuid,
monotonic_clock::time_point monotonic_start_time,
diff --git a/aos/events/logging/log_reader.h b/aos/events/logging/log_reader.h
index 196ac53..c1333c6 100644
--- a/aos/events/logging/log_reader.h
+++ b/aos/events/logging/log_reader.h
@@ -349,9 +349,8 @@
// Sets the node event loop factory for replaying into a
// SimulatedEventLoopFactory. Returns the EventLoop to use.
- void SetNodeEventLoopFactory(
- NodeEventLoopFactory *node_event_loop_factory,
- SimulatedEventLoopFactory *event_loop_factory);
+ void SetNodeEventLoopFactory(NodeEventLoopFactory *node_event_loop_factory,
+ SimulatedEventLoopFactory *event_loop_factory);
// Sets and gets the event loop to use.
void set_event_loop(EventLoop *event_loop) { event_loop_ = event_loop; }
diff --git a/aos/events/logging/log_stats.cc b/aos/events/logging/log_stats.cc
index cf11fa6..7c3511d 100644
--- a/aos/events/logging/log_stats.cc
+++ b/aos/events/logging/log_stats.cc
@@ -301,8 +301,7 @@
<< "hz max";
}
std::cout << " " << channel_stats[i].avg_message_size()
- << " bytes avg, "
- << channel_stats[i].avg_message_bandwidth()
+ << " bytes avg, " << channel_stats[i].avg_message_bandwidth()
<< " bytes/sec avg, " << channel_stats[i].max_message_size()
<< " bytes max / " << channel_stats[i].channel()->max_size()
<< "bytes " << channel_stats[i].Percentile();
diff --git a/aos/events/logging/log_writer.h b/aos/events/logging/log_writer.h
index 23ab349..c364d36 100644
--- a/aos/events/logging/log_writer.h
+++ b/aos/events/logging/log_writer.h
@@ -135,8 +135,9 @@
// Restart logging using a new naming scheme. Intended for log rotation.
// Returns a unique_ptr to the prior log_namer instance.
- std::unique_ptr<LogNamer> RestartLogging(std::unique_ptr<LogNamer> log_namer,
- std::optional<UUID> log_start_uuid = std::nullopt);
+ std::unique_ptr<LogNamer> RestartLogging(
+ std::unique_ptr<LogNamer> log_namer,
+ std::optional<UUID> log_start_uuid = std::nullopt);
// Moves the current log location to the new name. Returns true if a change
// was made, false otherwise.
@@ -227,7 +228,7 @@
std::vector<int> event_loop_to_logged_channel_index_;
// Start/Restart write configuration into LogNamer space.
- std::string WriteConfiguration(LogNamer* log_namer);
+ std::string WriteConfiguration(LogNamer *log_namer);
void WriteHeader(aos::monotonic_clock::time_point monotonic_start_time =
aos::monotonic_clock::min_time,
@@ -249,7 +250,8 @@
void WriteMissingTimestamps();
void WriteData(NewDataWriter *writer, const FetcherStruct &f);
- void WriteTimestamps(NewDataWriter *timestamps_writer, const FetcherStruct &f);
+ void WriteTimestamps(NewDataWriter *timestamps_writer,
+ const FetcherStruct &f);
void WriteContent(NewDataWriter *contents_writer, const FetcherStruct &f);
void WriteFetchedRecord(FetcherStruct &f);
diff --git a/aos/events/logging/logfile_utils.cc b/aos/events/logging/logfile_utils.cc
index ecdf5d6..01f3002 100644
--- a/aos/events/logging/logfile_utils.cc
+++ b/aos/events/logging/logfile_utils.cc
@@ -558,8 +558,8 @@
}
if (span_reader_.IsIncomplete()) {
- LOG(ERROR) << "Unable to access some messages in " << filename()
- << " : " << span_reader_.TotalRead() << " bytes read, "
+ LOG(ERROR) << "Unable to access some messages in " << filename() << " : "
+ << span_reader_.TotalRead() << " bytes read, "
<< span_reader_.TotalConsumed() << " bytes usable."
<< std::endl;
}
@@ -570,15 +570,14 @@
if (crash_on_corrupt_message_flag_) {
CHECK(msg.Verify()) << "Corrupted message at offset "
- << total_verified_before_
- << " found within " << filename()
+ << total_verified_before_ << " found within "
+ << filename()
<< "; set --nocrash_on_corrupt_message to see summary;"
<< " also set --ignore_corrupt_messages to process"
<< " anyway";
} else if (!msg.Verify()) {
- LOG(ERROR) << "Corrupted message at offset "
- << total_verified_before_
+ LOG(ERROR) << "Corrupted message at offset " << total_verified_before_
<< " from " << filename() << std::endl;
total_corrupted_ += msg_data.size();
@@ -922,14 +921,13 @@
size_t monotonic_remote_boot = 0xffffff;
if (m->monotonic_remote_time.has_value()) {
- const Node *node = parts().config->nodes()->Get(
- source_node_index_[m->channel_index]);
+ const Node *node =
+ parts().config->nodes()->Get(source_node_index_[m->channel_index]);
std::optional<size_t> boot = parts_message_reader_.boot_count(
source_node_index_[m->channel_index]);
CHECK(boot) << ": Failed to find boot for node " << MaybeNodeName(node)
- << ", with index "
- << source_node_index_[m->channel_index];
+ << ", with index " << source_node_index_[m->channel_index];
monotonic_remote_boot = *boot;
}
@@ -1242,16 +1240,16 @@
}
void TimestampMapper::QueueMessage(Message *m) {
- matched_messages_.emplace_back(TimestampedMessage{
- .channel_index = m->channel_index,
- .queue_index = m->queue_index,
- .monotonic_event_time = m->timestamp,
- .realtime_event_time = m->data->realtime_sent_time,
- .remote_queue_index = BootQueueIndex::Invalid(),
- .monotonic_remote_time = BootTimestamp::min_time(),
- .realtime_remote_time = realtime_clock::min_time,
- .monotonic_timestamp_time = BootTimestamp::min_time(),
- .data = std::move(m->data)});
+ matched_messages_.emplace_back(
+ TimestampedMessage{.channel_index = m->channel_index,
+ .queue_index = m->queue_index,
+ .monotonic_event_time = m->timestamp,
+ .realtime_event_time = m->data->realtime_sent_time,
+ .remote_queue_index = BootQueueIndex::Invalid(),
+ .monotonic_remote_time = BootTimestamp::min_time(),
+ .realtime_remote_time = realtime_clock::min_time,
+ .monotonic_timestamp_time = BootTimestamp::min_time(),
+ .data = std::move(m->data)});
}
TimestampedMessage *TimestampMapper::Front() {
@@ -1448,13 +1446,12 @@
if (remote_queue_index < data_queue->front().queue_index ||
remote_queue_index > data_queue->back().queue_index) {
- return Message{
- .channel_index = message.channel_index,
- .queue_index = remote_queue_index,
- .timestamp = monotonic_remote_time,
- .monotonic_remote_boot = 0xffffff,
- .monotonic_timestamp_boot = 0xffffff,
- .data = nullptr};
+ return Message{.channel_index = message.channel_index,
+ .queue_index = remote_queue_index,
+ .timestamp = monotonic_remote_time,
+ .monotonic_remote_boot = 0xffffff,
+ .monotonic_timestamp_boot = 0xffffff,
+ .data = nullptr};
}
// The algorithm below is constant time with some assumptions. We need there
diff --git a/aos/events/logging/logfile_utils.h b/aos/events/logging/logfile_utils.h
index 41d4a9a..ca733d4 100644
--- a/aos/events/logging/logfile_utils.h
+++ b/aos/events/logging/logfile_utils.h
@@ -208,8 +208,9 @@
size_t TotalRead() const { return total_read_; }
size_t TotalConsumed() const { return total_consumed_; }
- bool IsIncomplete() const { return is_finished_
- && total_consumed_ < total_read_; }
+ bool IsIncomplete() const {
+ return is_finished_ && total_consumed_ < total_read_;
+ }
// Returns a span with the data for the next message from the log file,
// including the size. The result is only guarenteed to be valid until
@@ -630,7 +631,8 @@
realtime_clock::time_point realtime_start_time_ = realtime_clock::max_time;
monotonic_clock::time_point monotonic_start_time_ = monotonic_clock::max_time;
- monotonic_clock::time_point monotonic_oldest_time_ = monotonic_clock::max_time;
+ monotonic_clock::time_point monotonic_oldest_time_ =
+ monotonic_clock::max_time;
};
// Class to concatenate multiple boots worth of logs into a single per-node
diff --git a/aos/events/logging/logfile_utils_out_of_space_test_runner.cc b/aos/events/logging/logfile_utils_out_of_space_test_runner.cc
index 3010a6f..b08bebb 100644
--- a/aos/events/logging/logfile_utils_out_of_space_test_runner.cc
+++ b/aos/events/logging/logfile_utils_out_of_space_test_runner.cc
@@ -2,11 +2,10 @@
#include <array>
-#include "gflags/gflags.h"
-#include "glog/logging.h"
-
#include "aos/events/logging/logfile_utils.h"
#include "aos/init.h"
+#include "gflags/gflags.h"
+#include "glog/logging.h"
DECLARE_int32(flush_size);
DEFINE_string(tmpfs, "", "tmpfs with the desired size");
diff --git a/aos/events/logging/lzma_encoder.h b/aos/events/logging/lzma_encoder.h
index 7b7010a..4edd0e8 100644
--- a/aos/events/logging/lzma_encoder.h
+++ b/aos/events/logging/lzma_encoder.h
@@ -1,9 +1,9 @@
#ifndef AOS_EVENTS_LOGGING_LZMA_ENCODER_H_
#define AOS_EVENTS_LOGGING_LZMA_ENCODER_H_
-#include <string_view>
#include <condition_variable>
#include <mutex>
+#include <string_view>
#include <thread>
#include "absl/types/span.h"