[PATCH v5] PCI: hotplug: Add a generic RAS tracepoint for hotplug event

2025-01-08 Thread Shuai Xue
Hotplug events are critical indicators for analyzing hardware health, particularly in AI supercomputers where surprise link downs can significantly impact system performance and reliability. To this end, define a new TRACING_SYSTEM named pci, add a generic RAS tracepoint for hotplug event to help

Re: [PATCH v5 5/5] tracing: Adopt __free() and guard() for trace_fprobe.c

2025-01-08 Thread Google
On Wed, 8 Jan 2025 10:07:36 -0500 Steven Rostedt wrote: > On Wed, 8 Jan 2025 11:11:30 +0900 > "Masami Hiramatsu (Google)" wrote: > > > @@ -1234,24 +1223,26 @@ static int __trace_fprobe_create(int argc, const > > char *argv[]) > > trace_probe_log_err(0, BAD_PROBE_ADDR); > >

Re: [PATCH v5 4/5] tracing/kprobes: Simplify __trace_kprobe_create() by removing gotos

2025-01-08 Thread Google
On Wed, 8 Jan 2025 10:11:11 -0500 Steven Rostedt wrote: > On Wed, 8 Jan 2025 11:11:18 +0900 > "Masami Hiramatsu (Google)" wrote: > > > -static int __trace_kprobe_create(int argc, const char *argv[]) > > +static int ___trace_kprobe_create(int argc, const char *argv[], > > +

Re: [PATCH v4] PCI: hotplug: Add a generic RAS tracepoint for hotplug event

2025-01-08 Thread Shuai Xue
在 2025/1/9 01:59, Bjorn Helgaas 写道: On Wed, Jan 08, 2025 at 05:04:25PM +0800, Shuai Xue wrote: 在 2025/1/8 07:19, Bjorn Helgaas 写道: On Sat, Nov 23, 2024 at 07:31:08PM +0800, Shuai Xue wrote: Hotplug events are critical indicators for analyzing hardware health, particularly in AI supercompute

Re: [PATCH v4] PCI: hotplug: Add a generic RAS tracepoint for hotplug event

2025-01-08 Thread Bjorn Helgaas
On Wed, Jan 08, 2025 at 05:04:25PM +0800, Shuai Xue wrote: > 在 2025/1/8 07:19, Bjorn Helgaas 写道: > > On Sat, Nov 23, 2024 at 07:31:08PM +0800, Shuai Xue wrote: > > > Hotplug events are critical indicators for analyzing hardware health, > > > particularly in AI supercomputers where surprise link dow

Re: [PATCH 5/8] module: introduce MODULE_STATE_GONE

2025-01-08 Thread Daniel Thompson
On Fri, Dec 27, 2024 at 09:28:22AM +0200, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > In order to use execmem's API for temporal remapping of the memory > allocated from ROX cache as writable, there is a need to distinguish > between the state when the module is being formed and t

Re: [PATCH v2 1/4] ftrace: Add print_function_args()

2025-01-08 Thread Steven Rostedt
On Wed, 8 Jan 2025 11:19:11 + Alan Maguire wrote: > >>> + trace_seq_printf(s, "("); > >>> + > >>> + if (!args) > >>> + goto out; > >>> + if (lookup_symbol_name(func, name)) > >>> + goto out; > >>> + > >>> + btf = bpf_get_btf_vmlinux(); > >>>

Re: [PATCH v2 1/4] ftrace: Add print_function_args()

2025-01-08 Thread Alan Maguire
On 08/01/2025 15:24, Steven Rostedt wrote: > On Wed, 8 Jan 2025 11:19:11 + > Alan Maguire wrote: > > + trace_seq_printf(s, "("); > + > + if (!args) > + goto out; > + if (lookup_symbol_name(func, name)) > + goto out; > +

Re: [PATCH v5 4/5] tracing/kprobes: Simplify __trace_kprobe_create() by removing gotos

2025-01-08 Thread Steven Rostedt
On Wed, 8 Jan 2025 11:11:18 +0900 "Masami Hiramatsu (Google)" wrote: > -static int __trace_kprobe_create(int argc, const char *argv[]) > +static int ___trace_kprobe_create(int argc, const char *argv[], > + struct traceprobe_parse_context *ctx) > { I'm not sure I c

Re: [PATCH v5 3/5] tracing: Use __free() for kprobe events to cleanup

2025-01-08 Thread Steven Rostedt
On Wed, 8 Jan 2025 11:11:07 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > Use __free() in trace_kprobe.c to cleanup code. > > Signed-off-by: Masami Hiramatsu (Google) > --- > Changes in v4: > - Use no_free_ptr(tk)->tp instead of assiging NULL to tk. > Cha

Re: [PATCH v5 1/5] tracing/kprobes: Fix to free objects when failed to copy a symbol

2025-01-08 Thread Steven Rostedt
On Wed, 8 Jan 2025 11:10:46 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > In __trace_kprobe_create(), if something fails it must goto error block > to free objects. But when strdup() a symbol, it returns without that. > Fix it to goto the error block to free ob

Re: [PATCH v5 2/5] tracing: Use __free() in trace_probe for cleanup

2025-01-08 Thread Steven Rostedt
On Wed, 8 Jan 2025 11:10:57 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > Use __free() in trace_probe to cleanup some gotos. > > Signed-off-by: Masami Hiramatsu (Google) > --- > Changes in v5: > - Fix to remove kfree() in for loop. Since I confirmed __free

Re: [PATCH v5 5/5] tracing: Adopt __free() and guard() for trace_fprobe.c

2025-01-08 Thread Steven Rostedt
On Wed, 8 Jan 2025 11:11:30 +0900 "Masami Hiramatsu (Google)" wrote: > @@ -1234,24 +1223,26 @@ static int __trace_fprobe_create(int argc, const char > *argv[]) > trace_probe_log_err(0, BAD_PROBE_ADDR); > else if (ret != -ENOMEM && ret != -EEXIST) >

[PATCH v2 11/12] KVM: arm64: Add support for hyp events

2025-01-08 Thread Vincent Donnefort
Following the introduction of hyp tracing for pKVM, add the ability to describe and emit events into the hypervisor ring-buffers. Hypervisor events are declared into kvm_hypevents.h and can be called with trace_() in a similar fashion to the kernel tracefs events. hyp_enter and hyp_exit events ar

[PATCH v2 12/12] KVM: arm64: Add kselftest for tracefs hyp tracefs

2025-01-08 Thread Vincent Donnefort
Add a test to validate the newly introduced tracefs interface for the pKVM hypervisor. This test covers the usage of extended timestamp and coherence of the tracing clock. Signed-off-by: Vincent Donnefort diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h index 784f

[PATCH v2 10/12] KVM: arm64: Add trace interface for hyp tracefs

2025-01-08 Thread Vincent Donnefort
The trace interface is solely here to reset tracing. Non-consuming read is not yet supported due to the lack of support in the ring-buffer meta page. Signed-off-by: Vincent Donnefort diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h index 81bae121a4fe..08b6a021b84e

[PATCH v2 09/12] KVM: arm64: Add raw interface for hyp tracefs

2025-01-08 Thread Vincent Donnefort
The raw interface enables userspace tools such as trace-cmd to directly read the ring-buffer without any decoding by the kernel. Signed-off-by: Vincent Donnefort diff --git a/arch/arm64/kvm/hyp_trace.c b/arch/arm64/kvm/hyp_trace.c index 78193dbd8a33..3d2a58977442 100644 --- a/arch/arm64/kvm/hyp_

[PATCH v2 08/12] KVM: arm64: Add clock for hyp tracefs

2025-01-08 Thread Vincent Donnefort
Configure the hypervisor tracing clock before starting tracing. For tracing purpose, the boot clock is interesting as it doesn't stop on suspend. However, it is corrected on a regular basis, which implies we need to re-evaluate it every once in a while. Cc: John Stultz Cc: Thomas Gleixner Cc: St

[PATCH v2 07/12] KVM: arm64: Add hyp tracing to tracefs

2025-01-08 Thread Vincent Donnefort
When running with KVM protected mode, the hypervisor is able to generate events into tracefs compatible ring-buffers. Plug those ring-buffers to tracefs. The interface is found in hyp/ and contains the same hierarchy as any host instances easing the support by existing user-space tools. This curre

[PATCH v2 06/12] KVM: arm64: Add tracing support for the pKVM hyp

2025-01-08 Thread Vincent Donnefort
When running with protected mode, the host has very little knowledge about what is happening in the hypervisor. Of course this is an essential feature for security but nonetheless, that piece of code growing with more responsibilities, we need now a way to debug and profile it. Tracefs by its relia

[PATCH v2 05/12] KVM: arm64: Add clock support in the nVHE hyp

2025-01-08 Thread Vincent Donnefort
By default, the arm64 host kernel is using the arch timer as a source for sched_clock. Conveniently, EL2 has access to that same counter, allowing to generate clock values that are synchronized. The clock needs nonetheless to be setup with the same slope values as the kernel. Introducing at the sa

[PATCH v2 03/12] ring-buffer: Expose buffer_data_page material

2025-01-08 Thread Vincent Donnefort
In preparation for allowing the write of ring-buffer compliant pages outside of ring_buffer.c, move to the header, struct buffer_data_page and timestamp encoding functions into the publicly available ring_buffer.h. Signed-off-by: Vincent Donnefort diff --git a/include/linux/ring_buffer.h b/inclu

[PATCH v2 04/12] KVM: arm64: Support unaligned fixmap in the nVHE hyp

2025-01-08 Thread Vincent Donnefort
Return the fixmap VA with the page offset, instead of the page base address. Signed-off-by: Vincent Donnefort diff --git a/arch/arm64/kvm/hyp/nvhe/mm.c b/arch/arm64/kvm/hyp/nvhe/mm.c index 8850b591d775..c5a9d8874eb2 100644 --- a/arch/arm64/kvm/hyp/nvhe/mm.c +++ b/arch/arm64/kvm/hyp/nvhe/mm.c @@

[PATCH v2 02/12] ring-buffer: Introducing ring-buffer remote

2025-01-08 Thread Vincent Donnefort
A ring-buffer remote is an entity outside of the kernel (most likely a firmware or a hypervisor) capable of writing events in a ring-buffer following the same format as the tracefs ring-buffer. To setup the ring-buffer on the kernel side, a description of the pages (struct trace_page_desc) is nece

[PATCH v2 01/12] ring-buffer: Check for empty ring-buffer with rb_num_of_entries()

2025-01-08 Thread Vincent Donnefort
Currently there are two ways of identifying an empty ring-buffer. One relying on the current status of the commit / reader page (rb_per_cpu_empty()) and the other on the write and read counters (rb_num_of_entries() used in rb_get_reader_page()). with rb_num_of_entries(). This intends to ease later

[PATCH v2 00/12] Tracefs support for pKVM

2025-01-08 Thread Vincent Donnefort
The growing set of features supported by the hypervisor in protected mode necessitates debugging and profiling tools. Tracefs is the ideal candidate for this task: * It is simple to use and to script. * It is supported by various tools, from the trace-cmd CLI to the Android web-based perf

Re: [PATCH v2 1/4] ftrace: Add print_function_args()

2025-01-08 Thread Alan Maguire
On 08/01/2025 04:52, Masami Hiramatsu (Google) wrote: > On Wed, 8 Jan 2025 10:30:08 +0800 > Donglin Peng wrote: > >> Steven Rostedt 于2024年12月24日 周二04:14写道: >> >>> From: Sven Schnelle >>> >>> Add a function to decode argument types with the help of BTF. Will >>> be used to display arguments in th

RE: [PATCH 1/1] tracing: Support reading trace event format file larger than PAGE_SIZE

2025-01-08 Thread Shiju Jose
>-Original Message- >From: Steven Rostedt >Sent: 07 January 2025 23:19 >To: Shiju Jose >Cc: mhira...@kernel.org; mathieu.desnoy...@efficios.com; linux-trace- >ker...@vger.kernel.org; linux-ker...@vger.kernel.org; Linuxarm >; Jonathan Cameron >; tanxiaofei ; >Zengtao (B) >Subject: Re: [PA

RE: [PATCH 1/1] tracing: Support reading trace event format file larger than PAGE_SIZE

2025-01-08 Thread Shiju Jose
>-Original Message- >From: Steven Rostedt >Sent: 07 January 2025 23:02 >To: Shiju Jose >Cc: mhira...@kernel.org; mathieu.desnoy...@efficios.com; linux-trace- >ker...@vger.kernel.org; linux-ker...@vger.kernel.org; Linuxarm >; Jonathan Cameron >; tanxiaofei ; >Zengtao (B) >Subject: Re: [PA

[PATCH v3 26/28] kprobes: Use RCU in all users of __module_text_address().

2025-01-08 Thread Sebastian Andrzej Siewior
__module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Cc: David S. Miller Cc: Anil S Keshavamurthy Cc: Masami Hiramatsu Cc: Naveen N Rao Cc: linux-trace-k

[PATCH v3 25/28] bpf: Use RCU in all users of __module_text_address().

2025-01-08 Thread Sebastian Andrzej Siewior
__module_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_address() with RCU. Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Eduard Zingerman Cc: Hao Luo Cc: Jiri Olsa

[PATCH v3 20/28] powerpc/ftrace: Use RCU in all users of __module_text_address().

2025-01-08 Thread Sebastian Andrzej Siewior
__module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Cc: Christophe Leroy Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Michael Eller

[PATCH v3 19/28] LoongArch: ftrace: Use RCU in all users of __module_text_address().

2025-01-08 Thread Sebastian Andrzej Siewior
__module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Cc: Huacai Chen Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Steven Rostedt Cc: WANG Xuerui Cc: linux-

[PATCH v3 17/28] arm64: module: Use RCU in all users of __module_text_address().

2025-01-08 Thread Sebastian Andrzej Siewior
__module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Cc: Catalin Marinas Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Steven Rostedt Cc: Will Deacon Cc: li

[PATCH v3 06/28] module: Use RCU in find_module_all().

2025-01-08 Thread Sebastian Andrzej Siewior
The modules list and module::kallsyms can be accessed under RCU assumption. Remove module_assert_mutex_or_preempt() from find_module_all() so it can be used under RCU protection without warnings. Update its callers to use RCU protection instead of preempt_disable(). Cc: Jiri Kosina Cc: Joe Lawre

Re: [PATCH v4] PCI: hotplug: Add a generic RAS tracepoint for hotplug event

2025-01-08 Thread Shuai Xue
在 2025/1/8 07:19, Bjorn Helgaas 写道: On Sat, Nov 23, 2024 at 07:31:08PM +0800, Shuai Xue wrote: Hotplug events are critical indicators for analyzing hardware health, particularly in AI supercomputers where surprise link downs can significantly impact system performance and reliability. The fai