Austin Schuh | ba20ea7 | 2021-01-21 16:47:01 -0800 | [diff] [blame] | 1 | #include <iostream> |
| 2 | #include <string> |
| 3 | #include <vector> |
| 4 | |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 5 | #include "gflags/gflags.h" |
| 6 | |
Austin Schuh | ba20ea7 | 2021-01-21 16:47:01 -0800 | [diff] [blame] | 7 | #include "aos/events/logging/logfile_sorting.h" |
| 8 | #include "aos/events/logging/logfile_utils.h" |
James Kuszmaul | beaa3c8 | 2023-09-07 11:11:27 -0700 | [diff] [blame] | 9 | #include "aos/events/logging/logfile_validator.h" |
Austin Schuh | ba20ea7 | 2021-01-21 16:47:01 -0800 | [diff] [blame] | 10 | #include "aos/init.h" |
Austin Schuh | ba20ea7 | 2021-01-21 16:47:01 -0800 | [diff] [blame] | 11 | |
| 12 | DECLARE_bool(timestamps_to_csv); |
| 13 | DEFINE_bool(skip_order_validation, false, |
| 14 | "If true, ignore any out of orderness in replay"); |
| 15 | |
| 16 | namespace aos::logger { |
| 17 | |
Austin Schuh | ba20ea7 | 2021-01-21 16:47:01 -0800 | [diff] [blame] | 18 | int Main(int argc, char **argv) { |
Austin Schuh | 95460cc | 2023-06-26 11:53:10 -0700 | [diff] [blame] | 19 | const LogFilesContainer log_files(SortParts(FindLogs(argc, argv))); |
James Kuszmaul | beaa3c8 | 2023-09-07 11:11:27 -0700 | [diff] [blame] | 20 | CHECK(MultiNodeLogIsReadable(log_files, FLAGS_skip_order_validation)); |
Austin Schuh | ba20ea7 | 2021-01-21 16:47:01 -0800 | [diff] [blame] | 21 | return 0; |
| 22 | } |
| 23 | |
| 24 | } // namespace aos::logger |
| 25 | |
| 26 | int main(int argc, char **argv) { |
| 27 | FLAGS_timestamps_to_csv = true; |
| 28 | gflags::SetUsageMessage( |
| 29 | "Usage:\n" |
| 30 | " timestamp_extractor [args] logfile1 logfile2 ...\n\nThis program " |
| 31 | "dumps out all the timestamps from a set of log files for plotting. Use " |
| 32 | "--skip_order_validation to skip any time estimation problems we find."); |
| 33 | aos::InitGoogle(&argc, &argv); |
| 34 | |
| 35 | return aos::logger::Main(argc, argv); |
| 36 | } |