project/udebug.git
3 months agoudebug-cli: add support for streaming tracing data
Felix Fietkau [Sun, 24 Aug 2025 04:32:57 +0000 (06:32 +0200)]
udebug-cli: add support for streaming tracing data

Signed-off-by: Felix Fietkau <[email protected]>
3 months agoucode: add support for fetching kernel tracepoint events
Felix Fietkau [Sat, 23 Aug 2025 21:03:16 +0000 (23:03 +0200)]
ucode: add support for fetching kernel tracepoint events

tracepoints can be opened as a ring with the same API as other udebug rings.
This allows trace events to be mixed with udebug entries

Signed-off-by: Felix Fietkau <[email protected]>
3 months agoucode: add function for getting the number of entries in a snapshot
Felix Fietkau [Sat, 23 Aug 2025 19:46:17 +0000 (21:46 +0200)]
ucode: add function for getting the number of entries in a snapshot

Signed-off-by: Felix Fietkau <[email protected]>
3 months agoucode: add ferror() call to check for closed write file descriptor
Felix Fietkau [Sun, 17 Aug 2025 09:10:49 +0000 (11:10 +0200)]
ucode: add ferror() call to check for closed write file descriptor

Fixes stale udebug stream processes when run over ssh

Signed-off-by: Felix Fietkau <[email protected]>
3 months agoudebug-cli: add support for overriding config on the command line
Felix Fietkau [Fri, 15 Aug 2025 15:31:32 +0000 (17:31 +0200)]
udebug-cli: add support for overriding config on the command line

Either by running udebug set <...> or udebug -e <...> <cmd>, you can
explicitly set, which services should be enabled.

Signed-off-by: Felix Fietkau <[email protected]>
3 months agoudebugd: add support for setting an override config
Felix Fietkau [Fri, 15 Aug 2025 14:33:21 +0000 (16:33 +0200)]
udebugd: add support for setting an override config

This makes it easier to change the config at runtime without being affected
by reload_config calls or going through uci

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoucode: fix entries/size confusion
Felix Fietkau [Wed, 23 Jul 2025 09:51:39 +0000 (11:51 +0200)]
ucode: fix entries/size confusion

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoudebug-cli: add logstream command
Felix Fietkau [Wed, 23 Jul 2025 09:00:14 +0000 (11:00 +0200)]
udebug-cli: add logstream command

This prints all log messages received on rings in string format

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoucode: add const entries for enum udebug_format
Felix Fietkau [Wed, 23 Jul 2025 08:51:43 +0000 (10:51 +0200)]
ucode: add const entries for enum udebug_format

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoucode: add function for getting ring information
Felix Fietkau [Wed, 23 Jul 2025 08:45:02 +0000 (10:45 +0200)]
ucode: add function for getting ring information

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoucode: add timestamp argument to foreach()
Felix Fietkau [Wed, 23 Jul 2025 08:23:51 +0000 (10:23 +0200)]
ucode: add timestamp argument to foreach()

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoucode: fix allocation size of local ring meta
Felix Fietkau [Tue, 22 Jul 2025 18:07:24 +0000 (20:07 +0200)]
ucode: fix allocation size of local ring meta

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoucode: allow calling udebug.init() multiple times
Felix Fietkau [Tue, 22 Jul 2025 16:06:52 +0000 (18:06 +0200)]
ucode: allow calling udebug.init() multiple times

Simplify using it from multiple places within an application

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoucode: support appending array data, similar to socket.send()
Felix Fietkau [Tue, 22 Jul 2025 15:39:21 +0000 (17:39 +0200)]
ucode: support appending array data, similar to socket.send()

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoucode: add support for specifying ring format
Felix Fietkau [Tue, 22 Jul 2025 12:31:45 +0000 (14:31 +0200)]
ucode: add support for specifying ring format

Support passing packet data from ucode

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoucode: drop use ucv_resource_create
Felix Fietkau [Tue, 22 Jul 2025 11:50:07 +0000 (13:50 +0200)]
ucode: drop use ucv_resource_create

