iwyu: //aos/util/...

The full include-list for aos/util/threaded_consumer.h:
<functional>                    // for function
<optional>                      // for optional
<thread>                        // for thread
"aos/condition.h"               // for Condition
"aos/containers/ring_buffer.h"  // for RingBuffer
"aos/mutex/mutex.h"             // for MutexLocker, Mutex
"aos/realtime.h"                // for SetCurrentThreadRealtimePriority, UnsetCurrentThreadRealtimePriority
"glog/logging.h"                // for CHECK, COMPACT_GOOGLE_LOG_FATAL, LogMessageFatal

The full include-list for aos/util/threaded_consumer_test.cc:
"aos/util/threaded_consumer.h"
<atomic>            // for atomic, __atomic_base
<chrono>            // for milliseconds
<initializer_list>  // for initializer_list
<memory>            // for allocator
<ostream>           // for char_traits, basic_ostream::operator<<, operator<<, basic_ostream
"gtest/gtest.h"     // for Test, AssertionResult, Message, TestPartResult, TestInfo, EXPECT_TRUE, TEST, EXPECT_EQ, EXPECT_FALSE

The full include-list for aos/util/log_to_mcap.cc:
<algorithm>                             // for copy
<memory>                                // for unique_ptr, allocator, make_unique
<optional>                              // for optional
<ostream>                               // for operator<<, basic_ostream
<set>                                   // for set, _Rb_tree_const_iterator
<string>                                // for char_traits, operator<<, operator==, string, basic_string
<vector>                                // for vector
"aos/configuration.h"                   // for GetNode, Configuration, AddChannelToConfiguration, MultiNode, Node
"aos/events/event_loop.h"               // for EventLoop
"aos/events/logging/log_reader.h"       // for LogReader
"aos/events/logging/logfile_sorting.h"  // for LogFile, FindLogs, LoggerNodes, SortParts
"aos/events/simulated_event_loop.h"     // for SimulatedEventLoopFactory, NodeEventLoopFactory
"aos/flatbuffers.h"                     // for FlatbufferDetachedBuffer, FlatbufferSpan
"aos/init.h"                            // for InitGoogle
"aos/util/clock_publisher.h"            // for ClockPublisher
"aos/util/clock_timepoints_schema.h"    // for ClockTimepointsSchema
"aos/util/mcap_logger.h"                // for McapLogger
"flatbuffers/reflection_generated.h"    // for Schema
"gflags/gflags.h"                       // for DEFINE_bool, DEFINE_string
"glog/logging.h"                        // for CHECK, COMPACT_GOOGLE_LOG_FATAL, Check_LTImpl, LogMessageFatal, LOG, LogMessage, CHECK_LT, COMPACT_GOOGLE_LOG_ERROR, COMPACT_GOOGLE_LOG_INFO

The full include-list for aos/util/threaded_queue_test.cc:
"aos/util/threaded_queue.h"
<atomic>         // for atomic, __atomic_base
<memory>         // for allocator
<utility>        // for move
"gtest/gtest.h"  // for Test, Message, TestPartResult, ASSERT_EQ, CmpHelperGE, TestInfo, CmpHelperLT, TEST, ASSERT_GE, ASSERT_LT

The full include-list for aos/util/mcap_logger.h:
<stddef.h>                       // for size_t
<stdint.h>                       // for uint64_t, uint16_t, uint32_t, uint8_t
<iosfwd>                         // for ofstream, ostream, stringstream
<map>                            // for map
<memory>                         // for unique_ptr
<optional>                       // for optional
<string>                         // for string
<string_view>                    // for string_view
<utility>                        // for pair
<vector>                         // for vector
"aos/configuration_generated.h"  // for Channel, Configuration, Node
"aos/events/context.h"           // for Context
"aos/events/event_loop.h"        // for EventLoop, RawFetcher
"aos/fast_string_builder.h"      // for FastStringBuilder
"aos/flatbuffer_utils.h"         // for FlatbufferType
"aos/flatbuffers.h"              // for FlatbufferDetachedBuffer
"aos/time/time.h"                // for monotonic_clock
"nlohmann/json_fwd.hpp"          // for json

The full include-list for aos/util/mcap_logger_test.cc:
"aos/util/mcap_logger.h"
"flatbuffers/reflection_generated.h"  // for Schema
"gtest/gtest.h"                       // for Test, TestInfo, EXPECT_EQ, Message, TEST, TestPartResult
"nlohmann/json.hpp"                   // for basic_json

The full include-list for aos/util/trapezoid_profile.h:
<chrono>        // for nanoseconds
"Eigen/Core"    // for StorageOptions, outer_stride_at_compile_time<>::ret, inner_stride_at_compile_time<>::ret, traits<>::Flags, DirectionType, DenseBase<>::ColsAtCompileTime, AccessorLevels, DenseBase<>::RowsAtCompileTime, is_arithmetic<>::value, DenseBase<>::IsRowMajor, traits<>::ColsAtCompileTime, traits<>::RowsAtCompileTime, TraversalType, AlignmentType, accessors_level<>::value, traits<>::MaxColsAtCompileTime, traits<>::MaxRowsAtCompileTime, GenericNumTraits<>::IsComplex, is_const<>::value, is_same<>::value, DenseBase<>::SizeAtCompileTime, UnrollingType, unpacket_traits<>::alignment, Matrix, ComparisonName, DenseBase<>::MaxColsAtCompileTime, DenseBase<>::MaxRowsAtCompileTime, DenseBase<>::MaxSizeAtCompileTime, packet_traits<>::Vectorizable, DenseBase<>::IsVectorAtCompileTime, compute_default_alignment<>::value, compute_matrix_flags<>::ret, size_at_compile_time<>::ret, evaluator<>::CoeffReadCost, evaluator<>::Flags, unpacket_traits<>::size, DenseBase<>::InnerSizeAtCompileTime, DenseCoeffsBase, GenericNumTraits<>::ReadCost, evaluator<>::Alignment, size_of_xpr_at_compile_time<>::ret, functor_traits<>::PacketAccess, has_ReturnType<>::value, is_lvalue<>::value
"aos/macros.h"  // for DISALLOW_COPY_AND_ASSIGN

The full include-list for aos/util/trapezoid_profile_test.cc:
"aos/util/trapezoid_profile.h"
<compare>        // for operator>, strong_ordering
<cstdlib>        // for abs
<memory>         // for allocator
<ratio>          // for ratio
"Eigen/Dense"
"gtest/gtest.h"  // for AssertionResult, Message, TestPartResult, EXPECT_TRUE, TestInfo, TEST_F, AssertionFailure, AssertionSuccess, EXPECT_EQ, EXPECT_NEAR, ASSERT_EQ, EXPECT_FALSE, Test

The full include-list for aos/util/foxglove_websocket.cc:
<string>                             // for allocator, operator==, char_traits, basic_string
"aos/configuration.h"                // for ReadConfig, Configuration
"aos/events/shm_event_loop.h"        // for ShmEventLoop
"aos/flatbuffers.h"                  // for FlatbufferDetachedBuffer
"aos/init.h"                         // for InitGoogle
"aos/util/foxglove_websocket_lib.h"  // for FoxgloveWebsocketServer
"gflags/gflags.h"                    // for SetUsageMessage, DEFINE_bool, DEFINE_string, DEFINE_uint32

The full include-list for aos/util/scoped_pipe.h:
<stddef.h>           // for size_t
<stdint.h>           // for uint32_t, uint8_t
<memory>             // for unique_ptr
<optional>           // for optional
<string>             // for string
"absl/types/span.h"  // for Span
namespace aos::util { class ScopedPipe::ScopedReadPipe; }  // lines 16-16
namespace aos::util { class ScopedPipe::ScopedWritePipe; }  // lines 17-17

The full include-list for aos/util/scoped_pipe_test.cc:
"aos/util/scoped_pipe.h"
<fcntl.h>        // for fcntl, FD_CLOEXEC, F_GETFD
<algorithm>      // for fill_n
<array>          // for array
<string>         // for string
"gtest/gtest.h"  // for Test, Message, AssertionResult, TestPartResult, ASSERT_EQ, TestInfo, TEST, CmpHelperNE, ASSERT_TRUE, ASSERT_FALSE, ASSERT_NE

The full include-list for aos/util/foxglove_websocket_lib.h:
<stdint.h>                       // for uint32_t
<map>                            // for map
<memory>                         // for unique_ptr
<set>                            // for set
"aos/events/event_loop.h"        // for RawFetcher, EventLoop
"foxglove/websocket/server.hpp"  // for ChannelId, Server

