diff options
| author | Felix Fietkau | 2026-01-16 08:49:46 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2026-01-16 08:49:46 +0000 |
| commit | 875e1a7af6ca9d86524d18169c3a79f4a1920053 (patch) | |
| tree | 3778b6e3afb5e316168dfc53ff28e6fa9a860304 | |
| parent | c5c493ed5787ca067ab1a713061ae02f0bb17046 (diff) | |
| download | udebug-master.tar.gz | |
Works like logstream but only dumps existing ring buffer data
without waiting for more.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
| -rwxr-xr-x | udebug-cli | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -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') { |