Hi Leo,
-----Original Message----- From: CoreSight coresight-bounces@lists.linaro.org On Behalf Of Leo Yan Sent: Sunday, August 29, 2021 8:40 AM To: Linu Cherian linuc.decode@gmail.com Cc: Coresight ML coresight@lists.linaro.org; Sunil Kovvuri Goutham sgoutham@marvell.com Subject: [EXT] Re: Enabling support in coresight for Panic - Kdump
External Email
Hi Linu,
On Sat, Aug 28, 2021 at 10:24:06AM +0530, Linu Cherian wrote:
Hi Leo,
We are interested in adding support in Coresight driver to collect trace
data at
the time of kernel panic. Would like to know the current status of this patch series you posted some time back [1].
Yes, the link [1] is the last commit for enabling kdump for CoreSight. I stalled for related work since then on with two main reasons:
Firstly, the last patch set used sysfs mode for CoreSight kdump; on the other hand, if we look into the Intel-PT's implementation, it uses perf tool to enable the hardware tracing and when the kernel panic happens, it stops hardware tracing and the tracing data is stored in perf's AUX ring buffer.
As discussed, we think it's good to use perf mode for CoreSight kdump rather than using sysfs mode.
You could look into more details in the design doc [2] for related info, it gives some summary for both Intel-pt and Arm CoreSight.
The second reason is at the time being, perf snapshot mode was not enabled yet. From my understanding, the nature way to use CoreSight kudmp is to firstly enable perf snapshot mode for all CPUs, when the kernel panic happens, the kernel triggers kdump callback to save hardware tracing data into AUX ring buffer. So it's good to test below flow for CoreSight kdump:
$ perf record -e cs_etm// -S -a -- program kernel panic ... the CoreSight trace data is stored into DRAM
If no one is working on this, we would like to revive and resubmit this.
I am backlog now; so you are welcome to continue the work.
Just remind two things:
You could see now the CoreSight driver support different buffer modes (flat mode, scatter mode, and CATU mode). As the first step, I strongly suggest you firstly support flat mode, this would be much easier for the implementation for crash tool, afterwards, we can enable other modes step by step.
IIUC, Intel-pt only uses perf's AUX ring buffer; Arm CoreSight uses two kinds of buffers: bounce buffer and perf's AUX ring buffer, I personally think we should extract trace data from bounce buffer rather than AUX ring buffer, this can simplify the code in crash tool as well.
Appreciate your guidance on this.
Welcome! If anything is not clear, please let me know.
Thanks a lot for the details. Will look into this and get back if something is not clear.
-- Linu Cherian