1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-13 03:19:58 +03:00

s/dmesg/bootlog/

This commit is contained in:
Ray Morris 2025-05-27 13:39:53 -05:00
parent fc6d9c4bc1
commit fd971725c9
4 changed files with 15 additions and 19 deletions

View file

@ -73,10 +73,9 @@ While connected to the CLI, all Logical Switches are temporarily disabled (5.1.0
| `beeper` | Show/set beeper (buzzer) [usage](Buzzer.md) | | `beeper` | Show/set beeper (buzzer) [usage](Buzzer.md) |
| `bind_rx` | Initiate binding for SRXL2 or CRSF receivers | | `bind_rx` | Initiate binding for SRXL2 or CRSF receivers |
| `blackbox` | Configure blackbox fields | | `blackbox` | Configure blackbox fields |
| `bootlog` | Show boot events | | `bootlog` | Show init logs from [serial_printf_debugging](./development/serial_printf_debugging.md) |
| `color` | Configure colors | | `color` | Configure colors |
| `defaults` | Reset to defaults and reboot | | `defaults` | Reset to defaults and reboot |
| `dmesg` | Show init logs from [serial_printf_debugging](./development/serial_printf_debugging.md) |
| `dfu` | DFU mode on reboot | | `dfu` | DFU mode on reboot |
| `diff` | List configuration changes from default | | `diff` | List configuration changes from default |
| `dump` | Dump configuration | | `dump` | Dump configuration |

View file

@ -6,7 +6,7 @@ INAV offers a function to use serial `printf` style debugging.
This provides a simple and intuitive debugging facility. This provides a simple and intuitive debugging facility.
This facility is only available after the serial sub-system has been initialised, but logs generated prior to serial This facility is only available after the serial sub-system has been initialised, but logs generated prior to serial
initialization can be obtained via the `dmesg` functionality. initialization can be obtained via the `bootlog` functionality.
In order to use this feature, the source file must include `common/log.h`. In order to use this feature, the source file must include `common/log.h`.
@ -140,11 +140,11 @@ For the Configurator, debug messages are shown in the developer console log.
Note: The numeric value in square brackets is the FC uptime in seconds. Note: The numeric value in square brackets is the FC uptime in seconds.
To see printf-style log messages generated prior serial initialization, reserve about 2KB-4KB RAM to buffer the To see printf-style log messages generated prior serial initialization, reserve about 2KB RAM to buffer the
log) by defining DMESG_SIZE: log) by defining USE_BOOTLOG:
#define DMESG_SIZE 2048 #define USE_BOOTLOG 2048
Then `make clean` and `make`. Then `make clean` and `make`.
Then in the CLI you can run `dmesg` to see the buffered log. Then in the CLI you can run `bootlog` to see the buffered log.
Note dmesg also requires that a serial port be defined for serial debugging. Note dmesg also requires that a serial port be defined for serial debugging.

View file

