Commit Graph
7 Commits
Author SHA1 Message Date
iceman1001andClaude Opus 5 (1M context) 344c2d6185 trace: stop trace save writing a stale client side buffer
`trace save` saved the client side trace buffer whenever it was non-empty
and only downloaded from device when it was empty. After `trace load` or
`trace list -1` a following sniff -> `trace save` silently wrote the old
trace, byte identical to the previous save, with no way to reset it.
See #3592, and #1252 / #1512 for earlier reports of the same thing.

- `trace save` now downloads from device by default and takes `-1` to save
  the client side buffer, mirroring `trace list`. Offline it falls back to
  the buffer so `trace load` -> `trace save` still works.
- split download_trace() into download_trace_ex(), which hands the caller
  its own buffer. `trace save` uses it and no longer mutates gs_trace, so
  `-1` means the client buffer regardless of what ran before.
- download_trace() freed gs_trace before it knew the download had worked,
  so a timeout threw away a loaded trace. It now swaps on success only.
- added `trace clear` to discard the client side buffer, and a shared
  ClearTraceBuffer() to replace the free/NULL/zero pattern that was
  open coded in ImportTraceBuffer() and CmdTraceLoad().

Help text for both new commands names the device vs client distinction.

Co-Authored-By: Claude Opus 5 (1M context)
2026-09-12 21:39:35 +02:00
iceman1001 2e2fa850bb const params, vars, scope, bad if statements 2024-05-14 12:25:00 +02:00
Anonymous 117aa46e9e cmdflashmemspiffs.c: allow dump from SPIFFS to trace buffer without saving to local fs 2023-12-27 00:00:01 -05:00
Philippe Teuwen 30aa7aa7d1 Adapting license headers, WIP 2022-01-08 00:40:52 +01:00
Philippe Teuwen 2e925d5da3 hf 14a list & CmdTraceListAlias: simplify 2021-04-19 21:21:47 +02:00
Philippe Teuwen 4dea429157 hf 14a list helptext handling by CmdTraceListAlias, to be generalized if ok 2021-04-19 14:35:09 +02:00
Bjoern Kerler 81bc0bc2b9 Reorder client src directories 2020-04-16 10:53:24 +02:00