Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1060036pxa; Wed, 12 Aug 2020 22:22:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxg5YkuLIumzedcbNoj/M44/Bhxo8aVtM+fWwwbSloFN8AQuvsXZOCUPAKfCdnTKCo/YRO/ X-Received: by 2002:a05:6402:1d92:: with SMTP id dk18mr3027644edb.206.1597296141744; Wed, 12 Aug 2020 22:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597296141; cv=none; d=google.com; s=arc-20160816; b=K8Ukx1xyMmMB7v8xsWoqL5CkDx5f2eZNaqIzfX+NgCVBtUoQNmvZtlsC6mjzq2y8VT sGyJrIuXIAPEVhjOwirZc96x+KRzM/vPn1MOBs1dvTErDQc38cKRkk79WkAako2T/BcL aHmWDucX8Wou7XN8emh+kM6aj8qc5X+ot+xtt0tm6SSMYvCo+z4Q2MeoRCfmCC+8ynKd Ac91riIu/tCViezMvuXS+/W+++j/zPS3kao3DXbRfDkrRlHIjHwuLvWxvXu4AimxYVJ5 Yd3xo1jZrbdIxZ9pp7AO6/8SCrMzlLaW472Vx9C6X/YhCwuMAwsn83AVzf9/7UM8ez4B iwdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=yAXoCZ+XEA3yt3zyCitojp+0S08f20bzr+BL+L7VJS4=; b=K1Im7fw7wjvQN1AzT3qnbHwXbXxI8pHFfhsLKluv17H1d0v5bcj2loeByz63M3x8gf AZOyJqKnNU9Ang6BzYV/1DDEBk1Ikkb8BUOM3uZDAlU1fsuQe9w3QF+nYhmHL6+fdXpl Zzg/Zt8paKaMh+3f47w7w8/J2q0jX3+pdD9i4W2a5QV8B1E8sqhSq5WeYCC8Esjyv1Aj rxpaHiBF2mY/rASDVNs2tKCirTxEkXQk4to3p/JrlS3mxMat3iJvNqWgUFk5MkhBhPTM DV68dnKa+9+opFC9WfJzWq8RkJAsZGd3vdAz/KEL3mPlLRJbkyxq/xpqDhsjG49h8VZw JgXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KHnGjiSf; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o16si2545824edt.286.2020.08.12.22.21.58; Wed, 12 Aug 2020 22:22:21 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KHnGjiSf; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726167AbgHMFS5 (ORCPT + 99 others); Thu, 13 Aug 2020 01:18:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725891AbgHMFS4 (ORCPT ); Thu, 13 Aug 2020 01:18:56 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB800C061757 for ; Wed, 12 Aug 2020 22:18:56 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id h12so2232949pgm.7 for ; Wed, 12 Aug 2020 22:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=yAXoCZ+XEA3yt3zyCitojp+0S08f20bzr+BL+L7VJS4=; b=KHnGjiSfHWioqZdEDRRuaXo8k8MJZG7uowIdWWNO9LRM+E0cFkVgb1XSBVsiZ45xJg GKz2bgiUpf3j+DChfFupKb38XZ0TdcX7RWmq8hosjD/8dA5zMYqxlr27kdLfbQMy7YNB 7n5qunwWjxoRKo0epR/BtOCXLqVcZPz66mPgEdmHkiKpG0Hh8uiKx2/0/Z8n6BeZ8T8G l8ctlbBdmN8m+PeEjSTPkWssx3Ds78mzRK9WF7dpubL7AiqJDJtMadeby1mKC4Nz2F1m pTJU9owjSZOPUJI/GdZMCMMPZ4G8vGyZyPtDvkvamK5CaD10mudgTQB8glql+v+yWqnm rEQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yAXoCZ+XEA3yt3zyCitojp+0S08f20bzr+BL+L7VJS4=; b=H7kKy+9kPqRyuARiAlZQ+qngsLFulmmD1oH3NuUPnHrhodbJuQYPQ2q+fXXZjLIPBv Cc2Wyy/211MaSNNy5IvdEgU/igEGMiUz6Q9IWrIivc4md56bgvLZhzwTyvmNvDSSIxrh OdvygRPaPHyckfk+U9Hel+8ooRgBDxhS5peS/zcG7KAP/Fjpfj15v9pdr46qE6Gx0Kcz lGaBV3EaDwE0MRgd6LoWAlZNsUXZz5muX9qix6OFNyH433BURJrEstjygUkTJVaxMwxs tLAKPVhFfMeIgNS5RIHXNfeDU+cHN960BMneLfknhPqer2aybTjZ9NvXOVcEbpYi+x+P l+eQ== X-Gm-Message-State: AOAM5318LQdzuPsWI0CteN4pJtlPQdb2aBXvEMQuVJxodolieN3EQGzD FQ2TR9qSjfIrzuo4jKdV7Wc= X-Received: by 2002:a62:7ac2:: with SMTP id v185mr2734062pfc.277.1597295936321; Wed, 12 Aug 2020 22:18:56 -0700 (PDT) Received: from localhost ([2409:10:2e40:5100:6e29:95ff:fe2d:8f34]) by smtp.gmail.com with ESMTPSA id o63sm173961pfb.190.2020.08.12.22.18.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 22:18:55 -0700 (PDT) Date: Thu, 13 Aug 2020 14:18:53 +0900 From: Sergey Senozhatsky To: John Ogness Cc: Petr Mladek , Linus Torvalds , Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Greg Kroah-Hartman , Peter Zijlstra , Thomas Gleixner , kexec@lists.infradead.org, Linux Kernel Mailing List Subject: Re: POC: Alternative solution: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling Message-ID: <20200813051853.GA510@jagdpanzerIV.localdomain> References: <20200717234818.8622-1-john.ogness@linutronix.de> <87blkcanps.fsf@jogness.linutronix.de> <20200811160551.GC12903@alley> <20200812163908.GH12903@alley> <87v9hn2y1p.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v9hn2y1p.fsf@jogness.linutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/08/13 02:30), John Ogness wrote: > 2. I haven't yet figured out how to preserve calling context when a > newline appears. For example: > > pr_info("text"); > pr_cont(" 1"); > pr_cont(" 2\n"); > pr_cont("3"); > pr_cont(" 4\n"); > > For "3" the calling context (info, timestamp) is lost because with "2" > the record is finalized. Perhaps the above is invalid usage of LOG_CONT? This is not an unseen pattern, I'm afraid. And the problem here can be more general: pr_info("text"); pr_cont("1"); exception/IRQ/NMI pr_alert("text\n"); pr_cont("2"); pr_cont("\n"); I guess the solution would be to store "last log_level" in task_struct and get current (new) timestamp for broken cont line? We have this problem now. E.g. early boot messages from one of my boxes: 6,173,41837,-;x86: Booting SMP configuration: 6,174,41838,-;.... node #0, CPUs: #1 #2 #3 #4 4,175,44993,-;MDS CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/... 4,176,44993,c; #5 #6 #7 "CPUs: #1 #2 #3 #4 #5 #6 #7" is supposed to be one cont line with loglevel 6. But it gets interrupted and flushed so that "#5 #6 #7" appears with the different loglevel. -ss