@ -61,8 +61,8 @@ PG_RESET_TEMPLATE(logConfig_t, logConfig,
.topics = SETTING_LOG_TOPICS_DEFAULT .topics = SETTING_LOG_TOPICS_DEFAULT
); );
#if defined(DMESG_SIZE) #if defined(USE_BOOTLOG)
char dmesg_buffer[DMESG_SIZE]; char dmesg_buffer[USE_BOOTLOG];
char *dmesg_head = dmesg_buffer; char *dmesg_head = dmesg_buffer;
#endif #endif
@ -141,8 +141,8 @@ static void logPrint(const char *buf, size_t size)
mspSerialPushPort(MSP_DEBUGMSG, (uint8_t*)buf, size, mspLogPort, MSP_V2_NATIVE); mspSerialPushPort(MSP_DEBUGMSG, (uint8_t*)buf, size, mspLogPort, MSP_V2_NATIVE);
} }
#ifdef DMESG_SIZE #ifdef USE_BOOTLOG
if ( (dmesg_head + size + 2) < (dmesg_buffer + DMESG_SIZE) ) { if ( (dmesg_head + size + 2) < (dmesg_buffer + USE_BOOTLOG) ) {
for (unsigned int ii = 0; ii < size; ii++) { for (unsigned int ii = 0; ii < size; ii++) {
*dmesg_head = buf[ii]; *dmesg_head = buf[ii];
dmesg_head++; dmesg_head++;

View file

@ -130,8 +130,8 @@ bool cliMode = false;
extern timeDelta_t cycleTime; // FIXME dependency on mw.c extern timeDelta_t cycleTime; // FIXME dependency on mw.c
extern uint8_t detectedSensors[SENSOR_INDEX_COUNT]; extern uint8_t detectedSensors[SENSOR_INDEX_COUNT];
#ifdef DMESG_SIZE #ifdef USE_BOOTLOG
extern char dmesg_buffer[DMESG_SIZE]; extern char dmesg_buffer[USE_BOOTLOG];
extern char *dmesg_head; extern char *dmesg_head;
#endif #endif
@ -4803,10 +4803,10 @@ static void cliUbloxPrintSatelites(char *arg)
} }
#endif #endif
#ifdef DMESG_SIZE #ifdef USE_BOOTLOG
static void printDmesg(char *cmdline __attribute__((unused))) { static void printDmesg(char *cmdline __attribute__((unused))) {
int size = dmesg_head - dmesg_buffer; int size = dmesg_head - dmesg_buffer;
cliPrintLinef("log size written: %i", size); cliPrintLinef("log size written: %i of %i bytes reserved", size, USE_BOOTLOG);
for (int ii = 0; ii < size; ii++) { for (int ii = 0; ii < size; ii++) {
cliWrite(dmesg_buffer[ii]); cliWrite(dmesg_buffer[ii]);
} }
@ -4833,7 +4833,7 @@ const clicmd_t cmdTable[] = {
CLI_COMMAND_DEF("bind_rx", "initiate binding for RX SPI or SRXL2", NULL, cliRxBind), CLI_COMMAND_DEF("bind_rx", "initiate binding for RX SPI or SRXL2", NULL, cliRxBind),
#endif #endif
#if defined(USE_BOOTLOG) #if defined(USE_BOOTLOG)
CLI_COMMAND_DEF("bootlog", "show boot events", NULL, cliBootlog), CLI_COMMAND_DEF("bootlog", "show boot log", NULL, printDmesg),
#endif #endif
#ifdef USE_LED_STRIP #ifdef USE_LED_STRIP
CLI_COMMAND_DEF("color", "configure colors", NULL, cliColor), CLI_COMMAND_DEF("color", "configure colors", NULL, cliColor),
@ -4844,9 +4844,6 @@ const clicmd_t cmdTable[] = {
CLI_COMMAND_DEF("dfu", "DFU mode on reboot", NULL, cliDfu), CLI_COMMAND_DEF("dfu", "DFU mode on reboot", NULL, cliDfu),
CLI_COMMAND_DEF("diff", "list configuration changes from default", CLI_COMMAND_DEF("diff", "list configuration changes from default",
"[master|battery_profile|control_profile|mixer_profile|rates|all] {showdefaults}", cliDiff), "[master|battery_profile|control_profile|mixer_profile|rates|all] {showdefaults}", cliDiff),
#ifdef DMESG_SIZE
CLI_COMMAND_DEF("dmesg", "init log (DMESG_SIZE)", NULL, printDmesg),
#endif
CLI_COMMAND_DEF("dump", "dump configuration", CLI_COMMAND_DEF("dump", "dump configuration",
"[master|battery_profile|control_profile|mixer_profile|rates|all] {showdefaults}", cliDump), "[master|battery_profile|control_profile|mixer_profile|rates|all] {showdefaults}", cliDump),
#ifdef USE_RX_ELERES #ifdef USE_RX_ELERES