Support running in multiple vms

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoucode: use ucv_resource_create_ex for remote rings
Felix Fietkau [Tue, 22 Jul 2025 11:41:02 +0000 (13:41 +0200)]
ucode: use ucv_resource_create_ex for remote rings

Stop using the registry

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoudebug-cli: stop event loop on write failure
Felix Fietkau [Tue, 22 Jul 2025 09:03:18 +0000 (11:03 +0200)]
udebug-cli: stop event loop on write failure

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoucode: add error reporting to pcap_write
Felix Fietkau [Tue, 22 Jul 2025 08:48:57 +0000 (10:48 +0200)]
ucode: add error reporting to pcap_write

Return null on error, true if packets were written,
false if no data available.

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoucode: use FILE handle for pcap output
Felix Fietkau [Tue, 22 Jul 2025 08:44:15 +0000 (10:44 +0200)]
ucode: use FILE handle for pcap output

Signed-off-by: Felix Fietkau <[email protected]>
4 months agoudebug-cli: fix terminating uloop
Felix Fietkau [Tue, 22 Jul 2025 08:38:18 +0000 (10:38 +0200)]
udebug-cli: fix terminating uloop

Signed-off-by: Felix Fietkau <[email protected]>
10 months agolib-ucode.c: add #define _GNU_SOURCE
Matthias Franck [Fri, 10 Jan 2025 09:26:57 +0000 (10:26 +0100)]
lib-ucode.c: add #define _GNU_SOURCE

When compiling with glibc, an error is thrown stating that vasprintf is not defined.
In order to use vasprintf from glibc, the #define _GNU_SOURCE is needed.

Signed-off-by: Matthias Franck <[email protected]>
2 years agoucode: check for errors in ftruncate()
Felix Fietkau [Wed, 6 Dec 2023 13:00:35 +0000 (14:00 +0100)]
ucode: check for errors in ftruncate()

Signed-off-by: Felix Fietkau <[email protected]>
2 years agolib: add netlink handler function
Felix Fietkau [Mon, 4 Dec 2023 19:31:03 +0000 (20:31 +0100)]
lib: add netlink handler function

Signed-off-by: Felix Fietkau <[email protected]>
2 years agolib-ucode: truncate pcap files
Felix Fietkau [Mon, 4 Dec 2023 18:56:14 +0000 (19:56 +0100)]
lib-ucode: truncate pcap files

avoid keeping stale data

Signed-off-by: Felix Fietkau <[email protected]>
2 years agolib-ucode: retry partial writes
Felix Fietkau [Mon, 4 Dec 2023 18:54:21 +0000 (19:54 +0100)]
lib-ucode: retry partial writes

Signed-off-by: Felix Fietkau <[email protected]>
2 years agolib: fix handling global enable flag
Felix Fietkau [Mon, 4 Dec 2023 18:53:50 +0000 (19:53 +0100)]
lib: fix handling global enable flag

don't override it for individual rings

Signed-off-by: Felix Fietkau <[email protected]>
2 years agoclient: send confirmation messages for ring add/remove
Felix Fietkau [Thu, 30 Nov 2023 11:19:29 +0000 (12:19 +0100)]
client: send confirmation messages for ring add/remove

Signed-off-by: Felix Fietkau <[email protected]>
2 years agolib: add helper function for applying ring config
Felix Fietkau [Wed, 29 Nov 2023 18:10:16 +0000 (19:10 +0100)]
lib: add helper function for applying ring config

Signed-off-by: Felix Fietkau <[email protected]>
2 years agoring: add debug messages for ring alloc errors
Felix Fietkau [Thu, 30 Nov 2023 09:02:47 +0000 (10:02 +0100)]
ring: add debug messages for ring alloc errors

Signed-off-by: Felix Fietkau <[email protected]>
2 years agoubus: report ring size and data size via ubus api
Felix Fietkau [Thu, 30 Nov 2023 08:53:21 +0000 (09:53 +0100)]
ubus: report ring size and data size via ubus api

Signed-off-by: Felix Fietkau <[email protected]>
2 years agolib: fix dealing with udebugd restarts
Felix Fietkau [Tue, 28 Nov 2023 12:23:38 +0000 (13:23 +0100)]
lib: fix dealing with udebugd restarts

