Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp463424ybm; Thu, 28 May 2020 07:18:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEq/XX6cJsafo6NIkVLLpNjsth7kYXfUrA+eXQUKIIuZf5PxymAv/GRF3NQkS4DgZIun4U X-Received: by 2002:a17:906:f75b:: with SMTP id jp27mr3354635ejb.141.1590675532370; Thu, 28 May 2020 07:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590675532; cv=none; d=google.com; s=arc-20160816; b=pT910ZnJWOh2hH6t3bZNfEU/uqogjvN/t4rztRzg5Z9J8awXzV+usjoeFtZdCAvNa8 JcdjMxMFIr0u56ZTzVmS6niGrV46fExByWHT/DHZseatPnO+Ck38AFJCISyk+va+TToY gp737AUAxOv/qf53E4gK077FsQwUrFh+QQc2WAA0/Oi8r70zLhkdVjOhxHq4CIbBS3s3 VDByUQLavNBgNfrW3BOSRu2DhiGaOwu7hH7SZyYLbFrAT6fPBaz1swhJ8pFt3vwwKZd8 tGXtVBp7gjAfJUSE2Qv1ve7urXo0H93CvQkRZn5ZIyjAZLU4wq6Ttgby55LF4YM7SXtj y/fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=0dgolfXdAc6x7Jq4yIpHIA0c+l58+++zQUEipSDdues=; b=mXfMe5oVetNHIF0vD5ImxlckwXGKSXZqHmXRJ+/IDNzMxgB0zZjcPrZxafhbdusbnQ TUy5A9jkeRfRZa6z1zWkLp/r3Jd5OxDxFF0dWxtagsgMVrS5FqEyIZN7u1bfYB3JXAaX BPX1fd5WsZAchUeZANNScmepwud3OcBQ9iMxWzP1/0CYkAayNnygD6du8hkCa5Tmm/Gs T/WjGbS+Gk2f3O2EqHlTVq+QfR9LsJd+xC8SHy0F02f/aYMtgF0VzS77fLiu//jtqDUT RiGi7g6ED0wtWr1oSfi0e9xyvk6lUQ4Tt/GHbJA/wnRzakAlSGnIFejtioXs5xSEao68 A0PA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x22si3316661ejw.222.2020.05.28.07.18.27; Thu, 28 May 2020 07:18:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390880AbgE1OOM (ORCPT + 99 others); Thu, 28 May 2020 10:14:12 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:56730 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390727AbgE1OOK (ORCPT ); Thu, 28 May 2020 10:14:10 -0400 Received: from fsav108.sakura.ne.jp (fsav108.sakura.ne.jp [27.133.134.235]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 04SEDMvX012553; Thu, 28 May 2020 23:13:22 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav108.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav108.sakura.ne.jp); Thu, 28 May 2020 23:13:22 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav108.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 04SEDLiC012550 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 May 2020 23:13:21 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG) To: Petr Mladek Cc: Sergey Senozhatsky , Andrew Morton , linux-kernel@vger.kernel.org, Dmitry Vyukov , Ondrej Mosnacek , Steven Rostedt References: <20200524145034.10697-1-penguin-kernel@I-love.SAKURA.ne.jp> <20200525084218.GC5300@linux-b0ei> <20200525091157.GF755@jagdpanzerIV.localdomain> <20200527083747.GA27273@linux-b0ei> <35d76737-8d23-9fb2-8e55-507109317f44@i-love.sakura.ne.jp> <20200527155504.GD3529@linux-b0ei> <20200528105942.GB11286@linux-b0ei> <945213f4-a2c3-b25e-35e4-7c55f836e11c@i-love.sakura.ne.jp> <20200528121455.GD11286@linux-b0ei> From: Tetsuo Handa Message-ID: <2818b93e-3ebb-72ce-feb9-b0768ccb60d8@i-love.sakura.ne.jp> Date: Thu, 28 May 2020 23:13:17 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200528121455.GD11286@linux-b0ei> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/05/28 21:14, Petr Mladek wrote: >> how to handle >> >>>> #define no_printk(fmt, ...) \ >>>> ({ \ >>>> if (0) \ >>>> printk(fmt, ##__VA_ARGS__); \ >>>> 0; \ >>>> }) >> >> part used by e.g. pr_devel() ? Since this macro is not using dynamic debug >> interface, vprintk_store() will not be called from the beginning. Are you >> suggesting that we should convert no_printk() to use dynamic debug interface ? > > OK, this is one more path that would need special handling. Two paths > are much better than 15. OK. That can avoid needlessly increasing dynamic debug locations. But I believe that your suggestion is much worse than 15. ;-( Let's go back to "Add twist into vprintk_store().". The condition is not as simple as #if TWIST return text_len; #endif because we need to check whether the caller wants to print this message or not. Since we need to print all messages that the caller asked to print, the condition needs to be #if TWIST if (!this_message_should_be_stored_into_logbuf(arg)) return text_len; #endif and where does the "arg" come? It is not as simple as loglevel. Like you said It might get more complicated if you would actually want to see pr_debug() messages for a selected module in the fuzzer. , we want to conditionally store KERN_DEBUG messages into logbuf. We sometimes don't want to store into logbuf due to ratelimit, due to dynamic debug. But we DO want to evaluate arguments passed to printk(). Oh, if we try to add twist into vprintk_store(), we will have to modify all printk() callers in order to pass "arg" only for telling whether we want to store that messages into logbuf. What a nightmare!