Commit Graph

61 Commits

Author SHA1 Message Date
Peter Barker 5e63ed908e AP_Logger: loosen constraint on failing to log replay block
// things will almost certainly go sour.  However, if we are not
    // logging while disarmed then the EKF can be started and trying
    // to log things even 'though the backends might be saying "no".
2021-03-18 19:38:43 +11:00
Patrick José Pereira 18d8f19801 AP_Logger: Add missing const in member functions
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2021-02-03 18:45:14 +11:00
Peter Barker dbae56eb3a AP_Logger: panic in SITL if we fail to log a Replay block
// failing to log a block means that when we go to replay the log
    // things will almost certainly go sour.
2021-01-31 10:46:26 +11:00
Andrew Tridgell dc57454ac5 AP_Logger: adjust stack sizes 2021-01-10 08:28:55 +11:00
Peter Barker 7d42f473fc AP_Logger: allow each backend to be compiled out 2021-01-08 12:48:55 +11:00
Andy Piper b3946a667c AP_Logger: omnibusF4pro needs more stack for logging and logging needs to take precedence over ftp 2021-01-07 07:43:52 +11:00
Peter Barker ef0b860a48 AP_Logger: remove Prep and NeedPrep functions
These were only being called directly after Init(), so just tacked them
onto the end of those functions.

The checks in NeedPrep turned out to be mostly redundant.
2021-01-06 18:25:21 +11:00
Andy Piper 779c2a9e5f AP_Logger: move logger IO to a separate thread 2021-01-02 22:30:08 +11:00
Andrew Tridgell 0ae9b28198 AP_Logger: added get_log_start_count()
used by UAVCAN to know if it should log CAN devices on log rotation
2021-01-01 17:30:14 +11:00
Andrew Tridgell 019544ceb1 AP_Logger: allow for replay with both EKF enabled
even when one is disabled in the original log
2020-11-17 13:45:07 +11:00
Andrew Tridgell 04f60001ff AP_Logger: allow WriteV() to work within Replay
save formats for lookup by WriteV
2020-11-16 10:28:43 +11:00
Andrew Tridgell a08a1a4247 AP_Logger: allow for larger LOG_FILE_BUFSIZE
larger sizes on F7 and H7 allow for much more rapid loggging
2020-11-10 16:15:45 +11:00
Andrew Tridgell 851cb30e0d AP_Logger: speed up startup with replay if LOG_DISARMED=0 2020-11-10 16:15:45 +11:00
Andrew Tridgell 09aff03edc AP_Logger: support new replay system
added allow_start_ekf and block write method for replay

Co-authored-by: Peter Barker <pbarker@barker.dropbear.id.au>
2020-11-10 16:15:45 +11:00
Andrew Tridgell daa0abeb13 AP_Logger: make structure check errors clearer
add message name to more error messages
2020-11-10 16:15:45 +11:00
Peter Barker 8e6cde25dc AP_Logger: keep pointer to link rather than using its ->chan 2020-09-25 09:01:00 +10:00
Andrew Tridgell 930726ca9a AP_Logger: fixed string warnings 2020-09-15 09:40:03 +10:00
Andy Piper ccb583d092 AP_Logger: make block logger conform to mavlink expectations of numbering
add support for log time to block logger
refactor rotation into backed. Don't start logs when erasing
correct log start logic
separate read and write points so that requesting log information does not corrupt the current log
when starting a new log stop logging first
clear the write buffer when starting a new log
insert utc time when requesting info for the current log
stop logging and request formats again when starting a new log
cope with erase happening while we are logging
keep pushing out startup messages even when format messages are done
don't log to the gcs in the io thread
don't start new logs in the io thread
don't validate logs while erasing
flush logs when stopping logging
account for page header when calculating logs sizes
don't return data when asked for more data than in the log
optimize locking and use separate semaphore to mediate ring buffer access
stop logging when the chip is full and send a notification
calculate logs sizes correctly even when they wrap
read log data correctly even when it wraps
add stats support to block logger
reset dropped when starting a new log
fail logging when the chip is full
refactor critical bufferspace checks
increase messagewriter budget to 250us and to 300us for FMT
2020-09-05 10:20:39 +10:00
Peter Barker 0e964a4654 AP_Logger: use config error loop rather than abort
Also add a specific check for the length of the labels field
2020-06-10 09:02:35 +10:00
Iampete1 fee5b998bf AP_Logger: add min MB free param 2020-06-09 09:23:25 +10:00
Andrew Tridgell 97f335396b AP_Scripting: fixed memory leak 2020-05-19 09:09:48 +10:00
Peter Hall 19ba9abc89 AP_Logger: add function and make public for scripting use 2020-05-19 09:09:48 +10:00
Peter Barker 7befe84f0c AP_Logger: create and use INTERNAL_ERROR macro so we get line numbers 2020-04-30 13:21:36 +10:00
Peter Barker acba2a78f6 AP_Logger: add message validation check against duplicate labels 2020-04-14 12:30:58 +10:00
murata 264a90bb45 AP_Logger: Change to coding style (NFC)
AP_Logger: Change to coding style (NFC)
2020-04-07 20:37:33 +09:00
Peter Barker 8679e95fca AP_Logger: add comments about message_writer being leaked
These are really "shouldn't happen", and only happen at startup, so
impact of the memory leak is quite limited.

