blob: 00555d89c0e326c312a5384b05e2198fa71bd031 [file] [log] [blame]
Austin Schuhba20ea72021-01-21 16:47:01 -08001#include <iostream>
2#include <string>
3#include <vector>
4
Austin Schuh99f7c6a2024-06-25 22:07:44 -07005#include "absl/flags/flag.h"
6#include "absl/flags/usage.h"
Philipp Schrader790cb542023-07-05 21:06:52 -07007
Austin Schuhba20ea72021-01-21 16:47:01 -08008#include "aos/events/logging/logfile_sorting.h"
9#include "aos/events/logging/logfile_utils.h"
James Kuszmaulbeaa3c82023-09-07 11:11:27 -070010#include "aos/events/logging/logfile_validator.h"
Austin Schuhba20ea72021-01-21 16:47:01 -080011#include "aos/init.h"
Austin Schuhba20ea72021-01-21 16:47:01 -080012
Austin Schuh99f7c6a2024-06-25 22:07:44 -070013ABSL_DECLARE_FLAG(bool, timestamps_to_csv);
14ABSL_FLAG(bool, skip_order_validation, false,
15 "If true, ignore any out of orderness in replay");
Austin Schuhba20ea72021-01-21 16:47:01 -080016
17namespace aos::logger {
18
Austin Schuhba20ea72021-01-21 16:47:01 -080019int Main(int argc, char **argv) {
Austin Schuh95460cc2023-06-26 11:53:10 -070020 const LogFilesContainer log_files(SortParts(FindLogs(argc, argv)));
Austin Schuh99f7c6a2024-06-25 22:07:44 -070021 CHECK(MultiNodeLogIsReadable(log_files,
22 absl::GetFlag(FLAGS_skip_order_validation)));
Austin Schuhba20ea72021-01-21 16:47:01 -080023 return 0;
24}
25
26} // namespace aos::logger
27
28int main(int argc, char **argv) {
Austin Schuh99f7c6a2024-06-25 22:07:44 -070029 absl::SetFlag(&FLAGS_timestamps_to_csv, true);
30 absl::SetProgramUsageMessage(
Austin Schuhba20ea72021-01-21 16:47:01 -080031 "Usage:\n"
32 " timestamp_extractor [args] logfile1 logfile2 ...\n\nThis program "
33 "dumps out all the timestamps from a set of log files for plotting. Use "
34 "--skip_order_validation to skip any time estimation problems we find.");
35 aos::InitGoogle(&argc, &argv);
36
37 return aos::logger::Main(argc, argv);
38}