Skip to content

scripts: add sgl-telemetry-collect for EDAC and system data - #44

Draft
mrpollo wants to merge 1 commit into
mainfrom
feature/telemetry-collect
Draft

mrpollo wants to merge 1 commit into
mainfrom
feature/telemetry-collect

Conversation

@mrpollo

@mrpollo mrpollo commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Adds a portable shell script that collects system telemetry from SGL deployments, focused on EDAC (Error Detection and Correction) data and hardware error events. The goal is to enable teams running SGL in space or radiation environments to share anonymizable telemetry for aggregate analysis — similar to logs.px4.io but for space-grade Linux.

  • Collects kernel version, architecture, uptime, CPU/memory info
  • Reads EDAC memory controller data from sysfs (correctable/uncorrectable error counts per MC and DIMM)
  • Extracts EDAC/MCE/hardware error lines from dmesg
  • Copies rasdaemon SQLite database if available
  • Captures board identity (devicetree model, DMI) and SGL distro version
  • Outputs a JSON report + tarball ready for upload
  • Pure POSIX shell, no dependencies beyond coreutils

This is a draft, the upload destination and telemetry platform are TBD. Filed as a starting point for discussion at the SGL SIG.

Sample output:

Report: /tmp/sgl-telemetry/20260402T161902Z/report.json
{
  "schema_version": "1.0",
  "collected_at": "20260402T161902Z",
  "system": {
    "kernel_version": "6.6.111-yocto-standard",
    "arch": "aarch64",
    "hostname": "qemuarm64",
    "uptime_seconds": 233.57,
    "cpu_count": 1,
    "mem_total_kb": 425392
  },
  "platform": {
    "board_model": "linux,dummy-virt"
  },
  "edac": {
    "memory_controllers": [],
    "dmesg_ce_count": 0,
    "dmesg_ue_count": 0,
    "dmesg_mce_count": 0
  }
}

Add a portable shell script that collects system telemetry for analysis:
- Kernel version, architecture, uptime
- Board/platform identity (devicetree, DMI)
- CPU and memory info
- EDAC memory controller data from sysfs
- EDAC/MCE error counts from dmesg
- rasdaemon SQLite database if available
- SGL distro version

Outputs a JSON report and tarball suitable for upload to a telemetry
platform. Designed to run on any SGL deployment with BusyBox or full
coreutils — tested on SGL QEMU ARM64.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
@mrpollo
mrpollo force-pushed the feature/telemetry-collect branch from 4a255b7 to 98fd8c9 Compare April 2, 2026 16:18
@mrpollo
mrpollo marked this pull request as ready for review April 2, 2026 16:21
@robwoolley

Copy link
Copy Markdown
Contributor

This is a great idea to start the discussion. May I suggest we formally mark it as a draft so we know it is open for discussion?

@mrpollo
mrpollo marked this pull request as draft April 4, 2026 01:17
@mrpollo

mrpollo commented Apr 4, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @robwoolley I was testing things out in QEMU during the call, but I'm obviously guessing with the EDAC stuff, would be nice to get someone to test this on actual hardware. Maybe a BeagleV fire? ;)

@robwoolley

Copy link
Copy Markdown
Contributor

That sounds like a great thing to explore. I see that there is a CoreEDAC IP block that can be loaded onto the FPGA: https://www.microchip.com/en-us/products/fpgas-and-plds/ip-core-tools/coreedac

However, I don't see a software interface mentioned in the CoreEDAC user guide or a corresponding EDAC driver for the Linux kernel: https://github.com/linux4microchip/linux/tree/linux-6.12-mchp/drivers/edac

I suggest we reach out to Microchip to ask about investigating this further on the BeagleV-Fire and other PolarFire SoC boards.

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.

2 participants