Skip to content

AP_Logger: include disk space details in out-of-space debug messages - #34081

Open
muramura wants to merge 1 commit into
ArduPilot:masterfrom
muramura:logger-out-of-space-details
Open

AP_Logger: include disk space details in out-of-space debug messages#34081
muramura wants to merge 1 commit into
ArduPilot:masterfrom
muramura:logger-out-of-space-details

Conversation

@muramura

Copy link
Copy Markdown
Contributor

Summary

Enhance "Out of space for logging" debug messages in AP_Logger_File to include available, total, and minimum required disk space details.

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

Testing Details:

  • Built successfully for esp32s3m5stampfly target.
  • Tested on ESP32-S3 hardware (M5StampFly with FlashFS FAT storage).
  • Verified that debug messages correctly output avail, total, and min values to the MAVLink/MAVProxy console when free space threshold is triggered.

AFTER
スクリーンショット 2026-08-16 17 16 47

BEFORE
スクリーンショット 2026-08-15 19 53 25

Description

When AP_Logger_File encounters an "Out of space for logging" condition (during file open, periodic space checks, or ENOSPC write errors), it previously only printed the generic string "Out of space for logging\n" via DEV_PRINTF.

This made it difficult to diagnose why logging was refused or stopped—for example, whether the filesystem was completely full, or if the available space simply fell below the configured threshold (_free_space_min_avail / LOG_FILE_MB_FREE).

This PR enhances all 3 DEV_PRINTF sites in AP_Logger_File.cpp to report:

  • avail: Current available disk space in bytes (disk_space_avail())
  • total: Total disk space in bytes (disk_space())
  • min: Minimum required available space threshold in bytes (_free_space_min_avail)

Example Output:

Out of space for logging: avail=0 total=4771840 min=262144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant