diff options
author | Matthew Wood <thepacketgeek@gmail.com> | 2024-03-07 16:25:24 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-03-11 14:07:57 -0700 |
commit | 2b3953585953a42cd29045c80b20b2bdd6633225 (patch) | |
tree | c4ccb159c1331c1894ec96f2c6f058789834b53c /Documentation/networking | |
parent | 031a239c2209522520936238f1d71615eb5634e0 (diff) | |
download | lwn-2b3953585953a42cd29045c80b20b2bdd6633225.tar.gz lwn-2b3953585953a42cd29045c80b20b2bdd6633225.zip |
net: netconsole: Add continuation line prefix to userdata messages
Add a space (' ') prefix to every userdata line to match docs for
dev-kmsg. To account for this extra character in each userdata entry,
reduce userdata entry names (directory name) from 54 characters to 53.
According to the dev-kmsg docs, a space is used for subsequent lines to
mark them as continuation lines.
> A line starting with ' ', is a continuation line, adding
> key/value pairs to the log message, which provide the machine
> readable context of the message, for reliable processing in
> userspace.
Testing for this patch::
cd /sys/kernel/config/netconsole && mkdir cmdline0
cd cmdline0
mkdir userdata/test && echo "hello" > userdata/test/value
mkdir userdata/test2 && echo "hello2" > userdata/test2/value
echo "message" > /dev/kmsg
Outputs::
6.8.0-rc5-virtme,12,493,231373579,-;message
test=hello
test2=hello2
And I confirmed all testing works as expected from the original patchset
Fixes: df03f830d099 ("net: netconsole: cache userdata formatted string in netconsole_target")
Signed-off-by: Matthew Wood <thepacketgeek@gmail.com>
Reviewed-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/r/20240308002525.248672-1-thepacketgeek@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'Documentation/networking')
-rw-r--r-- | Documentation/networking/netconsole.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Documentation/networking/netconsole.rst b/Documentation/networking/netconsole.rst index b28c525e5d1e..d55c2a22ec7a 100644 --- a/Documentation/networking/netconsole.rst +++ b/Documentation/networking/netconsole.rst @@ -180,7 +180,7 @@ Custom user data can be appended to the end of messages with netconsole dynamic configuration enabled. User data entries can be modified without changing the "enabled" attribute of a target. -Directories (keys) under `userdata` are limited to 54 character length, and +Directories (keys) under `userdata` are limited to 53 character length, and data in `userdata/<key>/value` are limited to 200 bytes:: cd /sys/kernel/config/netconsole && mkdir cmdline0 @@ -197,8 +197,8 @@ Messages will now include this additional user data:: Sends:: 12,607,22085407756,-;This is a message - foo=bar - qux=baz + foo=bar + qux=baz Preview the userdata that will be appended with:: @@ -218,7 +218,7 @@ The `qux` key is omitted since it has no value:: echo "This is a message" > /dev/kmsg 12,607,22085407756,-;This is a message - foo=bar + foo=bar Delete `userdata` entries with `rmdir`:: |