Public Access
S1 #11: the System App: tasks, memory, network and system, live
Five views, Tab between them: Overview (each core's load, memory, traffic, battery, two minutes of load), Tasks (share of a core over the last second, lowest free stack, flagged under 512 bytes; `s` sorts), Memory (free heap against the floors of Q86), Network (bytes per service, and what's moving now), System (what `info` prints, plus battery, card, radio, GNSS). It samples once a second and keeps history only while open. The arithmetic is host-tested, including the trap found on the device: a task's run-time counter only moves when it's switched out, so the task that samples (the main loop, alone on its core) gets what's left of its core. `tasks` now samples across a second of normal running instead of inside its own wait. The main loop uses 100 % of core 1 at rest (#40). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
@@ -3,7 +3,10 @@
|
||||
#include <Print.h>
|
||||
#include <esp_partition.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "key_value_store.h"
|
||||
#include "task_stats.h"
|
||||
|
||||
namespace roro::system_info {
|
||||
|
||||
@@ -20,7 +23,12 @@ void printSlots(Print& out, KeyValueStore& store);
|
||||
// Remembers which version the running slot holds (call at boot), or the slot an update just wrote.
|
||||
void recordSlotVersion(KeyValueStore& store, const esp_partition_t* slot, const char* version);
|
||||
// FreeRTOS tasks: state, priority, lowest free stack, CPU share since boot.
|
||||
void printTasks(Print& out);
|
||||
// The tasks' shares since `before` was sampled (with its run-time clock). The caller lets the main
|
||||
// loop run in between: sampling twice inside one command would show the loop asleep.
|
||||
void printTasks(Print& out, const std::vector<TaskSample>& before, uint32_t beforeTotal);
|
||||
// Every task as FreeRTOS reports it now; returns the run-time clock (microseconds, 32 bits), to
|
||||
// pair with the samples. Two of these make the shares the System App and `tasks` show.
|
||||
uint32_t sampleTasks(std::vector<TaskSample>& out);
|
||||
|
||||
// Boots the firmware in the other app slot if it holds a valid image (a manual Rollback).
|
||||
// Returns an error message; on success it restarts and doesn't return.
|
||||
|
||||
Reference in New Issue
Block a user