[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6a7165ac-2df7-40ae-af68-f4e16cc04fa0@intel.com>
Date: Wed, 7 May 2025 17:02:43 -0700
From: Sohil Mehta <sohil.mehta@...el.com>
To: Steven Rostedt <rostedt@...dmis.org>
CC: <x86@...nel.org>, <linux-kernel@...r.kernel.org>, Xin Li <xin@...or.com>,
"H . Peter Anvin" <hpa@...or.com>, Andy Lutomirski <luto@...nel.org>, "Thomas
Gleixner" <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, "Borislav
Petkov" <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, "Peter
Zijlstra" <peterz@...radead.org>, Sean Christopherson <seanjc@...gle.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim
<namhyung@...nel.org>, Mark Rutland <mark.rutland@....com>, "Alexander
Shishkin" <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
"Kan Liang" <kan.liang@...ux.intel.com>, Tony Luck <tony.luck@...el.com>,
"Paolo Bonzini" <pbonzini@...hat.com>, Vitaly Kuznetsov
<vkuznets@...hat.com>, "Rafael J . Wysocki" <rafael@...nel.org>, Daniel
Lezcano <daniel.lezcano@...aro.org>, Zhang Rui <rui.zhang@...el.com>, Lukasz
Luba <lukasz.luba@....com>, Masami Hiramatsu <mhiramat@...nel.org>, "Mathieu
Desnoyers" <mathieu.desnoyers@...icios.com>, Brian Gerst <brgerst@...il.com>,
Andrew Cooper <andrew.cooper3@...rix.com>, "Kirill A . Shutemov"
<kirill.shutemov@...ux.intel.com>, Jacob Pan <jacob.pan@...ux.microsoft.com>,
Andi Kleen <ak@...ux.intel.com>, Kai Huang <kai.huang@...el.com>, "Nikolay
Borisov" <nik.borisov@...e.com>, <linux-perf-users@...r.kernel.org>,
<linux-edac@...r.kernel.org>, <kvm@...r.kernel.org>,
<linux-pm@...r.kernel.org>, <linux-trace-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 9/9] x86/nmi: Include NMI-source information in
tracepoint and debug prints
On 5/7/2025 2:48 PM, Steven Rostedt wrote:
> On Tue, 6 May 2025 18:21:45 -0700
> Sohil Mehta <sohil.mehta@...el.com> wrote:
>
>> diff --git a/include/trace/events/nmi.h b/include/trace/events/nmi.h
>> index 18e0411398ba..6e4a1ff70a44 100644
>> --- a/include/trace/events/nmi.h
>> +++ b/include/trace/events/nmi.h
>> @@ -10,29 +10,32 @@
>>
>> TRACE_EVENT(nmi_handler,
>>
>> - TP_PROTO(void *handler, s64 delta_ns, int handled),
>> + TP_PROTO(void *handler, s64 delta_ns, int handled, unsigned long source_bitmap),
>
> Even though x86 is currently the only architecture using the nmi
> tracepoint, this "source_bitmap" makes it become very x86 specific.
>
Sure. Will move it into x86.
> This file should be moved into arch/x86/include/asm/trace/
>
> And that would require adding to the Makefile:
>
> CFLAGS_nmi.o := -I $(src)/../include/asm/trace
>
Thank you for the detailed instructions. It makes it a lot easier.
> diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
> index 183e3e717326..b9ece0b63ca7 100644
> --- a/arch/x86/kernel/nmi.c
> +++ b/arch/x86/kernel/nmi.c
> @@ -202,7 +202,7 @@ static int nmi_handle(unsigned int type, struct pt_regs *regs)
> thishandled = a->handler(type, regs);
> handled += thishandled;
> delta = sched_clock() - delta;
> - trace_nmi_handler(a->handler, (int)delta, thishandled);
> + trace_nmi_handler(a->handler, (int)delta, thishandled, source_bitmap);
>
> nmi_check_duration(a, delta);
> }
Also, I just realized that the source_bitmap information might be
incorrect for !NMI_LOCAL. With the new changes suggested by PeterZ in
patch 5, the source_bitmap would be significantly different from the
original one received from fred_event_data().
I need to figure out a solution to print it accurately in all situations.
Sohil
Powered by blists - more mailing lists