Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4819443imj; Wed, 13 Feb 2019 01:27:06 -0800 (PST) X-Google-Smtp-Source: AHgI3IZXo7v6RpDUIWzQNaT4+2LAwjLrCJIG44oLOJ/SN6G2bdIHnf8UTRSPmSF+QoWs7NUOW9D+ X-Received: by 2002:a63:e10:: with SMTP id d16mr8096149pgl.148.1550050026404; Wed, 13 Feb 2019 01:27:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550050026; cv=none; d=google.com; s=arc-20160816; b=0APk/o7W/j0V59oQDh6CITSESA3E0tnC4TSpVaiDIFy0Q50oMfBbp1+ExoindbZjKo pK831P7aXHfNyAe+LNO+JxORP4JlTRKwTw1+4e3i5IrvH+0kmx5ESfb7OQ+P+tBCPb8J /o0MC8rhzGJQHfDUlSuuUZOm49ymyDeI9vREWnQ4S7zu+hif1XBCCvj+bzcauuU0khYa td27csL8sceSt81zRYSANMpqRxs2sYvSq0TYlH8EJQp71Mx4qRPOu+EmpZNj1dY9Ia8D /S0vZpqFQG99f870LmwKtNQPsbDypuh+a6n3N1RI5KJXyShWo4FAYy8L01nvC4p0Zs+N bykA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=Nk2fV/a3t0ng+vvhctjVD1FMI2vkwkxVI3y5kbdNvJw=; b=Vi3cQMHDoZs1W/ChKDxt6gNCLzBLkmBEd+LwW/Yzxc3CE9Bdp8vOFrDq5W1TFayAWb YVXiMF66Bp2XDuSmFuXr7vM+I3qQ4pYDV4Saz3WRRbKXdyqo8SMkzqI+SUZdeIWplEJG HexCFTpzj26Goyny0ysUSgEBKJ2m9BIsvmUsvToASBSbXio+slKIGr/RBmwQILsmBH0V V+91vDw6eYbYP76stynTGq0kxnTI3qs9FdtDcuhLM2tx/rHEkioTkf6mqzzuuCqHluSF OUyFtBjh6NSLrybZfdbXb113EO58SFbU8BKlF6pJS+kFW8hulQXCrOUChj04Pxnogng7 sPEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17si2545857pgk.334.2019.02.13.01.26.50; Wed, 13 Feb 2019 01:27:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732935AbfBMEyT (ORCPT + 99 others); Tue, 12 Feb 2019 23:54:19 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:64641 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726095AbfBMEyS (ORCPT ); Tue, 12 Feb 2019 23:54:18 -0500 X-UUID: e59d15c1b68b4088adac4833c0f07a29-20190213 X-UUID: e59d15c1b68b4088adac4833c0f07a29-20190213 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1019044916; Wed, 13 Feb 2019 12:54:11 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs03n1.mediatek.inc (172.21.101.181) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 13 Feb 2019 12:54:09 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 13 Feb 2019 12:54:09 +0800 Message-ID: <1550033650.7648.2.camel@mtkswgap22> Subject: Re: [PATCH 1/1] tracing: Fix event_trace_printk loss on printk_format. From: Mars Cheng To: Steven Rostedt CC: Andress Kuo , CC Hwang , , , Date: Wed, 13 Feb 2019 12:54:10 +0800 In-Reply-To: <20190212204113.5ecaa2a1@gandalf.local.home> References: <1549971717-4693-1-git-send-email-mars.cheng@mediatek.com> <20190212204113.5ecaa2a1@gandalf.local.home> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steve On Tue, 2019-02-12 at 20:41 -0500, Steven Rostedt wrote: > On Tue, 12 Feb 2019 19:41:57 +0800 > Mars Cheng wrote: > > > From: Andress Kuo > > > > If fmt on event_trace_printk is not a constant, It means that something not > > guaranteed, so the compiler optimizes the fmt out, and then the > > __trace_printk_fmt section is not filled. if __trace_printk_fmt is not > > filled, the kernel will not allocate the special buffers needed for the > > event_trace_printk() and then not shown in the file output > > sys/kernel/debug/tracing/print_formats. > > > > Adding a "__used" to the variable in the __trace_printk_fmt section on > > event_trace_printk() will keep it around, even though it is set to NULL. > > This will keep the string from being printed in the > > sys/kernel/debug/tracing/printk_formats section. > > > > We can also refer to commit 3debb0a9ddb1 ("tracing: Fix trace_printk() > > to print when not using bprintk()")that it had similar issue on path of > > trace_printk(). > > Honestly, I don't even remember why that macro was created. I think > it's a remnant from the creation of the trace events. I think the best > solution is just to nuke it. It shouldn't be used anymore. > > I'll dig a bit deeper into the history of that macro, but I'm thinking > it shouldn't exist anymore. > > [ /me returns from walking down memory lane ] > > Wow, that brings back some wild memories. Yes, that macro must die, and > I wish the history of it could die along with it ;-) The horror of the > old ways I tell you. The event_trace_printk() was the original way we > displayed events! No real formatting, no parsing my userspace tools. It > was just a glamorized printk. It was called TRACE_FORMAT() which was > deprecated by today's TRACE_EVENT(). > > That macro should have been removed by commit b8e65554d80b4. > > Please just send a patch to delete that macro. Let's not be maintaining > it. It gives me nightmares. > > -- Steve Got it, I will send another patch to remove the nightmares. :-) Thanks.