From 50f9d2601f2a7944e6f52f1f0743ea3d2ef86a6b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 Oct 2021 17:32:10 +1100 Subject: [PATCH] AP_Arming: log key @SYS files on arming --- libraries/AP_Arming/AP_Arming.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index e8ea152578..3cce73d0c0 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -1348,6 +1348,25 @@ bool AP_Arming::arm(AP_Arming::Method method, const bool do_arming_checks) armed = false; } +#if HAL_LOGGER_FILE_CONTENTS_ENABLED + /* + log files useful for diagnostics on arming. We log on arming as + with LOG_DISARMED we don't want to log the statistics at boot or + we wouldn't get a realistic idea of key system values + Note that some of these files may not exist, in that case they + are ignored + */ + static const char *log_content_filenames[] = { + "@SYS/uarts.txt", + "@SYS/dma.txt", + "@SYS/memory.txt", + "@SYS/threads.txt", + "@ROMFS/hwdef.dat", + }; + for (const auto *name : log_content_filenames) { + AP::logger().log_file_content(name); + } +#endif return armed; }