summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2026-01-16 08:49:46 +0000
committerFelix Fietkau2026-01-16 08:49:46 +0000
commit875e1a7af6ca9d86524d18169c3a79f4a1920053 (patch)
tree3778b6e3afb5e316168dfc53ff28e6fa9a860304
parentc5c493ed5787ca067ab1a713061ae02f0bb17046 (diff)
downloadudebug-master.tar.gz
udebug-cli: add logdump commandHEADmaster
Works like logstream but only dumps existing ring buffer data without waiting for more. Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rwxr-xr-xudebug-cli23
1 files changed, 22 insertions, 1 deletions
diff --git a/udebug-cli b/udebug-cli
index 5d657cf..c72981c 100755
--- a/udebug-cli
+++ b/udebug-cli
@@ -36,6 +36,7 @@ Usage: ${basename(sourcepath())} [<options>] <command> [<args>]
get_flags Get ring buffer flags
stream: Stream packet data as pcap
logstream: Stream syslog data as text
+ logdump: Dump syslog data snapshot as text
Service list: space separated list of services matching the config
- <name> Enable service <name>
@@ -382,6 +383,26 @@ let cmds = {
logstream: function() {
stream_data(true);
},
+ logdump: function() {
+ open_log_out();
+
+ if (!length(selected)) {
+ _warn(`No available debug buffers\n`);
+ exit(1);
+ }
+
+ for (let ring in selected) {
+ if (open_ring(ring) == null) {
+ _warn(`Failed to open ring ${ring.proc_name}:${ring.ring_name}\n`);
+ if (opts.force)
+ continue;
+
+ exit(1);
+ }
+ }
+
+ poll_data();
+ },
reset: function() {
exit(0);
},
@@ -394,7 +415,7 @@ let cmd = shift(ARGV);
if (!cmds[cmd])
usage();
-if (cmd == "logstream")
+if (cmd == "logstream" || cmd == "logdump")
opts.log_only = true;
if (cmd == 'reset') {