Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 1 | #include <algorithm> |
James Kuszmaul | 38735e8 | 2019-12-07 16:42:06 -0800 | [diff] [blame] | 2 | #include <iostream> |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 3 | #include <memory> |
| 4 | #include <optional> |
| 5 | #include <string> |
| 6 | #include <string_view> |
| 7 | #include <vector> |
James Kuszmaul | 38735e8 | 2019-12-07 16:42:06 -0800 | [diff] [blame] | 8 | |
| 9 | #include "aos/configuration.h" |
Austin Schuh | b06f03b | 2021-02-17 22:00:37 -0800 | [diff] [blame] | 10 | #include "aos/events/logging/log_reader.h" |
James Kuszmaul | 38735e8 | 2019-12-07 16:42:06 -0800 | [diff] [blame] | 11 | #include "aos/events/simulated_event_loop.h" |
| 12 | #include "aos/init.h" |
| 13 | #include "aos/json_to_flatbuffer.h" |
| 14 | #include "gflags/gflags.h" |
| 15 | |
James Kuszmaul | 38735e8 | 2019-12-07 16:42:06 -0800 | [diff] [blame] | 16 | DEFINE_string( |
| 17 | name, "", |
| 18 | "Name to match for printing out channels. Empty means no name filter."); |
| 19 | DEFINE_string(type, "", |
| 20 | "Channel type to match for printing out channels. Empty means no " |
| 21 | "type filter."); |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 22 | DEFINE_bool(fetch, false, |
| 23 | "If true, also print out the messages from before the start of the " |
| 24 | "log file"); |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 25 | DEFINE_bool(raw, false, |
| 26 | "If true, just print the data out unsorted and unparsed"); |
Brian Silverman | 8ff74aa | 2021-02-05 16:37:15 -0800 | [diff] [blame] | 27 | DEFINE_string(raw_header, "", |
| 28 | "If set, the file to read the header from in raw mode"); |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 29 | DEFINE_bool(format_raw, true, |
| 30 | "If true and --raw is specified, print out raw data, but use the " |
| 31 | "schema to format the data."); |
Austin Schuh | ae46f36 | 2020-04-11 19:52:56 -0700 | [diff] [blame] | 32 | DEFINE_int32(max_vector_size, 100, |
| 33 | "If positive, vectors longer than this will not be printed"); |
Ravago Jones | 5cc9df5 | 2020-09-02 21:29:58 -0700 | [diff] [blame] | 34 | DEFINE_bool(pretty, false, |
| 35 | "If true, pretty print the messages on multiple lines"); |
Austin Schuh | 569c7f9 | 2020-12-11 20:01:42 -0800 | [diff] [blame] | 36 | DEFINE_bool(print, true, |
| 37 | "If true, actually print the messages. If false, discard them, " |
| 38 | "confirming they can be parsed."); |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 39 | |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 40 | // Print the flatbuffer out to stdout, both to remove the unnecessary cruft from |
| 41 | // glog and to allow the user to readily redirect just the logged output |
| 42 | // independent of any debugging information on stderr. |
| 43 | void PrintMessage(const std::string_view node_name, const aos::Channel *channel, |
Austin Schuh | 746690f | 2020-08-01 16:15:57 -0700 | [diff] [blame] | 44 | const aos::Context &context, |
| 45 | aos::FastStringBuilder *builder) { |
| 46 | builder->Reset(); |
Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 47 | CHECK(flatbuffers::Verify(*channel->schema(), |
| 48 | *channel->schema()->root_table(), |
| 49 | static_cast<const uint8_t *>(context.data), |
| 50 | static_cast<size_t>(context.size))) |
| 51 | << ": Corrupted flatbuffer on " << channel->name()->c_str() << " " |
| 52 | << channel->type()->c_str(); |
| 53 | |
Ravago Jones | 5cc9df5 | 2020-09-02 21:29:58 -0700 | [diff] [blame] | 54 | aos::FlatbufferToJson( |
| 55 | builder, channel->schema(), static_cast<const uint8_t *>(context.data), |
| 56 | {FLAGS_pretty, static_cast<size_t>(FLAGS_max_vector_size)}); |
Austin Schuh | 746690f | 2020-08-01 16:15:57 -0700 | [diff] [blame] | 57 | |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 58 | if (context.monotonic_remote_time != context.monotonic_event_time) { |
| 59 | std::cout << node_name << context.realtime_event_time << " (" |
| 60 | << context.monotonic_event_time << ") sent " |
| 61 | << context.realtime_remote_time << " (" |
| 62 | << context.monotonic_remote_time << ") " |
| 63 | << channel->name()->c_str() << ' ' << channel->type()->c_str() |
Austin Schuh | 746690f | 2020-08-01 16:15:57 -0700 | [diff] [blame] | 64 | << ": " << *builder << std::endl; |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 65 | } else { |
| 66 | std::cout << node_name << context.realtime_event_time << " (" |
| 67 | << context.monotonic_event_time << ") " |
| 68 | << channel->name()->c_str() << ' ' << channel->type()->c_str() |
Austin Schuh | 746690f | 2020-08-01 16:15:57 -0700 | [diff] [blame] | 69 | << ": " << *builder << std::endl; |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 70 | } |
| 71 | } |
| 72 | |
James Kuszmaul | 38735e8 | 2019-12-07 16:42:06 -0800 | [diff] [blame] | 73 | int main(int argc, char **argv) { |
| 74 | gflags::SetUsageMessage( |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 75 | "Usage:\n" |
| 76 | " log_cat [args] logfile1 logfile2 ...\n" |
| 77 | "\n" |
James Kuszmaul | 38735e8 | 2019-12-07 16:42:06 -0800 | [diff] [blame] | 78 | "This program provides a basic interface to dump data from a logfile to " |
| 79 | "stdout. Given a logfile, channel name filter, and type filter, it will " |
| 80 | "print all the messages in the logfile matching the filters. The message " |
| 81 | "filters work by taking the values of --name and --type and printing any " |
| 82 | "channel whose name contains --name as a substr and whose type contains " |
| 83 | "--type as a substr. Not specifying --name or --type leaves them free. " |
| 84 | "Calling this program without --name or --type specified prints out all " |
| 85 | "the logged data."); |
| 86 | aos::InitGoogle(&argc, &argv); |
| 87 | |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 88 | if (FLAGS_raw) { |
| 89 | if (argc != 2) { |
| 90 | LOG(FATAL) << "Expected 1 logfile as an argument."; |
James Kuszmaul | 38735e8 | 2019-12-07 16:42:06 -0800 | [diff] [blame] | 91 | } |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 92 | aos::logger::MessageReader reader(argv[1]); |
Brian Silverman | 8ff74aa | 2021-02-05 16:37:15 -0800 | [diff] [blame] | 93 | |
| 94 | std::optional<aos::logger::MessageReader> raw_header_reader; |
| 95 | const aos::logger::LogFileHeader *full_header = reader.log_file_header(); |
| 96 | if (!FLAGS_raw_header.empty()) { |
| 97 | raw_header_reader.emplace(FLAGS_raw_header); |
Austin Schuh | 881530d | 2021-06-21 17:40:04 -0700 | [diff] [blame^] | 98 | std::cout << aos::FlatbufferToJson( |
| 99 | reader.log_file_header(), |
| 100 | {.multi_line = FLAGS_pretty, |
| 101 | .max_vector_size = |
| 102 | static_cast<size_t>(FLAGS_max_vector_size)}) |
| 103 | << std::endl; |
Brian Silverman | 8ff74aa | 2021-02-05 16:37:15 -0800 | [diff] [blame] | 104 | CHECK_EQ( |
| 105 | reader.log_file_header()->configuration_sha256()->string_view(), |
| 106 | aos::logger::Sha256(raw_header_reader->raw_log_file_header().span())); |
| 107 | full_header = raw_header_reader->log_file_header(); |
| 108 | } |
| 109 | std::cout << aos::FlatbufferToJson(full_header, |
Austin Schuh | 2f8fd75 | 2020-09-01 22:38:28 -0700 | [diff] [blame] | 110 | {.multi_line = FLAGS_pretty, |
| 111 | .max_vector_size = static_cast<size_t>( |
| 112 | FLAGS_max_vector_size)}) |
| 113 | << std::endl; |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 114 | |
| 115 | while (true) { |
Austin Schuh | add6eb3 | 2020-11-09 21:24:26 -0800 | [diff] [blame] | 116 | std::optional< |
| 117 | aos::SizePrefixedFlatbufferVector<aos::logger::MessageHeader>> |
| 118 | message = reader.ReadMessage(); |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 119 | if (!message) { |
| 120 | break; |
| 121 | } |
Brian Silverman | 8ff74aa | 2021-02-05 16:37:15 -0800 | [diff] [blame] | 122 | const auto *const channels = full_header->configuration()->channels(); |
| 123 | const size_t channel_index = message.value().message().channel_index(); |
| 124 | CHECK_LT(channel_index, channels->size()); |
| 125 | const aos::Channel *const channel = channels->Get(channel_index); |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 126 | |
Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 127 | if (message.value().message().data() != nullptr) { |
| 128 | CHECK(channel->has_schema()); |
| 129 | |
| 130 | CHECK(flatbuffers::Verify(*channel->schema(), |
| 131 | *channel->schema()->root_table(), |
| 132 | message.value().message().data()->data(), |
| 133 | message.value().message().data()->size())) |
| 134 | << ": Corrupted flatbuffer on " << channel->name()->c_str() << " " |
| 135 | << channel->type()->c_str(); |
| 136 | } |
| 137 | |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 138 | if (FLAGS_format_raw && message.value().message().data() != nullptr) { |
| 139 | std::cout << aos::configuration::StrippedChannelToString(channel) << " " |
Ravago Jones | cf453ab | 2020-05-06 21:14:53 -0700 | [diff] [blame] | 140 | << aos::FlatbufferToJson( |
| 141 | message.value(), |
Ravago Jones | 5cc9df5 | 2020-09-02 21:29:58 -0700 | [diff] [blame] | 142 | {.multi_line = FLAGS_pretty, .max_vector_size = 4}) |
Ravago Jones | cf453ab | 2020-05-06 21:14:53 -0700 | [diff] [blame] | 143 | << ": " |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 144 | << aos::FlatbufferToJson( |
| 145 | channel->schema(), |
| 146 | message.value().message().data()->data(), |
Ravago Jones | 5cc9df5 | 2020-09-02 21:29:58 -0700 | [diff] [blame] | 147 | {FLAGS_pretty, |
| 148 | static_cast<size_t>(FLAGS_max_vector_size)}) |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 149 | << std::endl; |
| 150 | } else { |
| 151 | std::cout << aos::configuration::StrippedChannelToString(channel) << " " |
Ravago Jones | cf453ab | 2020-05-06 21:14:53 -0700 | [diff] [blame] | 152 | << aos::FlatbufferToJson( |
| 153 | message.value(), |
Ravago Jones | 5cc9df5 | 2020-09-02 21:29:58 -0700 | [diff] [blame] | 154 | {FLAGS_pretty, |
| 155 | static_cast<size_t>(FLAGS_max_vector_size)}) |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 156 | << std::endl; |
| 157 | } |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 158 | } |
| 159 | return 0; |
James Kuszmaul | 38735e8 | 2019-12-07 16:42:06 -0800 | [diff] [blame] | 160 | } |
| 161 | |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 162 | if (argc < 2) { |
| 163 | LOG(FATAL) << "Expected at least 1 logfile as an argument."; |
| 164 | } |
| 165 | |
Ravago Jones | 6b23e17 | 2020-12-05 17:39:01 -0800 | [diff] [blame] | 166 | const std::vector<std::string> unsorted_logfiles = |
| 167 | aos::logger::FindLogs(argc, argv); |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 168 | |
Austin Schuh | 11d4373 | 2020-09-21 17:28:30 -0700 | [diff] [blame] | 169 | const std::vector<aos::logger::LogFile> logfiles = |
Austin Schuh | 5212cad | 2020-09-09 23:12:09 -0700 | [diff] [blame] | 170 | aos::logger::SortParts(unsorted_logfiles); |
| 171 | |
Austin Schuh | fe3fb34 | 2021-01-16 18:50:37 -0800 | [diff] [blame] | 172 | for (auto &it : logfiles) { |
| 173 | VLOG(1) << it; |
| 174 | } |
| 175 | |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 176 | aos::logger::LogReader reader(logfiles); |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 177 | |
Austin Schuh | 746690f | 2020-08-01 16:15:57 -0700 | [diff] [blame] | 178 | aos::FastStringBuilder builder; |
| 179 | |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 180 | aos::SimulatedEventLoopFactory event_loop_factory(reader.configuration()); |
| 181 | reader.Register(&event_loop_factory); |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 182 | |
| 183 | std::vector<std::unique_ptr<aos::EventLoop>> printer_event_loops; |
| 184 | |
James Kuszmaul | 912af07 | 2020-10-31 16:06:54 -0700 | [diff] [blame] | 185 | bool found_channel = false; |
| 186 | |
Austin Schuh | 0767662 | 2021-01-21 18:59:17 -0800 | [diff] [blame] | 187 | for (const aos::Node *node : |
| 188 | aos::configuration::GetNodes(event_loop_factory.configuration())) { |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 189 | std::unique_ptr<aos::EventLoop> printer_event_loop = |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 190 | event_loop_factory.MakeEventLoop("printer", node); |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 191 | printer_event_loop->SkipTimingReport(); |
| 192 | printer_event_loop->SkipAosLog(); |
| 193 | |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 194 | struct MessageInfo { |
| 195 | std::string node_name; |
| 196 | std::unique_ptr<aos::RawFetcher> fetcher; |
| 197 | }; |
| 198 | std::vector<MessageInfo> messages_before_start; |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 199 | |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 200 | const flatbuffers::Vector<flatbuffers::Offset<aos::Channel>> *channels = |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 201 | printer_event_loop->configuration()->channels(); |
| 202 | |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 203 | for (flatbuffers::uoffset_t i = 0; i < channels->size(); i++) { |
| 204 | const aos::Channel *channel = channels->Get(i); |
| 205 | const flatbuffers::string_view name = channel->name()->string_view(); |
| 206 | const flatbuffers::string_view type = channel->type()->string_view(); |
| 207 | if (name.find(FLAGS_name) != std::string::npos && |
| 208 | type.find(FLAGS_type) != std::string::npos) { |
| 209 | if (!aos::configuration::ChannelIsReadableOnNode( |
| 210 | channel, printer_event_loop->node())) { |
| 211 | continue; |
| 212 | } |
| 213 | VLOG(1) << "Listening on " << name << " " << type; |
| 214 | |
| 215 | std::string node_name = |
| 216 | node == nullptr ? "" |
| 217 | : std::string(node->name()->string_view()) + " "; |
| 218 | |
| 219 | CHECK_NOTNULL(channel->schema()); |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 220 | |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 221 | // Fetch the last message on this channel from before the log start |
| 222 | // time. |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 223 | if (FLAGS_fetch) { |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 224 | std::unique_ptr<aos::RawFetcher> fetcher = |
| 225 | printer_event_loop->MakeRawFetcher(channel); |
| 226 | if (fetcher->Fetch()) { |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 227 | MessageInfo message{.node_name = node_name, |
| 228 | .fetcher = std::move(fetcher)}; |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 229 | // Insert it sorted into the vector so we can print in time order |
| 230 | // instead of channel order at the start. |
| 231 | auto it = std::lower_bound( |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 232 | messages_before_start.begin(), messages_before_start.end(), |
| 233 | message, [](const MessageInfo &lhs, const MessageInfo &rhs) { |
| 234 | if (lhs.fetcher->context().monotonic_event_time < |
| 235 | rhs.fetcher->context().monotonic_event_time) { |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 236 | return true; |
| 237 | } |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 238 | if (lhs.fetcher->context().monotonic_event_time > |
| 239 | rhs.fetcher->context().monotonic_event_time) { |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 240 | return false; |
| 241 | } |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 242 | return lhs.fetcher->channel() < rhs.fetcher->channel(); |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 243 | }); |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 244 | messages_before_start.insert(it, std::move(message)); |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 245 | } |
| 246 | } |
| 247 | |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 248 | printer_event_loop->MakeRawWatcher( |
Ravago Jones | 5cc9df5 | 2020-09-02 21:29:58 -0700 | [diff] [blame] | 249 | channel, [channel, node_name, &builder](const aos::Context &context, |
| 250 | const void * /*message*/) { |
Austin Schuh | 569c7f9 | 2020-12-11 20:01:42 -0800 | [diff] [blame] | 251 | if (FLAGS_print) { |
| 252 | PrintMessage(node_name, channel, context, &builder); |
| 253 | } |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 254 | }); |
| 255 | found_channel = true; |
| 256 | } |
| 257 | } |
| 258 | |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 259 | // Print the messages from before the log start time. |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 260 | // TODO(austin): Sort between nodes too when it becomes annoying enough. |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 261 | for (const MessageInfo &message : messages_before_start) { |
Austin Schuh | 569c7f9 | 2020-12-11 20:01:42 -0800 | [diff] [blame] | 262 | if (FLAGS_print) { |
| 263 | PrintMessage(message.node_name, message.fetcher->channel(), |
| 264 | message.fetcher->context(), &builder); |
| 265 | } |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 266 | } |
Austin Schuh | 6f3babe | 2020-01-26 20:34:50 -0800 | [diff] [blame] | 267 | printer_event_loops.emplace_back(std::move(printer_event_loop)); |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 268 | |
| 269 | std::cout << std::endl; |
Austin Schuh | ee71105 | 2020-08-24 16:06:09 -0700 | [diff] [blame] | 270 | std::cout << (node != nullptr ? (node->name()->str() + " ") : "") |
| 271 | << "Log starting at " << reader.realtime_start_time(node) << " (" |
| 272 | << reader.monotonic_start_time(node) << ")"; |
Brian Silverman | 9891b29 | 2020-06-23 16:34:22 -0700 | [diff] [blame] | 273 | std::cout << std::endl << std::endl; |
James Kuszmaul | 38735e8 | 2019-12-07 16:42:06 -0800 | [diff] [blame] | 274 | } |
| 275 | |
James Kuszmaul | 912af07 | 2020-10-31 16:06:54 -0700 | [diff] [blame] | 276 | if (!found_channel) { |
| 277 | LOG(FATAL) << "Could not find any channels"; |
| 278 | } |
| 279 | |
Austin Schuh | a81454b | 2020-05-12 19:58:36 -0700 | [diff] [blame] | 280 | if (FLAGS_fetch) { |
| 281 | // New line to separate fetched messages from non-fetched messages. |
| 282 | std::cout << std::endl; |
| 283 | } |
| 284 | |
| 285 | event_loop_factory.Run(); |
James Kuszmaul | 38735e8 | 2019-12-07 16:42:06 -0800 | [diff] [blame] | 286 | |
Austin Schuh | 51a9259 | 2020-08-09 13:17:00 -0700 | [diff] [blame] | 287 | reader.Deregister(); |
| 288 | |
James Kuszmaul | 38735e8 | 2019-12-07 16:42:06 -0800 | [diff] [blame] | 289 | return 0; |
| 290 | } |