When re-subscribing, also re-request the configuration in order to
avoid using stale data

Signed-off-by: Felix Fietkau <[email protected]>
2 years agolib: move library code to libubox, add ubus config handling code
Felix Fietkau [Mon, 27 Nov 2023 15:23:07 +0000 (16:23 +0100)]
lib: move library code to libubox, add ubus config handling code

Signed-off-by: Felix Fietkau <[email protected]>
2 years agolib: fix avl tree lookup
Felix Fietkau [Mon, 27 Nov 2023 13:40:02 +0000 (14:40 +0100)]
lib: fix avl tree lookup

The delta between IDs can be bigger than INT_MAX, causing order mismatch
in the tree and lookup failures

Signed-off-by: Felix Fietkau <[email protected]>
2 years agolib: remove leftover debug code
Felix Fietkau [Mon, 27 Nov 2023 13:38:54 +0000 (14:38 +0100)]
lib: remove leftover debug code

Signed-off-by: Felix Fietkau <[email protected]>
2 years agoserver: properly handle unclaimed file descriptors
Felix Fietkau [Mon, 27 Nov 2023 12:16:34 +0000 (13:16 +0100)]
server: properly handle unclaimed file descriptors

Signed-off-by: Felix Fietkau <[email protected]>
2 years agoREADME: add wireshark info
Felix Fietkau [Tue, 21 Nov 2023 09:46:13 +0000 (10:46 +0100)]
README: add wireshark info

Signed-off-by: Felix Fietkau <[email protected]>
2 years agoring: add missing fread return code check
Felix Fietkau [Mon, 20 Nov 2023 22:01:59 +0000 (23:01 +0100)]
ring: add missing fread return code check

Fixes build issue with glibc

Signed-off-by: Felix Fietkau <[email protected]>
2 years agolib: unmap full ring buffer
Felix Fietkau [Sun, 19 Nov 2023 15:11:40 +0000 (16:11 +0100)]
lib: unmap full ring buffer

Signed-off-by: Felix Fietkau <[email protected]>
2 years agofix infinite loop on client poll
Felix Fietkau [Sun, 19 Nov 2023 14:39:59 +0000 (15:39 +0100)]
fix infinite loop on client poll

Signed-off-by: Felix Fietkau <[email protected]>
2 years agoubus: add config support
Felix Fietkau [Sun, 19 Nov 2023 12:55:27 +0000 (13:55 +0100)]
ubus: add config support

issue notifications for config changes

Signed-off-by: Felix Fietkau <[email protected]>
2 years agolib: cancel reconnect timer on free
Felix Fietkau [Tue, 14 Nov 2023 11:38:16 +0000 (12:38 +0100)]
lib: cancel reconnect timer on free

Signed-off-by: Felix Fietkau <[email protected]>
2 years agoudebug-cli: cosmetic fix
Felix Fietkau [Tue, 14 Nov 2023 11:30:59 +0000 (12:30 +0100)]
udebug-cli: cosmetic fix

Signed-off-by: Felix Fietkau <[email protected]>
2 years agoREADME.md: update CLI help
Felix Fietkau [Tue, 14 Nov 2023 11:05:38 +0000 (12:05 +0100)]
README.md: update CLI help

Signed-off-by: Felix Fietkau <[email protected]>
2 years agoring: close ring fd on free
Felix Fietkau [Tue, 14 Nov 2023 11:04:51 +0000 (12:04 +0100)]
ring: close ring fd on free

Signed-off-by: Felix Fietkau <[email protected]>
2 years agoudebug-cli: fix error message
Felix Fietkau [Mon, 13 Nov 2023 21:17:40 +0000 (22:17 +0100)]
udebug-cli: fix error message

Signed-off-by: Felix Fietkau <[email protected]>
2 years agoInitial import
Felix Fietkau [Sun, 12 Nov 2023 18:11:20 +0000 (19:11 +0100)]
Initial import

Signed-off-by: Felix Fietkau <[email protected]>