The full include-list for aos/util/foxglove_websocket_lib.cc:
"aos/util/foxglove_websocket_lib.h"
<chrono>                              // for operator<=>, operator-, operator/, duration, milliseconds, time_point
<compare>                             // for operator<=, strong_ordering
<foxglove/websocket/server.hpp>       // for Server, ChannelWithoutId
<string>                              // for operator+, char_traits, basic_string, string
<utility>                             // for pair, make_pair
"absl/container/btree_set.h"          // for btree_set, btree_iterator
"absl/strings/escaping.h"             // for Base64Escape
"absl/types/span.h"                   // for Span
"aos/configuration.h"                 // for Channel, ChannelIsReadableOnNode, ReadMethod, Configuration
"aos/events/context.h"                // for Context
"aos/flatbuffer_merge.h"              // for RecursiveCopyFlatBuffer
"aos/flatbuffers.h"                   // for FlatbufferDetachedBuffer
"aos/json_to_flatbuffer.h"            // for FlatbufferToJson
"aos/time/time.h"                     // for monotonic_clock
"aos/util/mcap_logger.h"              // for JsonSchemaForFlatbuffer, ShortenedChannelName
"flatbuffers/reflection_generated.h"  // for Schema
"flatbuffers/string.h"                // for String
"flatbuffers/vector.h"                // for Vector, VectorIterator
"gflags/gflags.h"                     // for DEFINE_uint32
"glog/logging.h"                      // for CHECK, COMPACT_GOOGLE_LOG_FATAL, LogMessageFatal
"nlohmann/json.hpp"                   // for basic_json

The full include-list for aos/util/simulation_logger.h:
<memory>                             // for unique_ptr
<string>                             // for string
<string_view>                        // for string_view
<vector>                             // for vector
"aos/configuration_generated.h"      // for Node
"aos/events/event_loop.h"            // for EventLoop
"aos/events/logging/log_namer.h"     // for LogNamer
"aos/events/logging/log_writer.h"    // for Logger
"aos/events/simulated_event_loop.h"  // for SimulatedEventLoopFactory

The full include-list for aos/util/simulation_logger.cc:
"aos/util/simulation_logger.h"
<algorithm>                           // for max
<chrono>                              // for operator*
<utility>                             // for move
"absl/strings/str_cat.h"              // for StrCat
"aos/configuration.h"                 // for GetNode, GetNodes, Node
"aos/events/logging/logfile_utils.h"  // for MaybeNodeName
"aos/time/time.h"                     // for monotonic_clock

The full include-list for aos/util/wrapping_counter_test.cc:
"aos/util/wrapping_counter.h"
<memory>         // for allocator
"gtest/gtest.h"  // for Test, EXPECT_EQ, Message, TestPartResult, TestInfo, TEST

The full include-list for aos/util/file.h:
<stdint.h>                // for uint8_t, int32_t
<sys/stat.h>              // for mode_t, S_IRWXU
<sys/types.h>             // for mode_t, size_t
<array>                   // for array
<memory>                  // for shared_ptr
<optional>                // for optional, nullopt
<string>                  // for string
<string_view>             // for string_view
<vector>                  // for vector
"absl/types/span.h"       // for Span
"aos/scoped/scoped_fd.h"  // for ScopedFD
"glog/logging.h"          // for CHECK, COMPACT_GOOGLE_LOG_FATAL, LogMessageFatal

The full include-list for aos/util/file.cc:
"aos/util/file.h"
<errno.h>                 // for errno, EEXIST, ENOSPC, EREMOTEIO
<fcntl.h>                 // for open, O_RDONLY, O_CREAT, O_RDWR, O_TRUNC, O_WRONLY
<fts.h>                   // for fts_close, fts_open, fts_read, FTS, FTSENT, FTS_D, FTS_DC, FTS_DEFAULT, FTS_DNR, FTS_DOT, FTS_DP, FTS_ERR, FTS_F, FTS_NOCHDIR, FTS_NS, FTS_NSOK, FTS_PHYSICAL, FTS_SL, FTS_SLNONE, FTS_XDEV
<stdio.h>                 // for remove, SEEK_SET
<string.h>                // for strerror
<sys/mman.h>              // for mmap, msync, munmap, PROT_READ, MAP_FAILED, MAP_SHARED, MS_SYNC, PROT_WRITE
<sys/stat.h>              // for stat, fstat, mkdir
<sys/types.h>             // for ssize_t, mode_t, size_t
<unistd.h>                // for read, NULL, close, lseek, write
<algorithm>               // for copy
<iterator>                // for back_insert_iterator, back_inserter
<optional>                // for optional, nullopt
<ostream>                 // for operator<<, basic_ostream
<string_view>             // for operator<<, string_view
"aos/scoped/scoped_fd.h"  // for ScopedFD
"flatbuffers/util.h"      // for StringToNumber

The full include-list for aos/util/scoped_pipe.h:
<stddef.h>           // for size_t
<stdint.h>           // for uint32_t, uint8_t
<memory>             // for unique_ptr
<optional>           // for optional
<string>             // for string
"absl/types/span.h"  // for Span
namespace aos::util { class ScopedPipe::ScopedReadPipe; }  // lines 16-16
namespace aos::util { class ScopedPipe::ScopedWritePipe; }  // lines 17-17

The full include-list for aos/util/scoped_pipe.cc:
"aos/util/scoped_pipe.h"
<errno.h>         // for errno, EAGAIN, EWOULDBLOCK
<fcntl.h>         // for fcntl, F_GETFL, F_SETFL, O_NONBLOCK, FD_CLOEXEC, F_GETFD, F_SETFD
<unistd.h>        // for close, read, write, size_t, ssize_t, pipe
<ostream>         // for operator<<
"glog/logging.h"  // for ErrnoLogMessage, Check_EQImpl, PCHECK, CHECK_EQ, CheckNotNull, CHECK_NOTNULL, PLOG

The full include-list for aos/util/clock_publisher.h:
"aos/events/event_loop.h"                // for EventLoop, Sender
"aos/events/simulated_event_loop.h"      // for SimulatedEventLoopFactory
"aos/util/clock_timepoints_generated.h"  // for ClockTimepoints

The full include-list for aos/util/clock_publisher.cc:
"aos/util/clock_publisher.h"
<algorithm>                         // for max
<chrono>                            // for duration, seconds
<vector>                            // for vector
"aos/configuration_generated.h"     // for Node
"aos/events/context.h"              // for Context
"flatbuffers/buffer.h"              // for Offset, AlignOf
"flatbuffers/flatbuffer_builder.h"  // for FlatBufferBuilder
"flatbuffers/string.h"              // for String
"flatbuffers/vector.h"              // for Vector

The full include-list for aos/util/error_counter.h:
<stddef.h>                          // for size_t
<array>                             // for array
"flatbuffers/buffer.h"              // for Offset
"flatbuffers/flatbuffer_builder.h"  // for FlatBufferBuilder, GetMutableTemporaryPointer
"flatbuffers/vector.h"              // for Vector
"glog/logging.h"                    // for CHECK_NOTNULL, DCHECK_LT, CHECK, COMPACT_GOOGLE_LOG_FATAL, DCHECK_EQ, LogMessageFatal

The full include-list for aos/util/error_counter_test.cc:
"aos/util/error_counter.h"
<algorithm>                          // for fill_n
<memory>                             // for allocator
"aos/events/event_loop_generated.h"  // for SendError, Sender, SendErrorCount
"aos/flatbuffers.h"                  // for FlatbufferDetachedBuffer
"gtest/gtest.h"                      // for Test, Message, TestPartResult, EXPECT_EQ, TestInfo, ASSERT_EQ, TEST

The full include-list for aos/util/top.h:
<stdint.h>                           // for uint64_t, int64_t
<sys/types.h>                        // for pid_t
<chrono>                             // for nanoseconds, duration, time_point, seconds
<functional>                         // for function
<map>                                // for map
<optional>                           // for optional, nullopt
<set>                                // for set
<string>                             // for string
<utility>                            // for move
"aos/containers/ring_buffer.h"       // for RingBuffer
"aos/events/event_loop.h"            // for EventLoop
"aos/time/time.h"                    // for monotonic_clock
"aos/util/process_info_generated.h"  // for ProcessInfo, ThreadState, TopProcessesFbs
"flatbuffers/buffer.h"               // for Offset
"flatbuffers/flatbuffer_builder.h"   // for FlatBufferBuilder

The full include-list for aos/util/top.cc:
"aos/util/top.h"
<dirent.h>                   // for closedir, opendir, readdir, dirent, DIR, DT_DIR
<errno.h>                    // for errno
<unistd.h>                   // for pid_t, sysconf, size_t, _SC_CLK_TCK, _SC_PAGESIZE
<algorithm>                  // for max
<array>                      // for array
<atomic>                     // for atomic
<cstring>                    // for strcmp, strerror
<istream>                    // for operator<<, basic_ostream, basic_ostream::operator<<, basic_istream::read, ifstream, ios_base
<queue>                      // for priority_queue
<ratio>                      // for ratio
<string>                     // for char_traits, string, operator<<, basic_string, operator==, to_string
<string_view>                // for operator<<, string_view, basic_string_view
<vector>                     // for vector
"absl/numeric/int128.h"      // for int128
"absl/strings/numbers.h"     // for SimpleAtoi
"absl/strings/str_cat.h"     // for StrCat
"absl/strings/str_format.h"  // for StrFormat
"absl/strings/str_split.h"   // for SkipWhitespace, StrSplit, Splitter
"flatbuffers/string.h"       // for String
"flatbuffers/vector.h"       // for Vector
"glog/logging.h"             // for LogMessage, COMPACT_GOOGLE_LOG_INFO, VLOG, LOG, COMPACT_GOOGLE_LOG_FATAL, COMPACT_GOOGLE_LOG_WARNING, ErrnoLogMessage, LOG_EVERY_T, LogMessageFatal, PLOG

The full include-list for aos/util/options.h:

The full include-list for aos/util/options_test.cc:
"aos/util/options.h"
<memory>         // for allocator
"gtest/gtest.h"  // for AssertionResult, Message, TestPartResult, EXPECT_FALSE, EXPECT_TRUE, TestInfo, TEST_F, Test

The full include-list for aos/util/math.h:
<cmath>       // for M_PI
"Eigen/Core"  // for Matrix, Ref

The full include-list for aos/util/math_test.cc:
"aos/util/math.h"
<memory>         // for allocator
"gtest/gtest.h"  // for AssertionResult, Test, Message, TestPartResult, EXPECT_FALSE, TestInfo, AssertPred1Helper, AssertPred2Helper, TEST, EXPECT_TRUE, EXPECT_PRED1, EXPECT_PRED2

The full include-list for aos/util/mcap_logger.h:
<stddef.h>                       // for size_t
<stdint.h>                       // for uint64_t, uint16_t, uint32_t, uint8_t
<iosfwd>                         // for ofstream, ostream, stringstream
<map>                            // for map
<memory>                         // for unique_ptr
<optional>                       // for optional
<string>                         // for string
<string_view>                    // for string_view
<utility>                        // for pair
<vector>                         // for vector
"aos/configuration_generated.h"  // for Channel, Configuration, Node
"aos/events/context.h"           // for Context
"aos/events/event_loop.h"        // for RawFetcher, EventLoop
"aos/fast_string_builder.h"      // for FastStringBuilder
"aos/flatbuffer_utils.h"         // for FlatbufferType
"aos/flatbuffers.h"              // for FlatbufferDetachedBuffer
"aos/time/time.h"                // for monotonic_clock
"nlohmann/json_fwd.hpp"          // for json

The full include-list for aos/util/mcap_logger.cc:
"aos/util/mcap_logger.h"
<algorithm>                           // for max, min, sort, fill_n
<chrono>                              // for time_point, duration, operator<=>
<numeric>                             // for accumulate
<ostream>                             // for operator<<, basic_ostream, basic_ostream::tellp, basic_ostream::put, basic_ostream::write, ostream
<set>                                 // for set
"absl/strings/str_cat.h"              // for StrCat
"absl/types/span.h"                   // for Span
"aos/configuration.h"                 // for ChannelIsReadableOnNode, GetChannelAliases, StrippedChannelToString
"aos/configuration_schema.h"          // for ConfigurationSchema
"aos/flatbuffer_merge.h"              // for CopyFlatBuffer, RecursiveCopyFlatBuffer
"aos/json_to_flatbuffer.h"            // for FlatbufferToJson
"flatbuffers/buffer.h"                // for Offset
"flatbuffers/detached_buffer.h"       // for DetachedBuffer
"flatbuffers/flatbuffer_builder.h"    // for FlatBufferBuilder
"flatbuffers/reflection.h"            // for Verify
"flatbuffers/reflection_generated.h"  // for Schema
"flatbuffers/string.h"                // for String
"flatbuffers/vector.h"                // for Vector, VectorIterator
"gflags/gflags.h"                     // for DEFINE_bool, DEFINE_uint64
"glog/logging.h"                      // for COMPACT_GOOGLE_LOG_FATAL, LogMessageFatal, CHECK, LOG, COMPACT_GOOGLE_LOG_INFO, CheckNotNull, Check_NEImpl, LogMessage, CHECK_NE, CHECK_NOTNULL, VLOG
"glog/vlog_is_on.h"                   // for VLOG_IS_ON
"lz4/lz4frame.h"                      // for LZ4F_compressFrame, LZ4F_compressFrameBound, LZ4F_isError, LZ4F_preferences_t
"nlohmann/json.hpp"                   // for basic_json

The full include-list for aos/util/filesystem_monitor.cc:
<stddef.h>                          // for size_t
<sys/statvfs.h>                     // for statvfs
<algorithm>                         // for max
<chrono>                            // for seconds
<istream>                           // for operator<<, basic_ostream, basic_istream::read, ifstream, ios_base
<optional>                          // for optional, nullopt
<string>                            // for char_traits, string, operator<<, basic_string
<string_view>                       // for operator==, basic_string_view, operator<<, string_view
<vector>                            // for vector
"absl/strings/str_split.h"          // for SkipWhitespace, StrSplit, Splitter, operator!=, SplitIterator
"aos/configuration.h"               // for ReadConfig, Configuration
"aos/events/event_loop.h"           // for EventLoop, Sender, TimerHandler, Sender::MakeBuilder
"aos/events/shm_event_loop.h"       // for ShmEventLoop
"aos/flatbuffers.h"                 // for FlatbufferDetachedBuffer
"aos/init.h"                        // for InitGoogle
"aos/util/filesystem_generated.h"   // for FilesystemStatus, Filesystem
"flatbuffers/buffer.h"              // for Offset, AlignOf
"flatbuffers/flatbuffer_builder.h"  // for FlatBufferBuilder
"flatbuffers/string.h"              // for String
"flatbuffers/vector.h"              // for Vector
"gflags/gflags.h"                   // for DEFINE_string
"glog/logging.h"                    // for COMPACT_GOOGLE_LOG_INFO, Check_LTImpl, LogMessage, VLOG, CHECK, CHECK_LT, COMPACT_GOOGLE_LOG_FATAL, ErrnoLogMessage, LogMessageFatal, PCHECK

The full include-list for aos/util/file.h:
<stdint.h>                // for uint8_t, int32_t
<sys/stat.h>              // for mode_t, S_IRWXU
<sys/types.h>             // for mode_t, size_t
<array>                   // for array
<memory>                  // for shared_ptr
<optional>                // for optional, nullopt
<string>                  // for string
<string_view>             // for string_view
<vector>                  // for vector
"absl/types/span.h"       // for Span
"aos/scoped/scoped_fd.h"  // for ScopedFD
"glog/logging.h"          // for CHECK, COMPACT_GOOGLE_LOG_FATAL, LogMessageFatal

The full include-list for aos/util/file_test.cc:
"aos/util/file.h"
<unistd.h>              // for getpid, close, unlink
<cstdlib>               // for system
<optional>              // for optional
<string>                // for operator+, string, basic_string, to_string, char_traits
"aos/realtime.h"        // for ScopedRealtime
"aos/testing/tmpdir.h"  // for TestTmpDir
"gmock/gmock.h"         // for ElementsAre, MakePredicateFormatterFromMatcher, EXPECT_THAT
"gtest/gtest.h"         // for Test, AssertionResult, Message, TestPartResult, TestInfo, EXPECT_EQ, TEST, ASSERT_EQ, ASSERT_TRUE, ASSERT_FALSE, EXPECT_FALSE, EXPECT_TRUE

The full include-list for aos/util/top.h:
<stdint.h>                           // for uint64_t, int64_t
<sys/types.h>                        // for pid_t
<chrono>                             // for nanoseconds, seconds
<functional>                         // for function
<map>                                // for map
<optional>                           // for optional, nullopt
<set>                                // for set
<string>                             // for string
<utility>                            // for move
"aos/containers/ring_buffer.h"       // for RingBuffer
"aos/events/event_loop.h"            // for EventLoop
"aos/time/time.h"                    // for monotonic_clock
"aos/util/process_info_generated.h"  // for ProcessInfo, ThreadState, TopProcessesFbs
"flatbuffers/buffer.h"               // for Offset
"flatbuffers/flatbuffer_builder.h"   // for FlatBufferBuilder

The full include-list for aos/util/top_test.cc:
"aos/util/top.h"
<pthread.h>                    // for pthread_self, pthread_setname_np
<signal.h>                     // for kill, SIGINT
<unistd.h>                     // for getpid, pid_t, fork
<algorithm>                    // for max
<atomic>                       // for atomic
<limits>                       // for numeric_limits
<ostream>                      // for operator<<
<string>                       // for allocator, string, operator+, operator<<
<string_view>                  // for operator<=>, string_view
<thread>                       // for thread
<vector>                       // for vector
"aos/configuration.h"          // for ReadConfig, Configuration
"aos/events/shm_event_loop.h"  // for ShmEventLoop
"aos/flatbuffers.h"            // for FlatbufferDetachedBuffer
"aos/ipc_lib/shm_base.h"       // for FLAGS_shm_base
"aos/json_to_flatbuffer.h"     // for FlatbufferToJson
"aos/testing/path.h"           // for ArtifactPath
"aos/testing/tmpdir.h"         // for TestTmpDir
"aos/util/file.h"              // for UnlinkRecursive
"flatbuffers/string.h"         // for String
"flatbuffers/vector.h"         // for Vector, VectorIterator
"gflags/gflags.h"              // for FlagSaver
"glog/logging.h"               // for LOG, COMPACT_GOOGLE_LOG_INFO, LogMessage, CHECK_NE, COMPACT_GOOGLE_LOG_FATAL, ErrnoLogMessage, LogMessageFatal, PCHECK
"gmock/gmock.h"                // for Contains, MakePredicateFormatterFromMatcher, ASSERT_THAT
"gtest/gtest.h"                // for AssertionResult, Message, TestPartResult, CmpHelperGT, CmpHelperLT, ASSERT_EQ, TestInfo, CmpHelperLE, ASSERT_GT, ASSERT_LT, ASSERT_TRUE, CmpHelperGE, TEST_F, ASSERT_LE, ASSERT_GE, SCOPED_TRACE, ASSERT_FALSE, Test

The full include-list for aos/util/phased_loop.h:
<chrono>           // for operator-
<optional>         // for optional, nullopt
"aos/time/time.h"  // for monotonic_clock, sleep_until

The full include-list for aos/util/phased_loop.cc:
"aos/util/phased_loop.h"
<compare>         // for operator>, operator>=, strong_ordering, operator<, operator<=
<ratio>           // for ratio
"glog/logging.h"  // for CHECK, COMPACT_GOOGLE_LOG_FATAL, LogMessageFatal, Check_EQImpl, CHECK_EQ

The full include-list for aos/util/global_factory.h:
<functional>     // for function
<memory>         // for unique_ptr
<string>         // for string
<unordered_map>  // for unordered_map
<utility>        // for forward
namespace aos { template <typename BaseClass, typename ...FactoryArgs> class GlobalFactory; }
namespace aos { template <typename SubClass> class GlobalFactory::SubClassRegisterer; }
namespace aos { template <typename SubClass> class GlobalFactory::SubClassRegisterer; }

The full include-list for aos/util/trapezoid_profile.h:
<chrono>        // for nanoseconds
"Eigen/Core"    // for StorageOptions, outer_stride_at_compile_time<>::ret, inner_stride_at_compile_time<>::ret, traits<>::Flags, DirectionType, DenseBase<>::ColsAtCompileTime, AccessorLevels, DenseBase<>::RowsAtCompileTime, is_arithmetic<>::value, DenseBase<>::IsRowMajor, traits<>::ColsAtCompileTime, traits<>::RowsAtCompileTime, TraversalType, AlignmentType, accessors_level<>::value, traits<>::MaxColsAtCompileTime, traits<>::MaxRowsAtCompileTime, GenericNumTraits<>::IsComplex, is_const<>::value, is_same<>::value, DenseBase<>::SizeAtCompileTime, UnrollingType, unpacket_traits<>::alignment, Matrix, ComparisonName, DenseBase<>::MaxColsAtCompileTime, DenseBase<>::MaxRowsAtCompileTime, DenseBase<>::MaxSizeAtCompileTime, packet_traits<>::Vectorizable, DenseBase<>::IsVectorAtCompileTime, compute_default_alignment<>::value, compute_matrix_flags<>::ret, size_at_compile_time<>::ret, evaluator<>::CoeffReadCost, evaluator<>::Flags, unpacket_traits<>::size, DenseBase<>::InnerSizeAtCompileTime, DenseCoeffsBase, GenericNumTraits<>::ReadCost, evaluator<>::Alignment, size_of_xpr_at_compile_time<>::ret, functor_traits<>::PacketAccess, has_ReturnType<>::value, is_lvalue<>::value
"aos/macros.h"  // for DISALLOW_COPY_AND_ASSIGN

The full include-list for aos/util/trapezoid_profile.cc:
"aos/util/trapezoid_profile.h"
<math.h>           // for sqrt
<algorithm>        // for min
<cstdlib>          // for abs
<ostream>          // for operator<<
"aos/time/time.h"  // for DurationInSeconds
"glog/logging.h"   // for GetReferenceableValue, Check_GEImpl, Check_GTImpl, CHECK_GE, CHECK_GT, COMPACT_GOOGLE_LOG_FATAL, LOG, LogMessageFatal

The full include-list for aos/util/bitpacking.h:
<stddef.h>           // for size_t
<stdint.h>           // for uint32_t, uint8_t, UINT32_C
<algorithm>          // for min, max
<cassert>            // for assert
<type_traits>        // for enable_if, is_unsigned
"absl/types/span.h"  // for Span

The full include-list for aos/util/bitpacking_test.cc:
"aos/util/bitpacking.h"
<array>          // for array
<cstdint>        // for uint8_t, uint16_t, uint64_t, UINT64_C
<memory>         // for allocator
"gtest/gtest.h"  // for EXPECT_EQ, Message, TestPartResult, Test, TestInfo, TEST

The full include-list for aos/util/config_validator_lib.h:
"aos/configuration.h"                           // for Configuration
"aos/util/config_validator_config_generated.h"  // for ConfigValidatorConfig

The full include-list for aos/util/config_validator_lib_test.cc:
"aos/util/config_validator_lib.h"
<memory>                    // for allocator
"aos/flatbuffers.h"         // for FlatbufferDetachedBuffer
"aos/json_to_flatbuffer.h"  // for JsonToFlatbuffer
"aos/testing/path.h"        // for ArtifactPath
"gtest/gtest-spi.h"
"gtest/gtest-spi.h"
"gtest/gtest.h"             // for Test, TestInfo, TEST, EXPECT_FATAL_FAILURE, DeathTest, EXPECT_NONFATAL_FAILURE, EXPECT_DEATH, Message, TestPartResult

The full include-list for aos/util/config_validator_lib.h:
"aos/configuration.h"                           // for Configuration
"aos/util/config_validator_config_generated.h"  // for ConfigValidatorConfig

The full include-list for aos/util/config_validator_lib.cc:
"aos/util/config_validator_lib.h"
<algorithm>                                  // for max
<chrono>                                     // for seconds
<cstdlib>                                    // for exit, EXIT_SUCCESS, size_t
<initializer_list>                           // for initializer_list
<map>                                        // for map, operator==, _Rb_tree_const_iterator, _Rb_tree_iterator
<memory>                                     // for unique_ptr
<ostream>                                    // for operator<<, basic_ostream
<set>                                        // for set
<string>                                     // for char_traits, operator<<, string, operator+, operator<=>
<string_view>                                // for operator<<, operator==
<utility>                                    // for pair, make_pair
<vector>                                     // for vector
"aos/events/event_loop.h"                    // for EventLoop, RawFetcher, RawSender, RawFetcher::Fetch, RawSender::Send
"aos/events/logging/log_reader.h"            // for LogReader
"aos/events/logging/logfile_sorting.h"       // for FindLogs, SortParts
"aos/events/logging/logfile_utils.h"         // for MaybeNodeName
"aos/events/simulated_event_loop.h"          // for SimulatedEventLoopFactory
"aos/flatbuffers/builder.h"                  // for Builder
"aos/flatbuffers/static_vector.h"            // for String, Vector
"aos/json_to_flatbuffer.h"                   // for FlatbufferToJson, JsonToFlatbuffer
"aos/network/remote_message_generated.h"     // for RemoteMessage
"aos/network/timestamp_channel.h"            // for ChannelTimestampFinder
"aos/testing/tmpdir.h"                       // for TestTmpDir
"aos/util/config_validator_config_static.h"  // for LoggerNodeSetValidationStatic, ConfigValidatorConfigStatic, LoggingConfigValidationStatic
"aos/util/file.h"                            // for UnlinkRecursive
"aos/util/simulation_logger.h"               // for LoggerState, MakeLoggersForAllNodes, MakeLoggersForNodes
"flatbuffers/buffer.h"                       // for Offset
"flatbuffers/detached_buffer.h"              // for DetachedBuffer
"flatbuffers/string.h"                       // for String
"flatbuffers/vector.h"                       // for Vector, VectorIterator
"gflags/gflags_declare.h"                    // for DECLARE_bool
"glog/logging.h"                             // for CHECK, COMPACT_GOOGLE_LOG_FATAL, COMPACT_GOOGLE_LOG_WARNING, LOG, LogMessage, LogMessageFatal, CheckNotNull, CHECK_NOTNULL
"gtest/gtest.h"                              // for AssertionResult, Message, TestPartResult, ASSERT_TRUE, DeathTest, ExitedWithCode, SCOPED_TRACE, ASSERT_EXIT, EXPECT_TRUE, FAIL

The full include-list for aos/util/phased_loop.h:
<chrono>           // for operator-
<optional>         // for nullopt, optional
"aos/time/time.h"  // for monotonic_clock, sleep_until

The full include-list for aos/util/phased_loop_test.cc:
"aos/util/phased_loop.h"
<memory>           // for allocator
<ratio>            // for ratio
"aos/time/time.h"  // for monotonic_clock
"gtest/gtest.h"    // for Message, TestPartResult, EXPECT_EQ, TestInfo, TEST_F, DeathTest, EXPECT_DEATH, ASSERT_EQ, Test

