From nobody Wed Apr 1 11:19:17 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48A0B3101CD; Wed, 1 Apr 2026 06:38:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775025487; cv=none; b=IMALnNLjU4MC1+ataMBIRXJbHb9N3hr8mOckcNn6sCPbaaorRC2/nH6xjFb+vE1TzCrC7EWKVsJ991Tv0Haq0k22+1b6+xtCi0V7Ifi1ErGU3VgC8UM15QhF01ob0P3BJe+XWaEST/XvE0x/B9fjUDQv7K8Ii6NLSz6LzLY65gk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775025487; c=relaxed/simple; bh=ohk0QZm+TQ737PNHl3FBD3IP31G9F+cr8+juQWv+OGY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PnFJAHR+9qqchUP6yNXPRb1e5CiVFfeL67gk/1HI2QJshv24w+N5mEv8FT9J1JirJ7TcJpKj4jqrLE3xSnF6NX8jXxZyg67JM8W2F6xRPOUElnxC73uJWDZlaxfvj5ayPbchqn36wr1MArJQXJOtN3ZfBC0lOJyGVUucUizXuzM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mBSpC+Z0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mBSpC+Z0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72F6AC4CEF7; Wed, 1 Apr 2026 06:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775025487; bh=ohk0QZm+TQ737PNHl3FBD3IP31G9F+cr8+juQWv+OGY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mBSpC+Z00FaIl7tQUlFDQ5wFa4lemvJ8LANr6wuWUm0u66SKrEzakX7UCm/WUxEO7 EKiVBlLlFPs+qJpNNhJO9cNp4eC8lkN9bFm+jqjU1qashYrxUKgtt/pR0hlE6fICbz IPmhlR1DhTJwAFG0oCxU5D+1/aHotO62hwYd5vUgYDXKEPaZOlxZtCyFxInVEe032G iCEUX8VjTjQqKtXhxMA+J8jfc4MiIJ2Hrk/ie4HyiQV+YxcBtfNdVQemNqfjLWDxwo fuPwe43bZXYHKjU7Wsa/+zMfW9am1IfKl20/QoTTWbwePgT3FQxwtepD8GfZEzmVQL JAJRKmks8OW2w== From: "Masami Hiramatsu (Google)" To: Steven Rostedt Cc: Masami Hiramatsu , Mathieu Desnoyers , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v10 3/3] tracing/Documentation: Add a section about backup instance Date: Wed, 1 Apr 2026 15:38:05 +0900 Message-ID: <177502548479.1311542.7062269603547001007.stgit@mhiramat.tok.corp.google.com> X-Mailer: git-send-email 2.53.0.1118.gaef5881109-goog In-Reply-To: <177502545902.1311542.15822886746171808738.stgit@mhiramat.tok.corp.google.com> References: <177502545902.1311542.15822886746171808738.stgit@mhiramat.tok.corp.google.com> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Masami Hiramatsu (Google) Add a section about backup instance to the debugging.rst. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v10: - Add a newline. Changes in v6: - Fix typos. --- Documentation/trace/debugging.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/trace/debugging.rst b/Documentation/trace/debugg= ing.rst index 4d88c346fc38..bca1710d92bf 100644 --- a/Documentation/trace/debugging.rst +++ b/Documentation/trace/debugging.rst @@ -159,3 +159,22 @@ If setting it from the kernel command line, it is reco= mmended to also disable tracing with the "traceoff" flag, and enable tracing after boot up. Otherwise the trace from the most recent boot will be mixed with the trace from the previous boot, and may make it confusing to read. + +Using a backup instance for keeping previous boot data +------------------------------------------------------ + +It is also possible to record trace data at system boot time by specifying +events with the persistent ring buffer, but in this case the data before t= he +reboot will be lost before it can be read. This problem can be solved by a +backup instance. From the kernel command line:: + + reserve_mem=3D12M:4096:trace trace_instance=3Dboot_map@trace,sched,irq t= race_instance=3Dbackup=3Dboot_map + +On boot up, the previous data in the "boot_map" is copied to the "backup" +instance, and the "sched:*" and "irq:*" events for the current boot are tr= aced +in the "boot_map". Thus the user can read the previous boot data from the = "backup" +instance without stopping the trace. + +Note that this "backup" instance is readonly, and will be removed automati= cally +if you clear the trace data or read out all trace data from the "trace_pip= e" +or the "trace_pipe_raw" files.