Fixing this requires putting in a virtual destructor on the
MessageWriter class - this and the calls add up to several hundred bytes
of flash.
2020-03-12 15:10:42 +11:00
Andrew Tridgell 56035fa5a1 AP_Logger: add a semaphore to protect creation of new log formats 2020-01-17 00:54:00 +11:00
Randy Mackay 6aff18d22d AP_Logger: remove non-error init messages 2020-01-16 16:47:28 +11:00
Andy Piper 54b6e7b264 AP_Logger: mavlink backend needs to be the last backend
be really careful to catch aborted erases
take care to protect shared structures in io thread
if flash corruption is detected try and recover whole files
overwrite format in erase to make sure erase happens
output useful messages at critical times
a block is 64k a sector is 4k, rename internal variables appropriately
cope with log wrapping when sending log listings over mavlink
2020-01-02 18:18:04 +11:00
Peter Barker f337d011e7 AP_Logger: make LogEvent an enum class, split off LogDataID
We were mixing the enumeration values across different messages, which
isn't great
2019-11-05 08:19:26 +08:00
Michael du Breuil c369139be0 AP_Logger: Support new ModeReason 2019-10-25 08:48:22 +08:00
Andrew Tridgell 889b18022b AP_Logger: use HAL_MEM_CLASS for logging buffer size 2019-10-01 09:29:55 +10:00
Andrew Tridgell df4cb00970 AP_Logger: added LOG_FILE_TIMEOUT parameter
this allows for cards to be removed and re-inserted while continuing
logging
2019-08-27 15:40:43 +10:00
Andrew Tridgell 667b4e045a AP_Logger: convert to use AP_Filesystem 2019-08-27 15:40:43 +10:00
Peter Barker b2d9d7b6a0 AP_Logger: const-struct many structures, use temp for navekf object 2019-08-06 11:45:04 +10:00
Pierre Kancir 781e9ae9c1 AP_Logger: pass mavlink_message_t by const reference 2019-07-16 20:51:42 +10:00
Peter Barker 502f74f0d9 AP_Logger: switch to using stderr for log structure debug
The console output doesn't seem to appear anywhere now.
2019-07-05 12:05:27 +10:00
Andrew Tridgell dd3eec2a38 AP_Logger: persist logging for 15s after disarm or arming failure
this will provide useful information in logs on disarms in flight or
reasons for arming failure
2019-06-21 11:40:53 +10:00
Peter Barker 5f877294c9 AP_Logger: re-add lost validate_structure loop
Lost with bad rebase
2019-06-12 10:05:59 +10:00
Peter Barker cd0265644d AP_Logger: disable float-mult-zero sanity check for the time being 2019-06-12 10:05:59 +10:00
Peter Barker a5f5b4349c AP_Logger: add a Write_Rally method 2019-05-22 08:53:45 +10:00
Peter Barker 54eff7eafc AP_Logger: add WriteCritical method to AP::logger()
For callers who emphatically want their custom messages to be written out.
2019-05-16 17:21:24 +10:00
Andrew Tridgell 24c5bf42ae AP_Logger: force logging on an armed watchdog reset
and don't clear sdcard space
2019-04-22 16:53:35 +10:00
Tom Pittenger 027f9afcf8 AP_logger: rename dataflash to logger and refactor the filename logger.bin 2019-03-28 16:40:58 +11:00
Peter Barker d2a683a758 AP_Logger: move Log_Write_Error into library 2019-03-27 12:36:40 +11:00
Peter Barker bd8a27476e AP_Logger: make structure validation failure at runtime fatal 2019-03-26 10:18:05 +11:00
Peter Barker ee690e7ab9 AP_Logger: use AP_InternalError for tracking internal errors 2019-03-21 21:34:33 +11:00
Randy Mackay cf8a7fd423 AP_Logger: add values to backend-type param description 2019-03-09 14:22:28 +09:00
Peter Barker 539000df40 AP_Logger: remove more DataFlash references
Also strongly type the backend type
2019-03-02 22:28:13 +11:00
Peter Barker dfa5a423ec AP_Logger: add sanity check that trigger for bad float multipliers 2019-03-01 15:43:46 +11:00