The full include-list for aos/util/generate_test_log.cc:
<chrono>                             // for seconds
<memory>                             // for unique_ptr
"aos/configuration.h"                // for ReadConfig, Configuration
"aos/events/event_loop.h"            // for EventLoop
"aos/events/logging/log_writer.h"    // for Logger
"aos/events/ping_lib.h"              // for Ping
"aos/events/pong_lib.h"              // for Pong
"aos/events/simulated_event_loop.h"  // for SimulatedEventLoopFactory
"aos/flatbuffers.h"                  // for FlatbufferDetachedBuffer
"aos/init.h"                         // for InitGoogle
"aos/testing/path.h"                 // for ArtifactPath
"gflags/gflags.h"                    // for DEFINE_string

The full include-list for aos/util/config_validator.cc:
<memory>                                        // for allocator
"aos/configuration.h"                           // for ReadConfig, Configuration
"aos/flatbuffers.h"                             // for FlatbufferDetachedBuffer
"aos/json_to_flatbuffer.h"                      // for JsonToFlatbuffer
"aos/util/config_validator_config_generated.h"  // for ConfigValidatorConfig
"aos/util/config_validator_lib.h"               // for ConfigIsValid
"gflags/gflags.h"                               // for DEFINE_string
"gtest/gtest.h"                                 // for Test, AssertionResult, TestInfo, ASSERT_TRUE, Message, TEST, TestPartResult

Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: I29dc3f73f60642bee8bcc3ff3d6bd36558f12123
diff --git a/aos/util/bitpacking.h b/aos/util/bitpacking.h
index 844a940..4c9bfc8 100644
--- a/aos/util/bitpacking.h
+++ b/aos/util/bitpacking.h
@@ -1,6 +1,10 @@
 #ifndef AOS_UTIL_BITPACKING_H_
 #define AOS_UTIL_BITPACKING_H_
 
+#include <stddef.h>
+#include <stdint.h>
+
+#include <algorithm>
 #include <cassert>
 #include <type_traits>
 
diff --git a/aos/util/bitpacking_test.cc b/aos/util/bitpacking_test.cc
index 0f534a1..bcf72b4 100644
--- a/aos/util/bitpacking_test.cc
+++ b/aos/util/bitpacking_test.cc
@@ -2,6 +2,7 @@
 
 #include <array>
 #include <cstdint>
+#include <memory>
 
 #include "gtest/gtest.h"
 
diff --git a/aos/util/clock_publisher.cc b/aos/util/clock_publisher.cc
index f8c731f..2b70768 100644
--- a/aos/util/clock_publisher.cc
+++ b/aos/util/clock_publisher.cc
@@ -1,5 +1,17 @@
 #include "aos/util/clock_publisher.h"
 
