From: Eugen Hristev <eugen.hristev@linaro.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, tglx@linutronix.de, andersson@kernel.org,
pmladek@suse.com, rdunlap@infradead.org, corbet@lwn.net,
david@redhat.com, mhocko@suse.com, tudor.ambarus@linaro.org,
mukesh.ojha@oss.qualcomm.com,
linux-arm-kernel@lists.infradead.org,
linux-hardening@vger.kernel.org, jonechou@google.com,
linux-doc@vger.kernel.org, devicetree@vger.kernel.org,
linux-remoteproc@vger.kernel.org, linux-arch@vger.kernel.org,
tony.luck@intel.com, kees@kernel.org
Subject: Re: [PATCH 00/26] Introduce meminspect
Date: Wed, 19 Nov 2025 20:24:23 +0200 [thread overview]
Message-ID: <b0102b82-9ae8-4e01-ba27-44b78b710fca@linaro.org> (raw)
In-Reply-To: <20251119131534.392277e3@gandalf.local.home>
Hello Steven,
On 11/19/25 20:15, Steven Rostedt wrote:
> On Wed, 19 Nov 2025 17:44:01 +0200
> Eugen Hristev <eugen.hristev@linaro.org> wrote:
>
>> Once you have all the files simply use `cat` to put them all together,
>> in the order of the indexes.
>> For my kernel config and setup, here is my cat command : (you can use a script
>> or something, I haven't done that so far):
>
> Interesting. Hmm, it seems this could be used with the persistent ring
> buffer code as well. But if the firmware does not keep the memory around on
> reboot (where the buffer would be reloaded), you could mark the persistent
> ring buffer's memory to be inspected.
I was kinda hoping I could get a chance to talk to you about this.
I managed to mark the trace buffer for inspection. By using the cmd line
argument to have it preallocated, it was very easy to just mark it for
inspection and dump it on a crash, as a dedicated meminspect region.
>
> The persistent ring buffer creates a single allocation to hold all per-cpu
> memory in a single region. That is, because on a crash and reboot, it
> expects that memory to be at the same location and does a verification
> check to see if it contains a valid buffer. If it does, it will recreate it
> for view in the instance directory of choice.
>
> Now if this same range is marked for inspection, you could then download
> the entire contents of the persistent ring buffer after a crash. It would
> be trivial to update trace-cmd's restore functionality to rebuild a
> trace.dat file from it. It would require saving the event formats of the
> running kernel before the crash, but that's not hard to do.
The problem is that all the meta-data is not allocated inside the
preallocated buffer. The meta-data is kmalloced all around the code. I
mean the structs that hold the information on what's in the buffer. You
know what I mean.
And all these kmalloced things, turn out to be in order of hundreds just
on a kernel boot, which I tested. This is not feasible for the
meminspect table, as it would get overcrowded very easily.
I thought of perhaps trying to kmalloc all of them in a dedicated cache,
but I haven't progressed on that. Another idea would be to try to
recreate the meta, but I have not found a way to do it yet.>
> That is, by using the persistent ring buffer code with the meminspect, if
> the firmware doesn't save the memory across reboots but allows you to dump
> it to disk, you can enable tracing within the persistent ring buffer, on
> crash, extract the buffer, and then use trace-cmd to rebuild a trace.dat
> file that you can now inspect, and see the trace that lead up to the crash.
I used 'crash' tool with trace plugin and I am able to see all the trace
contents, but, with the limitation above. (To achieve this, I dumped a
huge area to include it, so , not feasible for my goal )
>
> Now I don't have any hardware that uses this feature (not that I know of),
> but if others find this useful, I would most definitely help them implement
> it.
We could have some drivers pass the inspection table and then store it
in ramoops e.g., tapping into pstore. This idea has been going around,
but I have not had the chance to write a pstore thing yet.
So , I was stuck, and I was hoping to talk to you, either by email or
maybe at Plumbers in Tokyo where I have a talk about meminspect.
Thanks for looking into it,
Eugen
>
> -- Steve
next prev parent reply other threads:[~2025-11-19 18:24 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-19 15:44 [PATCH 00/26] Introduce meminspect Eugen Hristev
2025-11-19 15:44 ` [PATCH 01/26] kernel: " Eugen Hristev
2025-11-22 0:04 ` kernel test robot
2025-11-24 3:02 ` Bagas Sanjaya
2025-11-19 15:44 ` [PATCH 02/26] init/version: Annotate static information into meminspect Eugen Hristev
2025-11-19 15:44 ` [PATCH 03/26] mm/percpu: " Eugen Hristev
2025-11-21 17:13 ` kernel test robot
2025-11-21 19:13 ` kernel test robot
2025-11-19 15:44 ` [PATCH 04/26] cpu: " Eugen Hristev
2025-11-19 15:44 ` [PATCH 05/26] genirq/irqdesc: " Eugen Hristev
2025-11-19 15:44 ` [PATCH 06/26] timers: " Eugen Hristev
2025-11-19 15:44 ` [PATCH 07/26] kernel/fork: " Eugen Hristev
2025-11-19 15:44 ` [PATCH 08/26] mm/page_alloc: " Eugen Hristev
2025-11-19 15:44 ` [PATCH 09/26] mm/show_mem: " Eugen Hristev
2025-11-19 15:44 ` [PATCH 10/26] mm/swapfile: " Eugen Hristev
2025-11-19 15:44 ` [PATCH 11/26] kernel/vmcore_info: Register dynamic " Eugen Hristev
2025-11-19 15:44 ` [PATCH 12/26] kernel/configs: " Eugen Hristev
2025-11-21 22:16 ` kernel test robot
2025-11-19 15:44 ` [PATCH 13/26] mm/init-mm: Annotate static " Eugen Hristev
2025-11-19 15:44 ` [PATCH 14/26] panic: " Eugen Hristev
2025-11-19 15:44 ` [PATCH 15/26] kallsyms: " Eugen Hristev
2025-11-19 15:44 ` [PATCH 16/26] mm/mm_init: " Eugen Hristev
2025-11-19 15:44 ` [PATCH 17/26] sched/core: Annotate runqueues " Eugen Hristev
2025-11-19 15:44 ` [PATCH 18/26] mm/memblock: Add MEMBLOCK_INSPECT flag Eugen Hristev
2025-11-19 15:44 ` [PATCH 19/26] mm/numa: Register information into meminspect Eugen Hristev
2025-11-19 15:44 ` [PATCH 20/26] mm/sparse: " Eugen Hristev
2025-11-19 15:44 ` [PATCH 21/26] printk: " Eugen Hristev
2025-11-19 15:44 ` [PATCH 22/26] remoteproc: qcom: Extract minidump definitions into a header Eugen Hristev
2025-11-19 15:44 ` [PATCH 23/26] soc: qcom: Add minidump driver Eugen Hristev
2025-11-22 4:55 ` kernel test robot
2025-11-22 7:54 ` kernel test robot
2025-11-19 15:44 ` [PATCH 24/26] soc: qcom: smem: Add minidump device Eugen Hristev
2025-11-19 15:44 ` [PATCH 25/26] dt-bindings: reserved-memory: Add Google Kinfo Pixel reserved memory Eugen Hristev
2025-11-19 16:02 ` Krzysztof Kozlowski
2025-11-19 16:19 ` Eugen Hristev
2025-11-20 7:21 ` Krzysztof Kozlowski
2025-11-19 16:33 ` Rob Herring (Arm)
2025-11-19 22:41 ` Rob Herring
2025-11-19 15:44 ` [PATCH 26/26] meminspect: Add Kinfo compatible driver Eugen Hristev
2025-11-19 16:30 ` [PATCH 00/26] Introduce meminspect Lorenzo Stoakes
2025-11-19 17:11 ` Eugen Hristev
2025-11-19 17:14 ` Lorenzo Stoakes
2025-11-19 17:19 ` Eugen Hristev
2025-11-19 18:15 ` Steven Rostedt
2025-11-19 18:24 ` Eugen Hristev [this message]
2025-11-19 18:38 ` Steven Rostedt
2025-12-13 6:48 ` Eugen Hristev
2025-12-13 6:57 ` Randy Dunlap
2025-12-13 7:22 ` Eugen Hristev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0102b82-9ae8-4e01-ba27-44b78b710fca@linaro.org \
--to=eugen.hristev@linaro.org \
--cc=andersson@kernel.org \
--cc=corbet@lwn.net \
--cc=david@redhat.com \
--cc=devicetree@vger.kernel.org \
--cc=jonechou@google.com \
--cc=kees@kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=mukesh.ojha@oss.qualcomm.com \
--cc=pmladek@suse.com \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=tudor.ambarus@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).