Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp455246pxb; Wed, 27 Jan 2021 11:52:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxg0/Hkb8bc5gdm2HycHkdBiS/sOWXEQvtMJEN1YZul+rYst6jzz3mzz0wwQ3GlyaXwCLE1 X-Received: by 2002:a17:906:9497:: with SMTP id t23mr8263538ejx.523.1611777142660; Wed, 27 Jan 2021 11:52:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611777142; cv=none; d=google.com; s=arc-20160816; b=s5tfsRcU4k3frMGKzZDqxwat6JsDahsgL6pJaZkIc3K/MmNYNEAximUqJKcR1upYsR fZSX4AJAF6AVCr0XRFRbZvYzA4ksP0xQ5JfDI0qTdGFeCwjkoJKBGKSuVKcQq7xTkEIu L3ZLYWaQhhwzBV7h9ufq4ihNSQK1Ngg9kmhyv1MzEV2YjFHxwYHV6Av61Ezz2bmSS2fL U6TP2Sn9uEL93x80+5TYJqsqx2L22nhQNcplmHOI7+t4bXNu8XB3JibRxsSVquJbjIpd CIW5EpGrpHbjiKATCH/1348EruItelt/f7l8MeyZ7jlxHFxAx0XsvvziXR8wXkErABRD wgXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=TGJOvrZ6YusGx8SwYbSkGMVaG0czCOWmDVEX/tk9GM8=; b=iGHaiev2kM0Z8UIoSRQGRgcGa5uqbE6NjXi2RsYiMqSOcQ4Lm6y4INCx7oD5hrZSYT S06lanWkPSdRIxJycRKUInDKzKFNO9ORHwPXUNkTNclIBH7jmTPGjL17P7hnau4/ugkL Go/Q6CnRe8ugtGELB3PzDk2G5WtDZFbV8htMRtEjB5tNpqpzq0XzOgVfpfKvMtAvVxmc 4cff8XPgwpp3ZSXULPYoTL7p/85YUpXZFokMx9zTMR/GThy/Z+/HPybCbNVwiSLdCb9S npZ61GQehvWdW4shYkGKUy9tZC4EWaIy9MQx/QDJFiQQkl5AVtuacNaf3oStNhMeRzlC Dlfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b="bM/dc333"; 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 p10si1471286eds.81.2021.01.27.11.51.57; Wed, 27 Jan 2021 11:52:22 -0800 (PST) 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=@soleen.com header.s=google header.b="bM/dc333"; 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 S235498AbhA0DTi (ORCPT + 99 others); Tue, 26 Jan 2021 22:19:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390701AbhAZUmL (ORCPT ); Tue, 26 Jan 2021 15:42:11 -0500 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEAC2C06178A for ; Tue, 26 Jan 2021 12:41:29 -0800 (PST) Received: by mail-qk1-x731.google.com with SMTP id a12so7438172qkh.10 for ; Tue, 26 Jan 2021 12:41:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=TGJOvrZ6YusGx8SwYbSkGMVaG0czCOWmDVEX/tk9GM8=; b=bM/dc333woJ3FiR1xU/5IBWcQjK8xgcJ6YoZeR/tlw9Up1cgV9yMiOCmFmf5SBdSbr hEPBGJv1E60RBteCxCvdCaDeJzMdfMMH29/no0z6Ps21q8QQzNDFBgPvhCNCR/D2fbb2 E5+PuoOkCjvWeQ4leNyIM2QzaMXIwt/tjBpzuUaGlfY5A996WXTIo88q8AL9mJXSWlJh 50YfqAVzw64ygkhpAavhCJm3RSX0LDDd+tI8b5Dw/YFDCYsTv7j+jfLZrwrb7C0lk1sN NOQTFFK9W01VWTsUag9Kx1S0aVv0u7FSALXDuXiwrxPoK9BUR4LI8gdOm9Sfko6v7T1D fvXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TGJOvrZ6YusGx8SwYbSkGMVaG0czCOWmDVEX/tk9GM8=; b=emCi3u+s58sVB6klKVdT3xyz+iIFv1fRXugmzQ0g2Iqb1o0QlAuUG2AMVrC55vFRgV et9ZCWZ8rA9WyxYrYi5fI3uVlQ8UqlruhGPtaYUpoaXo8oLu86mqt7+vKF1fBblyEfqC A7pLVr30sxi6FdiDCvvNE1bJKXrgcoKuQwDHmE+E+NHAgnWjSNgtaHWpc4d6vNTi8+ps +P0JRDFP/PpwkW+R2CRTYNGAfqb436LBLj05hDhgXWNKvLKZgcqE9n91tIEV4GVm/1Sz lYMTseuWWS9EYRm2P0a89wbnnbjxVT8rAkC3agrm6LJfSXo14UVeFBRm54s4w0+hWJUf dr7Q== X-Gm-Message-State: AOAM531ukiRE55oeSO1my+P4UwUr8wqfCs092iZ829ksZY0abvVhF6/j DwaFjwvZwgcKF/yEMlB0H11xklDcujegC0VF X-Received: by 2002:a37:9101:: with SMTP id t1mr7544156qkd.357.1611693689121; Tue, 26 Jan 2021 12:41:29 -0800 (PST) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id 203sm15228216qkd.81.2021.01.26.12.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 12:41:28 -0800 (PST) From: Pavel Tatashin To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org, tyhicks@linux.microsoft.com, pmladek@suse.com, ebiederm@xmission.com, keescook@chromium.org, anton@enomsg.org, ccross@android.com, tony.luck@intel.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/1] kexec: dump kmessage before machine_kexec Date: Tue, 26 Jan 2021 15:41:25 -0500 Message-Id: <20210126204125.313820-2-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210126204125.313820-1-pasha.tatashin@soleen.com> References: <20210126204125.313820-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kmsg_dump(KMSG_DUMP_SHUTDOWN) is called before machine_restart(), machine_halt(), machine_power_off(), the only one that is missing is machine_kexec(). The dmesg output that it contains can be used to study the shutdown performance of both kernel and systemd during kexec reboot. Here is example of dmesg data collected after kexec: root@dplat-cp22:~# cat /sys/fs/pstore/dmesg-ramoops-0 | tail ... <6>[ 70.914592] psci: CPU3 killed (polled 0 ms) <5>[ 70.915705] CPU4: shutdown <6>[ 70.916643] psci: CPU4 killed (polled 4 ms) <5>[ 70.917715] CPU5: shutdown <6>[ 70.918725] psci: CPU5 killed (polled 0 ms) <5>[ 70.919704] CPU6: shutdown <6>[ 70.920726] psci: CPU6 killed (polled 4 ms) <5>[ 70.921642] CPU7: shutdown <6>[ 70.922650] psci: CPU7 killed (polled 0 ms) Signed-off-by: Pavel Tatashin Reviewed-by: Kees Cook Reviewed-by: Petr Mladek Reviewed-by: Bhupesh Sharma --- kernel/kexec_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index 4f8efc278aa7..e253c8b59145 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -1180,6 +1181,7 @@ int kernel_kexec(void) machine_shutdown(); } + kmsg_dump(KMSG_DUMP_SHUTDOWN); machine_kexec(kexec_image); #ifdef CONFIG_KEXEC_JUMP -- 2.25.1