+#include <algorithm>
+#include <chrono>
+#include <vector>
+
+#include "flatbuffers/buffer.h"
+#include "flatbuffers/flatbuffer_builder.h"
+#include "flatbuffers/string.h"
+#include "flatbuffers/vector.h"
+
+#include "aos/configuration_generated.h"
+#include "aos/events/context.h"
+
 namespace aos {
 ClockPublisher::ClockPublisher(aos::SimulatedEventLoopFactory *factory,
                                aos::EventLoop *event_loop)
diff --git a/aos/util/clock_publisher.h b/aos/util/clock_publisher.h
index a6d3488..44e1c4a 100644
--- a/aos/util/clock_publisher.h
+++ b/aos/util/clock_publisher.h
@@ -1,5 +1,6 @@
 #ifndef AOS_UTIL_CLOCK_PUBLISHER_H_
 #define AOS_UTIL_CLOCK_PUBLISHER_H_
+#include "aos/events/event_loop.h"
 #include "aos/events/simulated_event_loop.h"
 #include "aos/util/clock_timepoints_generated.h"
 
diff --git a/aos/util/config_validator.cc b/aos/util/config_validator.cc
index df21ba0..0ee1018 100644
--- a/aos/util/config_validator.cc
+++ b/aos/util/config_validator.cc
@@ -1,4 +1,12 @@
+#include <memory>
+
+#include "gflags/gflags.h"
+#include "gtest/gtest.h"
+
+#include "aos/configuration.h"
+#include "aos/flatbuffers.h"
 #include "aos/json_to_flatbuffer.h"
+#include "aos/util/config_validator_config_generated.h"
 #include "aos/util/config_validator_lib.h"
 
 DEFINE_string(config, "", "Name of the config file to replay using.");
diff --git a/aos/util/config_validator_lib.cc b/aos/util/config_validator_lib.cc
index ad85027..eb5205a 100644
--- a/aos/util/config_validator_lib.cc
+++ b/aos/util/config_validator_lib.cc
@@ -1,14 +1,39 @@
 #include "aos/util/config_validator_lib.h"
 
+#include <algorithm>
 #include <chrono>
+#include <cstdlib>
+#include <initializer_list>
+#include <map>
+#include <memory>
+#include <ostream>
+#include <set>
+#include <string>
+#include <string_view>
+#include <utility>
+#include <vector>
 
+#include "flatbuffers/buffer.h"
+#include "flatbuffers/detached_buffer.h"
+#include "flatbuffers/string.h"
+#include "flatbuffers/vector.h"
+#include "gflags/gflags_declare.h"
+#include "glog/logging.h"
+#include "gtest/gtest.h"
+
+#include "aos/events/event_loop.h"
 #include "aos/events/logging/log_reader.h"
-#include "aos/events/logging/log_writer.h"
+#include "aos/events/logging/logfile_sorting.h"
+#include "aos/events/logging/logfile_utils.h"
 #include "aos/events/simulated_event_loop.h"
+#include "aos/flatbuffers/builder.h"
+#include "aos/flatbuffers/static_vector.h"
+#include "aos/json_to_flatbuffer.h"
 #include "aos/network/remote_message_generated.h"
 #include "aos/network/timestamp_channel.h"
 #include "aos/testing/tmpdir.h"
 #include "aos/util/config_validator_config_static.h"
+#include "aos/util/file.h"
 #include "aos/util/simulation_logger.h"
 
 DECLARE_bool(validate_timestamp_logger_nodes);
diff --git a/aos/util/config_validator_lib.h b/aos/util/config_validator_lib.h
index aa855e5..59ef6d5 100644
--- a/aos/util/config_validator_lib.h
+++ b/aos/util/config_validator_lib.h
@@ -1,10 +1,9 @@
 #ifndef AOS_UTIL_CONFIG_VALIDATOR_H_
 #define AOS_UTIL_CONFIG_VALIDATOR_H_
 
-#include "gtest/gtest.h"
-
-#include "aos/configuration.h"
+#include "aos/configuration.h"  // IWYU pragma: keep
 #include "aos/util/config_validator_config_generated.h"
+
 namespace aos::util {
 
 void ConfigIsValid(const aos::Configuration *config,
diff --git a/aos/util/config_validator_lib_test.cc b/aos/util/config_validator_lib_test.cc
index 55b723a..78b9e4c 100644
--- a/aos/util/config_validator_lib_test.cc
+++ b/aos/util/config_validator_lib_test.cc
@@ -1,7 +1,11 @@
 #include "aos/util/config_validator_lib.h"
 
-#include "gtest/gtest-spi.h"
+#include <memory>
 
+#include "gtest/gtest-spi.h"  // IWYU pragma: keep
+#include "gtest/gtest.h"
+
+#include "aos/flatbuffers.h"
 #include "aos/json_to_flatbuffer.h"
 #include "aos/testing/path.h"
 
diff --git a/aos/util/error_counter.h b/aos/util/error_counter.h
index 1e04571..e08c67e 100644
--- a/aos/util/error_counter.h
+++ b/aos/util/error_counter.h
@@ -1,6 +1,12 @@
 #ifndef AOS_UTIL_ERROR_COUNTER_H_
 #define AOS_UTIL_ERROR_COUNTER_H_
-#include "flatbuffers/flatbuffers.h"
+#include <stddef.h>
+
+#include <array>
+
+#include "flatbuffers/buffer.h"
+#include "flatbuffers/flatbuffer_builder.h"
+#include "flatbuffers/vector.h"
 #include "glog/logging.h"
 
 namespace aos::util {
diff --git a/aos/util/error_counter_test.cc b/aos/util/error_counter_test.cc
index 0a786bf..d59142d 100644
--- a/aos/util/error_counter_test.cc
+++ b/aos/util/error_counter_test.cc
@@ -1,5 +1,8 @@
 #include "aos/util/error_counter.h"
 
+#include <algorithm>
+#include <memory>
+
 #include "gtest/gtest.h"
 
 #include "aos/events/event_loop_generated.h"
diff --git a/aos/util/file.cc b/aos/util/file.cc
index ef958c6..b2528a9 100644
--- a/aos/util/file.cc
+++ b/aos/util/file.cc
@@ -1,18 +1,26 @@
 #include "aos/util/file.h"
 
+#include <errno.h>
 #include <fcntl.h>
 #include <fts.h>
+#include <stdio.h>
+#include <string.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
 
+#include <algorithm>
+#include <iterator>
 #include <optional>
+#include <ostream>
 #include <string_view>
 #if __has_feature(memory_sanitizer)
 #include <sanitizer/msan_interface.h>
 #endif
 
+#include "flatbuffers/util.h"
+
 #include "aos/scoped/scoped_fd.h"
 
 namespace aos::util {
diff --git a/aos/util/file.h b/aos/util/file.h
index e0d5c6b..2fc4b2b 100644
--- a/aos/util/file.h
+++ b/aos/util/file.h
@@ -1,18 +1,18 @@
 #ifndef AOS_UTIL_FILE_H_
 #define AOS_UTIL_FILE_H_
 
-#include <fcntl.h>
+#include <stdint.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#include <array>
 #include <memory>
 #include <optional>
 #include <string>
 #include <string_view>
+#include <vector>
 
-#include "absl/strings/numbers.h"
 #include "absl/types/span.h"
-#include "flatbuffers/util.h"
 #include "glog/logging.h"
 
 #include "aos/scoped/scoped_fd.h"
diff --git a/aos/util/file_test.cc b/aos/util/file_test.cc
index b3f1e66..bd319b5 100644
--- a/aos/util/file_test.cc
+++ b/aos/util/file_test.cc
@@ -1,10 +1,12 @@
 #include "aos/util/file.h"
 
+#include <unistd.h>
+
 #include <cstdlib>
 #include <optional>
 #include <string>
 
-#include "gmock/gmock-matchers.h"
+#include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
 #include "aos/realtime.h"
diff --git a/aos/util/filesystem_monitor.cc b/aos/util/filesystem_monitor.cc
index 4efb141..df1dd22 100644
--- a/aos/util/filesystem_monitor.cc
+++ b/aos/util/filesystem_monitor.cc
@@ -1,9 +1,26 @@
+#include <stddef.h>
 #include <sys/statvfs.h>
 
-#include "absl/strings/str_split.h"
-#include "gflags/gflags.h"
+#include <algorithm>
+#include <chrono>
+#include <istream>
+#include <optional>
+#include <string>
+#include <string_view>
+#include <vector>
 
+#include "absl/strings/str_split.h"
+#include "flatbuffers/buffer.h"
+#include "flatbuffers/flatbuffer_builder.h"
+#include "flatbuffers/string.h"
+#include "flatbuffers/vector.h"
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
+#include "aos/configuration.h"
+#include "aos/events/event_loop.h"
 #include "aos/events/shm_event_loop.h"
+#include "aos/flatbuffers.h"
 #include "aos/init.h"
 #include "aos/util/filesystem_generated.h"
 
diff --git a/aos/util/foxglove_websocket.cc b/aos/util/foxglove_websocket.cc
index 44e24c8..57326de 100644
--- a/aos/util/foxglove_websocket.cc
+++ b/aos/util/foxglove_websocket.cc
@@ -1,6 +1,10 @@
+#include <string>
+
 #include "gflags/gflags.h"
 
+#include "aos/configuration.h"
 #include "aos/events/shm_event_loop.h"
+#include "aos/flatbuffers.h"
 #include "aos/init.h"
 #include "aos/util/foxglove_websocket_lib.h"
 
diff --git a/aos/util/foxglove_websocket_lib.cc b/aos/util/foxglove_websocket_lib.cc
index fd2cfd4..7a825e4 100644
--- a/aos/util/foxglove_websocket_lib.cc
+++ b/aos/util/foxglove_websocket_lib.cc
@@ -1,9 +1,27 @@
 #include "aos/util/foxglove_websocket_lib.h"
 
-#include "absl/strings/escaping.h"
-#include "gflags/gflags.h"
+#include <chrono>
+#include <compare>
+#include <string>
+#include <utility>
 
+#include "absl/container/btree_set.h"
+#include "absl/strings/escaping.h"
+#include "absl/types/span.h"
+#include "flatbuffers/reflection_generated.h"
+#include "flatbuffers/string.h"
+#include "flatbuffers/vector.h"
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+#include "nlohmann/json.hpp"
+#include <foxglove/websocket/server.hpp>
+
+#include "aos/configuration.h"
+#include "aos/events/context.h"
 #include "aos/flatbuffer_merge.h"
+#include "aos/flatbuffers.h"
+#include "aos/json_to_flatbuffer.h"
+#include "aos/time/time.h"
 #include "aos/util/mcap_logger.h"
 
 DEFINE_uint32(sorting_buffer_ms, 100,
diff --git a/aos/util/foxglove_websocket_lib.h b/aos/util/foxglove_websocket_lib.h
index 2590e27..6836786 100644
--- a/aos/util/foxglove_websocket_lib.h
+++ b/aos/util/foxglove_websocket_lib.h
@@ -1,6 +1,9 @@
 #ifndef AOS_UTIL_FOXGLOVE_WEBSOCKET_LIB_H_
 #define AOS_UTIL_FOXGLOVE_WEBSOCKET_LIB_H_
+#include <stdint.h>
+
 #include <map>
+#include <memory>
 #include <set>
 
 #include "foxglove/websocket/server.hpp"
diff --git a/aos/util/generate_test_log.cc b/aos/util/generate_test_log.cc
index dda7912..106e972 100644
--- a/aos/util/generate_test_log.cc
+++ b/aos/util/generate_test_log.cc
@@ -1,11 +1,16 @@
+#include <chrono>
+#include <memory>
+
 #include "gflags/gflags.h"
 
 #include "aos/configuration.h"
+#include "aos/events/event_loop.h"
 #include "aos/events/logging/log_writer.h"
 #include "aos/events/ping_lib.h"
 #include "aos/events/pong_lib.h"
+#include "aos/events/simulated_event_loop.h"
+#include "aos/flatbuffers.h"
 #include "aos/init.h"
-#include "aos/json_to_flatbuffer.h"
 #include "aos/testing/path.h"
 
 DEFINE_string(output_folder, "",
diff --git a/aos/util/global_factory.h b/aos/util/global_factory.h
index 2a4028e..99dfc2a 100644
--- a/aos/util/global_factory.h
+++ b/aos/util/global_factory.h
@@ -5,6 +5,7 @@
 #include <memory>
 #include <string>
 #include <unordered_map>
+#include <utility>
 
 // // File Usage Description:
 // class ExampleBaseClass { virtual ~ExampleBaseClass(); }
diff --git a/aos/util/log_to_mcap.cc b/aos/util/log_to_mcap.cc
index d0a2415..8661246 100644
--- a/aos/util/log_to_mcap.cc
+++ b/aos/util/log_to_mcap.cc
@@ -1,6 +1,21 @@
+#include <algorithm>
+#include <memory>
+#include <optional>
+#include <ostream>
+#include <set>
+#include <string>
+#include <vector>
+
+#include "flatbuffers/reflection_generated.h"
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
 #include "aos/configuration.h"
-#include "aos/events/event_loop_generated.h"
+#include "aos/events/event_loop.h"
 #include "aos/events/logging/log_reader.h"
+#include "aos/events/logging/logfile_sorting.h"
+#include "aos/events/simulated_event_loop.h"
+#include "aos/flatbuffers.h"
 #include "aos/init.h"
 #include "aos/util/clock_publisher.h"
 #include "aos/util/clock_timepoints_schema.h"
diff --git a/aos/util/math.h b/aos/util/math.h
index 5a3df11..54bd79a 100644
--- a/aos/util/math.h
+++ b/aos/util/math.h
@@ -3,7 +3,7 @@
 
 #include <cmath>
 
-#include "Eigen/Dense"
+#include "Eigen/Core"
 
 namespace aos::math {
 
diff --git a/aos/util/math_test.cc b/aos/util/math_test.cc
index df68f00..7f3f8b2 100644
--- a/aos/util/math_test.cc
+++ b/aos/util/math_test.cc
@@ -1,5 +1,7 @@
 #include "aos/util/math.h"
 
+#include <memory>
+
 #include "gtest/gtest.h"
 
 namespace aos::math::testing {
diff --git a/aos/util/mcap_logger.cc b/aos/util/mcap_logger.cc
index df2b2d4..0dbb88e 100644
--- a/aos/util/mcap_logger.cc
+++ b/aos/util/mcap_logger.cc
@@ -1,12 +1,30 @@
 #include "aos/util/mcap_logger.h"
 
-#include "absl/strings/str_replace.h"
-#include "lz4/lz4.h"
+#include <algorithm>
+#include <chrono>
+#include <numeric>
+#include <ostream>
+#include <set>
+
+#include "absl/strings/str_cat.h"
+#include "absl/types/span.h"
+#include "flatbuffers/buffer.h"
+#include "flatbuffers/detached_buffer.h"
+#include "flatbuffers/flatbuffer_builder.h"
+#include "flatbuffers/reflection.h"
+#include "flatbuffers/reflection_generated.h"
+#include "flatbuffers/string.h"
+#include "flatbuffers/vector.h"
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+#include "glog/vlog_is_on.h"
 #include "lz4/lz4frame.h"
 #include "nlohmann/json.hpp"
 
+#include "aos/configuration.h"
 #include "aos/configuration_schema.h"
 #include "aos/flatbuffer_merge.h"
+#include "aos/json_to_flatbuffer.h"
 
 DEFINE_uint64(mcap_chunk_size, 10'000'000,
               "Size, in bytes, of individual MCAP chunks");
diff --git a/aos/util/mcap_logger.h b/aos/util/mcap_logger.h
index d9d6f36..c67abda 100644
--- a/aos/util/mcap_logger.h
+++ b/aos/util/mcap_logger.h
@@ -1,12 +1,27 @@
 #ifndef AOS_UTIL_MCAP_LOGGER_H_
 #define AOS_UTIL_MCAP_LOGGER_H_
 
-#include "nlohmann/json.hpp"
+#include <stddef.h>
+#include <stdint.h>
+
+#include <iosfwd>
+#include <map>
+#include <memory>
+#include <optional>
+#include <string>
+#include <string_view>
+#include <utility>
+#include <vector>
+
+#include "nlohmann/json_fwd.hpp"
 
 #include "aos/configuration_generated.h"
+#include "aos/events/context.h"
 #include "aos/events/event_loop.h"
 #include "aos/fast_string_builder.h"
 #include "aos/flatbuffer_utils.h"
+#include "aos/flatbuffers.h"
+#include "aos/time/time.h"
 
 namespace aos {
 
diff --git a/aos/util/mcap_logger_test.cc b/aos/util/mcap_logger_test.cc
index 3684e93..351e124 100644
--- a/aos/util/mcap_logger_test.cc
+++ b/aos/util/mcap_logger_test.cc
@@ -1,9 +1,8 @@
 #include "aos/util/mcap_logger.h"
 
-#include <iostream>
-
 #include "flatbuffers/reflection_generated.h"
 #include "gtest/gtest.h"
+#include "nlohmann/json.hpp"
 
 namespace aos::testing {
 // TODO(james): Write a proper test for the McapLogger itself. However, that
diff --git a/aos/util/options.h b/aos/util/options.h
index f393030..55c48a9 100644
--- a/aos/util/options.h
+++ b/aos/util/options.h
@@ -1,13 +1,8 @@
 #ifndef AOS_UTIL_OPTIONS_H_
 #define AOS_UTIL_OPTIONS_H_
 
-#include <sys/types.h>
-
 namespace aos {
 
-template <class Owner>
-class Options;
-
 // An "option" that can be combined with other options and passed as one
 // argument. This class is designed to emulate integral constants (except be
 // type-safe), so its instances can be combined with operator| (creating an
diff --git a/aos/util/options_test.cc b/aos/util/options_test.cc
index f560fe6..536b319 100644
--- a/aos/util/options_test.cc
+++ b/aos/util/options_test.cc
@@ -1,5 +1,7 @@
 #include "aos/util/options.h"
 
+#include <memory>
+
 #include "gtest/gtest.h"
 
 namespace aos::testing {
diff --git a/aos/util/phased_loop.cc b/aos/util/phased_loop.cc
index 476cc3f..5f87bd0 100644
--- a/aos/util/phased_loop.cc
+++ b/aos/util/phased_loop.cc
@@ -1,5 +1,8 @@
 #include "aos/util/phased_loop.h"
 
+#include <compare>
+#include <ratio>
+
 #include "glog/logging.h"
 
 namespace aos::time {
diff --git a/aos/util/phased_loop.h b/aos/util/phased_loop.h
index dc2dc96..f63481e 100644
--- a/aos/util/phased_loop.h
+++ b/aos/util/phased_loop.h
@@ -1,6 +1,7 @@
 #ifndef AOS_UTIL_PHASED_LOOP_H_
 #define AOS_UTIL_PHASED_LOOP_H_
 
+#include <chrono>
 #include <optional>
 
 #include "aos/time/time.h"
diff --git a/aos/util/phased_loop_test.cc b/aos/util/phased_loop_test.cc
index af33567..e74be4c 100644
--- a/aos/util/phased_loop_test.cc
+++ b/aos/util/phased_loop_test.cc
@@ -1,6 +1,8 @@
 #include "aos/util/phased_loop.h"
 
-#include "glog/logging.h"
+#include <memory>
+#include <ratio>
+
 #include "gtest/gtest.h"
 
 #include "aos/time/time.h"
diff --git a/aos/util/scoped_pipe.cc b/aos/util/scoped_pipe.cc
index d64fad1..a4e5b46 100644
--- a/aos/util/scoped_pipe.cc
+++ b/aos/util/scoped_pipe.cc
@@ -1,6 +1,10 @@
 #include "aos/util/scoped_pipe.h"
 
+#include <errno.h>
 #include <fcntl.h>
+#include <unistd.h>
+
+#include <ostream>
 
 #include "glog/logging.h"
 
diff --git a/aos/util/scoped_pipe.h b/aos/util/scoped_pipe.h
index fb91e02..c6ce0cb 100644
--- a/aos/util/scoped_pipe.h
+++ b/aos/util/scoped_pipe.h
@@ -1,10 +1,12 @@
 #ifndef AOS_UTIL_SCOPED_PIPE_H_
 #define AOS_UTIL_SCOPED_PIPE_H_
 
+#include <stddef.h>
 #include <stdint.h>
 
 #include <memory>
 #include <optional>
+#include <string>
 
 #include "absl/types/span.h"
 
@@ -14,6 +16,7 @@
 class ScopedPipe {
  public:
   class ScopedReadPipe;
+
   class ScopedWritePipe;
 
   struct PipePair {
diff --git a/aos/util/scoped_pipe_test.cc b/aos/util/scoped_pipe_test.cc
index 80059f8..55a8f62 100644
--- a/aos/util/scoped_pipe_test.cc
+++ b/aos/util/scoped_pipe_test.cc
@@ -2,6 +2,7 @@
 
 #include <fcntl.h>
 
+#include <algorithm>
 #include <array>
 #include <string>
 
diff --git a/aos/util/simulation_logger.cc b/aos/util/simulation_logger.cc
index 32ff706..fabfd92 100644
--- a/aos/util/simulation_logger.cc
+++ b/aos/util/simulation_logger.cc
@@ -1,6 +1,14 @@
 #include "aos/util/simulation_logger.h"
 
+#include <algorithm>
+#include <chrono>
+#include <utility>
+
+#include "absl/strings/str_cat.h"
+
+#include "aos/configuration.h"
 #include "aos/events/logging/logfile_utils.h"
+#include "aos/time/time.h"
 
 namespace aos::util {
 LoggerState::LoggerState(aos::SimulatedEventLoopFactory *factory,
diff --git a/aos/util/simulation_logger.h b/aos/util/simulation_logger.h
index af43d02..c1499b8 100644
--- a/aos/util/simulation_logger.h
+++ b/aos/util/simulation_logger.h
@@ -1,9 +1,16 @@
 #ifndef AOS_UTIL_SIMULATION_LOGGER_H_
 #define AOS_UTIL_SIMULATION_LOGGER_H_
+#include <memory>
+#include <string>
 #include <string_view>
+#include <vector>
 
+#include "aos/configuration_generated.h"
+#include "aos/events/event_loop.h"
+#include "aos/events/logging/log_namer.h"
 #include "aos/events/logging/log_writer.h"
 #include "aos/events/simulated_event_loop.h"
+
 namespace aos::util {
 
 class LoggerState {
diff --git a/aos/util/threaded_consumer.h b/aos/util/threaded_consumer.h
index 3bf4f36..471f6e1 100644
--- a/aos/util/threaded_consumer.h
+++ b/aos/util/threaded_consumer.h
@@ -5,6 +5,8 @@
 #include <optional>
 #include <thread>
 
+#include "glog/logging.h"
+
 #include "aos/condition.h"
 #include "aos/containers/ring_buffer.h"
 #include "aos/mutex/mutex.h"
diff --git a/aos/util/threaded_consumer_test.cc b/aos/util/threaded_consumer_test.cc
index 36f3121..27dc183 100644
--- a/aos/util/threaded_consumer_test.cc
+++ b/aos/util/threaded_consumer_test.cc
@@ -1,5 +1,11 @@
 #include "aos/util/threaded_consumer.h"
 
+#include <atomic>
+#include <chrono>
+#include <initializer_list>
+#include <memory>
+#include <ostream>
+
 #include "gtest/gtest.h"
 
 namespace aos::util {
diff --git a/aos/util/threaded_queue.h b/aos/util/threaded_queue.h
index 943609e..1bbde48 100644
--- a/aos/util/threaded_queue.h
+++ b/aos/util/threaded_queue.h
@@ -94,5 +94,5 @@
 
 }  // namespace aos::util
 
-#include "aos/util/threaded_queue_tmpl.h"
-#endif  // AOS_UTIL_THREADED_QUEUE_H_
+#include "aos/util/threaded_queue_tmpl.h"  // IWYU pragma: keep
+#endif                                     // AOS_UTIL_THREADED_QUEUE_H_
diff --git a/aos/util/threaded_queue_test.cc b/aos/util/threaded_queue_test.cc
index c97792c..8fd08e8 100644
--- a/aos/util/threaded_queue_test.cc
+++ b/aos/util/threaded_queue_test.cc
@@ -1,5 +1,9 @@
 #include "aos/util/threaded_queue.h"
 
+#include <atomic>
+#include <memory>
+#include <utility>
+
 #include "gtest/gtest.h"
 
 namespace aos::util {
diff --git a/aos/util/top.cc b/aos/util/top.cc
index c22fee4..10ebd4d 100644
--- a/aos/util/top.cc
+++ b/aos/util/top.cc
@@ -1,16 +1,28 @@
 #include "aos/util/top.h"
 
 #include <dirent.h>
-#include <sys/types.h>  // used for DIR
+#include <errno.h>
 #include <unistd.h>
 
+#include <algorithm>
+#include <array>
+#include <atomic>
 #include <cstring>
+#include <istream>
 #include <queue>
+#include <ratio>
 #include <string>
+#include <string_view>
+#include <vector>
 
+#include "absl/numeric/int128.h"
 #include "absl/strings/numbers.h"
+#include "absl/strings/str_cat.h"
 #include "absl/strings/str_format.h"
 #include "absl/strings/str_split.h"
+#include "flatbuffers/string.h"
+#include "flatbuffers/vector.h"
+#include "glog/logging.h"
 
 #define PF_KTHREAD 0x00200000
 
diff --git a/aos/util/top.h b/aos/util/top.h
index c24d56c..1aaaff0 100644
--- a/aos/util/top.h
+++ b/aos/util/top.h
@@ -1,11 +1,23 @@
 #ifndef AOS_UTIL_TOP_H_
 #define AOS_UTIL_TOP_H_
 
+#include <stdint.h>
+#include <sys/types.h>
+
+#include <chrono>
+#include <functional>
 #include <map>
+#include <optional>
+#include <set>
 #include <string>
+#include <utility>
+
+#include "flatbuffers/buffer.h"
+#include "flatbuffers/flatbuffer_builder.h"
 
 #include "aos/containers/ring_buffer.h"
 #include "aos/events/event_loop.h"
+#include "aos/time/time.h"
 #include "aos/util/process_info_generated.h"
 
 namespace aos::util {
diff --git a/aos/util/top_test.cc b/aos/util/top_test.cc
index ce9986f..7d9d2bb 100644
--- a/aos/util/top_test.cc
+++ b/aos/util/top_test.cc
@@ -1,18 +1,33 @@
 #include "aos/util/top.h"
 
+#include <pthread.h>
+#include <signal.h>
 #include <unistd.h>
 
-#include <array>
+#include <algorithm>
+#include <atomic>
+#include <limits>
+#include <ostream>
 #include <string>
+#include <string_view>
 #include <thread>
+#include <vector>
 
+#include "flatbuffers/string.h"
+#include "flatbuffers/vector.h"
+#include "gflags/gflags.h"
+#include "glog/logging.h"
 #include "gtest/gtest.h"
 #include <gmock/gmock.h>
 
+#include "aos/configuration.h"
 #include "aos/events/shm_event_loop.h"
+#include "aos/flatbuffers.h"
+#include "aos/ipc_lib/shm_base.h"
 #include "aos/json_to_flatbuffer.h"
 #include "aos/testing/path.h"
 #include "aos/testing/tmpdir.h"
+#include "aos/util/file.h"
 
 namespace aos::util::testing {
 
diff --git a/aos/util/trapezoid_profile.cc b/aos/util/trapezoid_profile.cc
index 05e79ca..be61889 100644
--- a/aos/util/trapezoid_profile.cc
+++ b/aos/util/trapezoid_profile.cc
@@ -1,7 +1,15 @@
 #include "aos/util/trapezoid_profile.h"
 
+#include <math.h>
+
+#include <algorithm>
+#include <cstdlib>
+#include <ostream>
+
 #include "glog/logging.h"
 
+#include "aos/time/time.h"
+
 namespace aos::util {
 
 AsymmetricTrapezoidProfile::AsymmetricTrapezoidProfile(
diff --git a/aos/util/trapezoid_profile.h b/aos/util/trapezoid_profile.h
index 621ff30..32b2996 100644
--- a/aos/util/trapezoid_profile.h
+++ b/aos/util/trapezoid_profile.h
@@ -1,10 +1,11 @@
 #ifndef AOS_UTIL_TRAPEZOID_PROFILE_H_
 #define AOS_UTIL_TRAPEZOID_PROFILE_H_
 
-#include "Eigen/Dense"
+#include <chrono>
+
+#include "Eigen/Core"
 
 #include "aos/macros.h"
-#include "aos/time/time.h"
 
 namespace aos::util {
 
diff --git a/aos/util/trapezoid_profile_test.cc b/aos/util/trapezoid_profile_test.cc
index 54ffeb5..32461d3 100644
--- a/aos/util/trapezoid_profile_test.cc
+++ b/aos/util/trapezoid_profile_test.cc
@@ -1,7 +1,11 @@
 #include "aos/util/trapezoid_profile.h"
 
-#include "Eigen/Dense"
-#include "glog/logging.h"
+#include <compare>
+#include <cstdlib>
+#include <memory>
+#include <ratio>
+
+#include "Eigen/Dense"  // IWYU pragma: keep
 #include "gtest/gtest.h"
 
 namespace aos::util::testing {
diff --git a/aos/util/wrapping_counter_test.cc b/aos/util/wrapping_counter_test.cc
index 17605a0..7d452d7 100644
--- a/aos/util/wrapping_counter_test.cc
+++ b/aos/util/wrapping_counter_test.cc
@@ -1,6 +1,6 @@
 #include "aos/util/wrapping_counter.h"
 
-#include <climits>
+#include <memory>
 
 #include "gtest/gtest.h"
 
diff --git a/tools/iwyu/by_hand.imp b/tools/iwyu/by_hand.imp
index 54f271b..ca38ce7 100644
--- a/tools/iwyu/by_hand.imp
+++ b/tools/iwyu/by_hand.imp
@@ -41,5 +41,9 @@
   { "include": ["<grpcpp/impl/service_type.h>", "private", "\"grpcpp/impl/service_type.h\"", "public"] },
   { "include": ["<grpcpp/security/credentials.h>", "private", "\"grpcpp/security/credentials.h\"", "public"] },
   { "include": ["<grpcpp/server.h>", "private", "\"grpcpp/server.h\"", "public"] },
+
+  # nlohmann
+  { "include": ["<nlohmann/json.hpp>", "private", "\"nlohmann/json.hpp\"", "public"] },
+  { "include": ["<nlohmann/json_fwd.hpp>", "private", "\"nlohmann/json_fwd.hpp\"", "public"] },
 ]
 
diff --git a/tools/iwyu/eigen.imp b/tools/iwyu/eigen.imp
new file mode 100644
index 0000000..cbeb16b
--- /dev/null
+++ b/tools/iwyu/eigen.imp
@@ -0,0 +1,19 @@
+[
+  { include: [ "\"src/Core/DenseBase.h\"",                 private, "\"Eigen/Core\"",                "public" ] },
+  { include: [ "\"src/Core/MatrixBase.h\"",                private, "\"Eigen/Core\"",                "public" ] },
+  { include: [ "\"src/Core/ArrayBase.h\"",                 private, "\"Eigen/Core\"",                "public" ] },
+  { include: [ "\"src/SparseCore/SparseMatrixBase.h\"",    private, "\"Eigen/Sparse\"",              "public" ] },
+  { include: [ "<Eigen/src/plugins/ArrayCwiseUnaryOps.h>", private, "\"Eigen/Core\"",                "public" ] },
+  { include: [ "<Eigen/src/plugins/IndexedViewMethods.h>", private, "\"Eigen/Core\"",                "public" ] },
+  { include: [ "@<Eigen/src/Core/.*>",                     private, "\"Eigen/Core\"",                "public" ] },
+  { include: [ "@\"src/Core/.*\"",                         private, "\"Eigen/Core\"",                "public" ] },
+  { include: [ "@<Eigen/src/Cholesky/.*>",                 private, "\"Eigen/Cholesky\"",            "public" ] },
+  { include: [ "@<Eigen/src/Jacobi/.*>",                   private, "\"Eigen/Jacobi\"",              "public" ] },
+  { include: [ "@<Eigen/src/QR/.*>",                       private, "\"Eigen/QR\"",                  "public" ] },
+  { include: [ "@<Eigen/src/SVD/.*>",                      private, "\"Eigen/SVD\"",                 "public" ] },
+  { include: [ "@<Eigen/src/Householder/.*>",              private, "\"Eigen/Householder\"",         "public" ] },
+  { include: [ "@\"src/Cholesky/.*\"",                     private, "\"Eigen/Cholesky\"",            "public" ] },
+  { include: [ "@<Eigen/src/Geometry/.*>",                 private, "\"Eigen/Geometry\"",            "public" ] },
+  { include: [ "@\"src/Geometry/.*\"",                     private, "\"Eigen/Geometry\"",            "public" ] },
+  { include: [ "@<unsupported/Eigen/src/Splines/.*>",      private, "\"unsupported/Eigen/Splines\"", "public" ] },
+]