blob: 3cf96f6c3bff267d04290ccf71ba90a6f84e3c73 [file] [log] [blame]
Austin Schuhba20ea72021-01-21 16:47:01 -08001#include <iostream>
2#include <string>
3#include <vector>
4
Philipp Schrader790cb542023-07-05 21:06:52 -07005#include "gflags/gflags.h"
6
Austin Schuhba20ea72021-01-21 16:47:01 -08007#include "aos/events/logging/logfile_sorting.h"
8#include "aos/events/logging/logfile_utils.h"
James Kuszmaulbeaa3c82023-09-07 11:11:27 -07009#include "aos/events/logging/logfile_validator.h"
Austin Schuhba20ea72021-01-21 16:47:01 -080010#include "aos/init.h"
Austin Schuhba20ea72021-01-21 16:47:01 -080011
12DECLARE_bool(timestamps_to_csv);
13DEFINE_bool(skip_order_validation, false,
14 "If true, ignore any out of orderness in replay");
15
16namespace aos::logger {
17
Austin Schuhba20ea72021-01-21 16:47:01 -080018int Main(int argc, char **argv) {
Austin Schuh95460cc2023-06-26 11:53:10 -070019 const LogFilesContainer log_files(SortParts(FindLogs(argc, argv)));
James Kuszmaulbeaa3c82023-09-07 11:11:27 -070020 CHECK(MultiNodeLogIsReadable(log_files, FLAGS_skip_order_validation));
Austin Schuhba20ea72021-01-21 16:47:01 -080021 return 0;
22}
23
24} // namespace aos::logger
25
26int 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}