From nobody Thu Mar 28 18:13:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V5BVJ612Hz5GR6j; Thu, 28 Mar 2024 18:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V5BVJ4Dzfz4Dyd; Thu, 28 Mar 2024 18:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711649592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nd8J5gwYKl6ElcFmYUSfp+7bdPSK2KqKfTFD8+gDmTw=; b=rC/rXhJbPsNWPoH0UQS0NqpudjIOtVFtYZqrE9l7VL/cv/WK7kO7Etr1Hq6q+oYIrt+5u9 D6RSLCkQ8K1MEMdh9CXjV7VzBf2n48g/IFXV0L6bjY2xle3xBkPeYps2FZ90EtkJfea0um 2N3rnXmzBMeNPjCmkuo/QP4sz8QYV1GB9uN/9RtCp6dBs2E9lgZdAdKRVaxw3wWzq2Pedc iEQAtOuyiiLeqsa+PJ3LRsi8uaXKtd4uX/Ihuo3c077Egpj4Wi8mUfCk7t88YhXOq9QsDA Vp+R4tWnW+zlDDY2wKdO3JZTOrsIZL2dUu4zQDyAQ+UwZlsOgJIpGvysTNz4pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711649592; a=rsa-sha256; cv=none; b=mr/t7NfDJTlF4R36EIQkk6Oe3hA957Q7uv1TR74xfV0doVfdW4JHek3kUJwQDbR21g9Oq9 +ypqvSAz5dHjPmU8PEnHbHbzzCdrnTPQM6o3nXYLi2L1f6imd+FA2RtGwOVBlMPTM5mvT0 mT1eQ/OLBiki48tWu0z1CSDOtRdUc/iFuwKTiQWjEPFGoD00vK5+54/KyfhSBJiS6+/RYL W6bWtV6vQcoz/YWa3VzdHwPGyj1gPApFBLJorVFVQd5zTn7rLAfEBSEfIcx4xlMNAsmNHT HjKZGv5tSvRhn6017EW9lyjd+gbMvREI3XBtdj8niNKiC/xFN8lKh40rlhuAzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711649592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nd8J5gwYKl6ElcFmYUSfp+7bdPSK2KqKfTFD8+gDmTw=; b=oOcpZfbJ5R4+pNGrI2HyPp5BHcc3GUtrXBGk4/yjJJQqJsIf7IxdttOJ5hBSPbYxldGNae mi6Upqwrko/c4rvG0oNahzc61S7IdVyx2WS23wz5C1xVn4YH4qHMqc+69kQxkMZ58TQTuN OdruXvwrjTjLaHKKdvPJwcLwm1HD3qBiAwT2y1ixBuKsmp+AWJgVfuFV7vZvc1YvBZXVMJ n0juKeVHGBEHkg7UrpKi8pa4MM0XGeS5cvYUs/7gDtXdQcD1ju6IBniAlf5xKWnz4lJCQX rxdD/UvOMSpHtbb/SrkL4j3hIuKFGETjxiVaqxvc21gga6ysbG2+9FGQeTXpQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V5BVJ3rgPzdL0; Thu, 28 Mar 2024 18:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42SIDC5K037103; Thu, 28 Mar 2024 18:13:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42SIDCil037100; Thu, 28 Mar 2024 18:13:12 GMT (envelope-from git) Date: Thu, 28 Mar 2024 18:13:12 GMT Message-Id: <202403281813.42SIDCil037100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: 2aee804c9ef0 - main - kerneldump: Add flag to indicate kernel core was successfully dumped List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2aee804c9ef02b2ffa3e35037ea45f43e1709d2f Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=2aee804c9ef02b2ffa3e35037ea45f43e1709d2f commit 2aee804c9ef02b2ffa3e35037ea45f43e1709d2f Author: Stephen J. Kiernan AuthorDate: 2024-03-27 22:55:21 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-03-28 18:11:16 +0000 kerneldump: Add flag to indicate kernel core was successfully dumped This allows for shutdown_final EVENTHANDLERs to know that a core dump successfully occurred. Embedded systems may want to record this fact or act on it. Obtained from: Juniper Networks, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44542 --- sys/kern/kern_shutdown.c | 5 ++++- sys/sys/conf.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index f49e315a503d..b0a3c3fa9e91 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -229,6 +229,7 @@ bool scheduler_stopped __read_frequently; int dumping __read_mostly; /* system is dumping */ int rebooting __read_mostly; /* system is rebooting */ +bool dumped_core __read_mostly; /* system successfully dumped core */ /* * Used to serialize between sysctl kern.shutdown.dumpdevname and list * modifications via ioctl. @@ -415,8 +416,10 @@ doadump(boolean_t textdump) TAILQ_FOREACH(di, &dumper_configs, di_next) { error = dumpsys(di); - if (error == 0) + if (error == 0) { + dumped_core = true; break; + } } } diff --git a/sys/sys/conf.h b/sys/sys/conf.h index f34fd43cfe24..8470f53e0408 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -358,6 +358,7 @@ struct dumperinfo { }; extern int dumping; /* system is dumping */ +extern bool dumped_core; /* system successfully dumped kernel core */ /* * Save registers for later extraction from a kernel dump.