Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp540171imm; Wed, 20 Jun 2018 02:33:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLtd+EtSyBGUJ78yrNtN/sPYTudXH4Mr489CwuPclfmcKthJG22FobpZ/DGKDjuOwKb0Tci X-Received: by 2002:a17:902:22e:: with SMTP id 43-v6mr5738333plc.82.1529487194294; Wed, 20 Jun 2018 02:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529487194; cv=none; d=google.com; s=arc-20160816; b=lHkzYhWxUVav2syuTqlW4e37oM+nIlKbV3u52EkYUP1RVtD/lToXuhTvCRJTEpuRxN r6RtnIZU125c861fa9lbn3M32ZaI+Yn3sYVzGW9sNsNqd04ar6h61k1z3GuPJR9d2jsn 1QdqCl0Rrm0UnO1YR3UJf4AZdYISSoh/xjUMoZTUhsSjE9QnlPx3dDt3UkLKoeMwshzz yMIhGMUlfw0Ox+JhwsvZX6nA0iGF8NK+QnQnRKudC9sIESEHkVjbnpyImsklFlZgjADi 7kWY4gh8dwL8Ifv5CFPWtfmj1w+tRCZAnlltJXI8gFnai9Ezwd/bAQIvaPX4xJQ1j6af J5uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=dOl1IYJqyWdcKPUCjZvLKKL+ep57g+1fDjhJs+MD1Es=; b=IbH3EowMYIN1O3Cj/njksQ9+HbC5AvbQP3r+BJ92qnCtbLQpHy9M9BNeFT0unXO3Pv kCyfUtjR0V1PMdASl16lb2Vl9QgSNMydnCYGRx+gcutX5zpJv+54yjljzFZxtYMUjOH6 T/eu4VsjKpNAn95u5c9S2J4O43uqXpRHX32Fk2JLrsShny07McjJyXkI+VHAr1n1q9ss EDK+vOoRTGYsklo7jOEIXPuMXjwdv4MNuRXKnPkjfqFWmxD5XIoC1PUzrBlEX19a30K+ hkePq9+M+1AHOqshvRYCf5k0QMSr+JDecXF/x/DiU0X0vgiIltMcju6qAmYlj41Z5qnW Lzcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ZWjGY87l; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9-v6si1692694pgf.497.2018.06.20.02.33.00; Wed, 20 Jun 2018 02:33:14 -0700 (PDT) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=ZWjGY87l; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754952AbeFTJbc (ORCPT + 99 others); Wed, 20 Jun 2018 05:31:32 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:34324 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754670AbeFTJb3 (ORCPT ); Wed, 20 Jun 2018 05:31:29 -0400 Received: by mail-pl0-f66.google.com with SMTP id g20-v6so1460500plq.1 for ; Wed, 20 Jun 2018 02:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dOl1IYJqyWdcKPUCjZvLKKL+ep57g+1fDjhJs+MD1Es=; b=ZWjGY87lG3NcaeKYLmzJJ4VJxSVsK6WnR4E4Rbg4nfoC5H7gh0AUktSIwCEWQB+KlB r2rRgh3V8ubf8VEBUNivUN6nVM0pbOuDSVqu1gvSA7oNtoEJR0Ty4sM8rgA6VElr6rKI qgBe+zmdEsTzQEIfNaIiSASNxpjHUY/CX7MPB1/6GHj34xqGHNos0q/NEHErUcSy4fVo 8z2wW5JtizSIOM17W4dccVa/jeIazaL0c0HjHloU0rCcPdL2LzkJhDWuzx/j3qA+8aQG tDaq1UzaVoX98WckoJp14zVsHVUeQyybZJh2EXWxsAbSvMdzp351jYNw/VAsfUsqmUY4 Otpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dOl1IYJqyWdcKPUCjZvLKKL+ep57g+1fDjhJs+MD1Es=; b=UCMvcpBdhWPe4XHuB/8gzueWqdRV8NgLUgSxGdg7WRkCuP4PLayg0e1pq5u2v4otrN 489oUcdwYxJ4O0vGnrYhNnotduGW+BPQ3Cp3YCVNBCjoAR9KUiTsn1aqyPGxE+IlH/25 w4XijK5PFbMh+Dde8Xbz5eJkA2LBlloNm92NXEKDwqymcnVaoF1cdyBl+zQUcsN9GrH3 fZfX2IjpTX5XNtG17VDx7yzXUIVJe373GzZntg9/bsrDBus+Lz9ZwmTAOWZMFfvMzc/5 xo3rHZJPiC4sSrXldmjPq2W/nkbuqqxXEAFmSpgS2TmFrrewdcSH5zyb+igCWQZPgCQ9 BPxg== X-Gm-Message-State: APt69E2XScqrWjEPVm+T4Aw6xgxt4kilmCuhq6787HGZOz3DAz+aleE3 anatVn/iJMmmcL8DOvXke7Pe5fbq14eqSToimyz5gA== X-Received: by 2002:a17:902:8d85:: with SMTP id v5-v6mr22819026plo.93.1529487089112; Wed, 20 Jun 2018 02:31:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:de2:0:0:0:0 with HTTP; Wed, 20 Jun 2018 02:31:08 -0700 (PDT) In-Reply-To: <20180620091541.GB444@jagdpanzerIV> References: <20180511095004.GA6575@jagdpanzerIV> <201805112058.AAB05258.HJQFFOMFOVtOSL@I-love.SAKURA.ne.jp> <20180517112135.GB20796@jagdpanzerIV> <20180518121506.wilixxkznbtskw34@pathway.suse.cz> <20180524021451.GA23443@jagdpanzerIV> <20180620083126.GA477@jagdpanzerIV> <20180620090413.GA444@jagdpanzerIV> <20180620091541.GB444@jagdpanzerIV> From: Dmitry Vyukov Date: Wed, 20 Jun 2018 11:31:08 +0200 Message-ID: Subject: Re: [PATCH] printk: inject caller information into the body of message To: Sergey Senozhatsky Cc: Petr Mladek , Tetsuo Handa , Sergey Senozhatsky , syzkaller , Steven Rostedt , Fengguang Wu , LKML , Linus Torvalds , Andrew Morton Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 20, 2018 at 11:18 AM, Sergey Senozhatsky wrote: > On (06/20/18 18:06), Sergey Senozhatsky wrote: >> >> b) printk_safe output is quite uncommon. And we flush per-CPU buffer >> from the same CPU which has caused printk_safe output [except for >> panic() flush] therefore logging the info available to log_store() >> seemed enough. IOW, once again, was a bit unsure if we want to add >> some complex code to already complex code, with just one potential >> user. > > BTW, pr_cont() handling is not so simple when we are in printk_safe() > context. Unlike vprintk_emit() [normal printk], we don't use any > dedicated pr_cont() buffer in printk_safe. So, at a glance, I suspect > that injecting context info at every printk_safe_log_store() call for > `for (...) pr_cont()' loop is going to produce something like this: > I<10> 23 I<10> 43 I<10> 47 .... > > // Hmm, maybe the line will endup having two prefixes. Once > // from printk_safe_log_store, the other from normal printk > // log_store(). > > While the same `for (...) pr_cont()' called from normal printk() context > will produce > I<10> 32 43 47 .... > > It could be that I'm wrong. > Tetsuo, have you tested pr_cont() from printk_safe() context? So this is another reason to get rid of pr_cont entirely, right?