Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26463834rwd; Mon, 3 Jul 2023 10:01:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7gjqHphOP7qh7KY+rwApN81eg4Du5zcq5NYyCZZD2Rr6ArTwh/lpSu/4pHOiw9zcs5DaLa X-Received: by 2002:a05:6808:1b09:b0:39b:f558:8cbf with SMTP id bx9-20020a0568081b0900b0039bf5588cbfmr12126399oib.12.1688403697689; Mon, 03 Jul 2023 10:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688403697; cv=none; d=google.com; s=arc-20160816; b=c0m+zkdN7XGKsv79wWa2I11fCgBxqYCubJJGKGnI39G9aUqFgOaAwP8nLIYk0N26KJ TIXuzb3DLR+3JLDL44KqUPdZA5I+YIbHHvNRN+RUBeghErtCPrDmJR6ckUJzlmoBjwxL iS3uDHJBQ3yZ2l0JqxJO6x8ueFeNoEWtG7edNxD91biSlCd9U3LrjEY3bjUrocvPQSDp 26D8JyS16yw5fPb5S5ilP0eHcowgyOyQA47u0k3OPjQ4CsGexLuIbUQEqiU2f+/167ZF zDarEOjAJIcnAkCUpQBxzvo++OJlpwdiGdOHS8dIk7OHuOvphqJ/kHWTIsQsQPtMOHJT 5BuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hGh0RjSMKjqK2Wktq8A3Dwgw/Zxp8Whsd7BqywESmC8=; fh=ImE1DL2ZDjoFBaMWwBLr4IrFQNZ58X8iIpa2JHlo9qc=; b=X7XrN4BtkAqY1vYG4cFMZ13FG8wK+bL+N91b7jlIqpLNr7mZn0S+nvkWApHaUfdTuk UbxpJPRx4Ba0fbdygaAS5+LTOEnFLsjjplm5Brnslj7jOlxxuDpg0pZqxdt2+wvqFOjn hyOenx7KoiPUuOL8lPM7Q97a95CHBS6AwzAMIe3Troz0oD/Vdu+RgOCVtPGhm8uRQVa5 qHJuppSHvGQjBkb7jbE66NBFQXE/9y+0Ro7t7qK2Hv9vxSXBdfSXpE02VvNv5a5m62Ni JJPMZ2e7J4K5C3jfjOX1hMqbCApn8JkAkXuJkJTJ8QLBjtxTnEkXIVCoMlfFiySfETTC 9kqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=qtKB0VE7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s33-20020a05680820a100b003a367f8834asi5136701oiw.87.2023.07.03.10.01.22; Mon, 03 Jul 2023 10:01:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=qtKB0VE7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230028AbjGCQql (ORCPT + 99 others); Mon, 3 Jul 2023 12:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbjGCQqk (ORCPT ); Mon, 3 Jul 2023 12:46:40 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21F23E41; Mon, 3 Jul 2023 09:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=hGh0RjSMKjqK2Wktq8A3Dwgw/Zxp8Whsd7BqywESmC8=; b=qtKB0VE7XS/zPSFAFKc+aThafR LCQB1gwLxwZEa/ooBzb8rCnkiW1tM9mPEEeOLJkzdv9W87fOp6flmOmoy3/9pjSNdzzhYNyyNausq pVBILaIj/KPN8JD21o365Av1uppESQ171x5jOgt4L1Cou6adKhr8WQswXFXZ5K8u/cuc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qGMgz-000Unb-El; Mon, 03 Jul 2023 18:46:25 +0200 Date: Mon, 3 Jul 2023 18:46:25 +0200 From: Andrew Lunn To: leitao@debian.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , sergey.senozhatsky@gmail.com, pmladek@suse.com, tj@kernel.or, Dave Jones , "open list:NETWORKING DRIVERS" , open list Subject: Re: [PATCH] netconsole: Append kernel version to message Message-ID: <4b2746ad-1835-43e6-a2fc-7063735daa46@lunn.ch> References: <20230703154155.3460313-1-leitao@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230703154155.3460313-1-leitao@debian.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Signed-off-by: Breno Leitao > Cc: Dave Jones 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