Messages in this thread | | | Date | Mon, 3 Jul 2023 18:46:25 +0200 | From | Andrew Lunn <> | Subject | Re: [PATCH] netconsole: Append kernel version to message |
| |
> > Signed-off-by: Breno Leitao <leitao@debian.org> > Cc: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by should come last.
> +#ifdef CONFIG_NETCONSOLE_UNAME > +static void send_ext_msg_udp_uname(struct netconsole_target *nt, > + const char *msg, unsigned int len) > +{ > + unsigned int newlen; > + char *newmsg; > + char *uname; > + > + uname = init_utsname()->release; > + > + newmsg = kasprintf(GFP_KERNEL, "%s;%s", uname, msg); > + if (!newmsg) > + /* In case of ENOMEM, just ignore this entry */ > + return;
Hi Breno
Why not just send the message without uname appended. You probably want to see the OOM messages...
Also, what context are we in here? Should that be GFP_ATOMIC, which net/core/netpoll.c is using to allocate the skbs?
> +static inline void send_msg_udp(struct netconsole_target *nt, > + const char *msg, unsigned int len) > +{ > +#ifdef CONFIG_NETCONSOLE_UNAME > + send_ext_msg_udp_uname(nt, msg, len); > +#else > + send_ext_msg_udp(nt, msg, len); > +#endif
Please use
if (IS_ENABLED(CONFIG_NETCONSOLE_UNAME)) {} else {}
so the code is compiled and then thrown away. That nakes build testing more efficient.
Andrew
| |