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

2025-01-07 Thread Google
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 the function and function graph > > tracer. > > > > It can only

[PATCH v2] scripts/sorttable: Move code from sorttable.h into sorttable.c

2025-01-07 Thread Steven Rostedt
From: Steven Rostedt Instead of having the main code live in a header file and included twice with MACROs that define the Elf structures for 64 bit or 32 bit, move the code in the C file now that the Elf structures are defined in a union that has both. All accesses to the Elf structure fields are

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

2025-01-07 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Adopt __free() and guard() for trace_fprobe.c to remove gotos. Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/trace_fprobe.c | 129 --- 1 file changed, 60 insertions(+), 69 deletions(-) diff --git a/kernel/tra

[PATCH v5 0/5] tracing/probes: Cleanup with guard and __free for kprobe and fprobe

2025-01-07 Thread Masami Hiramatsu (Google)
Hi, Here is the 5th version of the series to fix and cleanup probe events in ftrace with __free(). The previous series is here; https://lore.kernel.org/all/173629943548.1450013.12412761424554510119.stgit@devnote2/ In this version, I updated [3/5] according to the comment from Steve. Thanks, --

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

2025-01-07 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Simplify __trace_kprobe_create() by removing gotos. Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/trace_kprobe.c | 82 ++- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/kernel/trace/trace_kp

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

2025-01-07 Thread Masami Hiramatsu (Google)
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. Changes in v3: - Rename to __free(free_trace_kprobe) to clarify what function will be calle

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

2025-01-07 Thread Masami Hiramatsu (Google)
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(kfree) is called in each iteration. --- kernel/trace/trace_probe.c | 51

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

2025-01-07 Thread Masami Hiramatsu (Google)
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 objects correctly. Fixes: 6212dd29683e ("tracing/kprobes: Use dyn_event framework f

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

2025-01-07 Thread Google
On Tue, 7 Jan 2025 20:34:32 -0500 Steven Rostedt wrote: > On Wed, 8 Jan 2025 09:38:43 +0900 > Masami Hiramatsu (Google) wrote: > > > > I don't get this? You are telling the compiler not to free tmp, because > > > you > > > decided to free it yourself? Why not just remove the kfree() here > >

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

2025-01-07 Thread Shuai Xue
在 2025/1/7 20:53, Lukas Wunner 写道: On Tue, Jan 07, 2025 at 07:30:28PM +0800, Shuai Xue wrote: 2024/11/23 19:31, Shuai Xue: To this end, define a new TRACING_SYSTEM named pci, add a generic RAS tracepoint for hotplug event to help healthy check, and generate tracepoints for pcie hotplug event

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

2025-01-07 Thread Steven Rostedt
On Wed, 8 Jan 2025 09:38:43 +0900 Masami Hiramatsu (Google) wrote: > > I don't get this? You are telling the compiler not to free tmp, because you > > decided to free it yourself? Why not just remove the kfree() here > > altogether? > > In the for-loop block, the __free() work only when we ex

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

2025-01-07 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Adopt __free() and guard() for trace_fprobe.c to remove gotos. Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/trace_fprobe.c | 129 --- 1 file changed, 60 insertions(+), 69 deletions(-) diff --git a/kernel/tra

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

2025-01-07 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Simplify __trace_kprobe_create() by removing gotos. Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/trace_kprobe.c | 82 ++- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/kernel/trace/trace_kp

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

2025-01-07 Thread Masami Hiramatsu (Google)
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. Changes in v3: - Rename to __free(free_trace_kprobe) to clarify what function will be calle

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

2025-01-07 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Use __free() in trace_probe to cleanup some gotos. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v4: - Run kfree() right before kstrdup() in a loop since __free(kfree) works only when exiting the loop, not each iteration. --- kernel/trace/trace_

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

2025-01-07 Thread Masami Hiramatsu (Google)
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 objects correctly. Fixes: 6212dd29683e ("tracing/kprobes: Use dyn_event framework f

[PATCH v4 0/5] tracing/probes: Cleanup with guard and __free for kprobe and fprobe

2025-01-07 Thread Masami Hiramatsu (Google)
Hi, Here is the 4th version of the series to fix and cleanup probe events in ftrace with __free(). The previous series is here; https://lore.kernel.org/all/173625060316.1375434.11048027439794595989.stgit@devnote2/ In this version, I updated [3/5] and [5/5] according to the comment from Steve. T

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

2025-01-07 Thread Google
On Tue, 7 Jan 2025 10:42:31 -0500 Steven Rostedt wrote: > On Tue, 7 Jan 2025 20:50:35 +0900 > "Masami Hiramatsu (Google)" wrote: > > > @@ -1898,7 +1899,8 @@ create_local_trace_kprobe(char *func, void *addr, > > unsigned long offs, > > bool is_return) > > { > > enum

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

2025-01-07 Thread Google
On Tue, 7 Jan 2025 10:36:43 -0500 Steven Rostedt wrote: > On Tue, 7 Jan 2025 20:50:25 +0900 > "Masami Hiramatsu (Google)" wrote: > > > @@ -1790,18 +1777,15 @@ int traceprobe_expand_dentry_args(int argc, const > > char *argv[], char **buf) > >offsetof(struct

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

2025-01-07 Thread 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 failure > characterization analysis ill

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

2025-01-07 Thread Steven Rostedt
On Tue, 7 Jan 2025 18:02:24 -0500 Steven Rostedt wrote: > diff --git a/src/event-parse.c b/src/event-parse.c > index 33ed7fb47fff..f2e50b0e8992 100644 > --- a/src/event-parse.c > +++ b/src/event-parse.c > @@ -7841,7 +7841,7 @@ static enum tep_errno parse_format(struct tep_event > **eventp, >

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

2025-01-07 Thread Steven Rostedt
On Tue, 7 Jan 2025 11:04:57 + Shiju Jose wrote: > Please find attached format file, which might have failed to parse because of > the > unsupported formats in the libtraceevent you mentioned in the following > thread. > https://lore.kernel.org/lkml/20241127104132.6c172...@gandalf.local.home

Re: [PATCH 00/13] Tracefs support for pKVM

2025-01-07 Thread Vincent Donnefort
On Tue, Jan 07, 2025 at 02:54:39PM -0500, Steven Rostedt wrote: > > Hi Vincent, > > Are you still working on this series? I was expecting an update. Yes I am! I had actually a new version ready just before christmas but I thought I'd better wait for the new year before sending it so it does not

Re: [PATCH 0/3] rtla/timerlat: Set OSNOISE_WORKLOAD for kernel threads

2025-01-07 Thread Steven Rostedt
On Tue, 7 Jan 2025 15:48:20 +0100 Tomas Glozar wrote: > The patchset makes both rtla-timerlat-hist and rtla-timerlat-top set > OSNOISE_WORKLOAD to the proper value ("on" when running with -k, "off" > when running with -u) every time the option is available instead of setting it > only when runni

Re: [PATCH 00/13] Tracefs support for pKVM

2025-01-07 Thread Steven Rostedt
Hi Vincent, Are you still working on this series? I was expecting an update. -- Steve On Wed, 11 Sep 2024 10:30:16 +0100 Vincent Donnefort wrote: > The growing set of features supported by the hypervisor in protected > mode necessitates debugging and profiling tools. Tracefs is the > ideal

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

2025-01-07 Thread Sebastian Andrzej Siewior
On 2024-12-27 12:19:46 [-0500], Steven Rostedt wrote: … > Is easier to understand than: > > if (!mod) { > guard(rcu)(); > mod = __module_text_address(pc); > } > > Because it makes me wonder, why use a guard() for a one liner? Why not? The context ends imme

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

2025-01-07 Thread Steven Rostedt
On Tue, 7 Jan 2025 20:50:35 +0900 "Masami Hiramatsu (Google)" wrote: > @@ -1898,7 +1899,8 @@ create_local_trace_kprobe(char *func, void *addr, > unsigned long offs, > bool is_return) > { > enum probe_print_type ptype; > - struct trace_kprobe *tk; > + struc

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

2025-01-07 Thread Steven Rostedt
On Tue, 7 Jan 2025 20:50:25 +0900 "Masami Hiramatsu (Google)" wrote: > @@ -1790,18 +1777,15 @@ int traceprobe_expand_dentry_args(int argc, const > char *argv[], char **buf) > offsetof(struct file, f_path.dentry), > equal

[PATCH 3/3] rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads

2025-01-07 Thread Tomas Glozar
Apply fix from previous commit also to timerlat-top. Cc: sta...@vger.kernel.org Fixes: cdca4f4e5e8e ("rtla/timerlat_top: Add timerlat user-space support") Signed-off-by: Tomas Glozar --- tools/tracing/rtla/src/timerlat_top.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-)

[PATCH 1/3] rtla/osnoise: Distinguish missing workload option

2025-01-07 Thread Tomas Glozar
osnoise_set_workload returns -1 for both missing OSNOISE_WORKLOAD option and failure in setting the option. Return -1 for missing and -2 for failure to distinguish them. Cc: sta...@vger.kernel.org Signed-off-by: Tomas Glozar --- tools/tracing/rtla/src/osnoise.c | 2 +- 1 file changed, 1 inserti

[PATCH 2/3] rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads

2025-01-07 Thread Tomas Glozar
When using rtla timerlat with userspace threads (-u or -U), rtla disables the OSNOISE_WORKLOAD option in /sys/kernel/tracing/osnoise/options. This option is not re-enabled in a subsequent run with kernel-space threads, leading to rtla collecting no results if the previous run exited abnormally: $

[PATCH 0/3] rtla/timerlat: Set OSNOISE_WORKLOAD for kernel threads

2025-01-07 Thread Tomas Glozar
The patchset makes both rtla-timerlat-hist and rtla-timerlat-top set OSNOISE_WORKLOAD to the proper value ("on" when running with -k, "off" when running with -u) every time the option is available instead of setting it only when running with -u. This prevents rtla timerlat -k from giving no result

Re: [PATCH kernel-next] tracing: Fix uninitialized variable in tracing_set_tracer()

2025-01-07 Thread Steven Rostedt
On Tue, 7 Jan 2025 18:29:20 +0530 Dheeraj Reddy Jonnalagadda wrote: > Fix an issue in the tracing_set_tracer() where the variable ret could > be used uninitialized under certain conditions. Specifically, when > t->use_max_tr is true but tr->cond_snapshot is false, the code would > check the valu

[RFC][PATCH] arm64: scripts/sorttable: Implement sorting mcount_loc at build for arm64

2025-01-07 Thread Steven Rostedt
From: Steven Rostedt The mcount_loc section holds the addresses of the functions that get patched by ftrace when enabling function callbacks. It can contain tens of thousands of entries. These addresses must be sorted. If they are not sorted at compile time, they are sorted at boot. Sorting at bo

[PATCH kernel-next] tracing: Fix uninitialized variable in tracing_set_tracer()

2025-01-07 Thread Dheeraj Reddy Jonnalagadda
Fix an issue in the tracing_set_tracer() where the variable ret could be used uninitialized under certain conditions. Specifically, when t->use_max_tr is true but tr->cond_snapshot is false, the code would check the value of ret without first initializing it. Fixes: a35873a0993b ("tracing: Add con

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

2025-01-07 Thread Lukas Wunner
On Tue, Jan 07, 2025 at 07:30:28PM +0800, Shuai Xue wrote: > 2024/11/23 19:31, Shuai Xue: > > To this end, define a new TRACING_SYSTEM named pci, add a generic RAS > > tracepoint for hotplug event to help healthy check, and generate > > tracepoints for pcie hotplug event. To monitor these tracepoin

[PATCH 2/2] selftests/ftrace: Make uprobe test more robust against binary name

2025-01-07 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Make add_remove_uprobe test case more robust against various real binary name. Current add_remove_uprobe.tc test expects the real binary of /bin/sh is '*/bin/*sh', but it does not work on busybox environment. Instead of using fixed pattern, use readlink to identify

[PATCH 1/2] selftests/ftrace: Fix to use remount when testing mount GID option

2025-01-07 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Fix mount_options.tc to use remount option to mount the tracefs. Since the current implementation does not umount the tracefs, this test always fails because of -EBUSY error. Using remount option will allow us to change the mount option. Fixes: 8b55572e5180 ("trac

[PATCH 0/2] selftests/ftrace: Fix ftracetest test cases

2025-01-07 Thread Masami Hiramatsu (Google)
Here is a couple of patches to fix issues. I think mount_options.tc's one is a real bug(I'm not sure how it worked), but another one is an enhancement for (my) execution environment. Anyway, those should go through kselftests tree. Thank you, --- Masami Hiramatsu (Google) (2): selftests/ftr

Re: [PATCH v3 0/5] tracing/probes: Cleanup with guard and __free for kprobe and fprobe

2025-01-07 Thread Google
On Tue, 7 Jan 2025 20:50:03 +0900 "Masami Hiramatsu (Google)" wrote: > Hi, > > Here is the 3rd version of the series to fix and cleanup probe events in > ftrace with __free(). I resend this without dynevent and argv_free > parts because it has been sent by Steve[1]. And I updated the version >

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

2025-01-07 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Adopt __free() and guard() for trace_fprobe.c to remove gotos. Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/trace_fprobe.c | 129 --- 1 file changed, 60 insertions(+), 69 deletions(-) diff --git a/kernel/tra

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

2025-01-07 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Simplify __trace_kprobe_create() by removing gotos. Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/trace_kprobe.c | 82 ++- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/kernel/trace/trace_kp

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

2025-01-07 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Use __free() in trace_kprobe.c to cleanup code. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v3: - Rename to __free(free_trace_kprobe) to clarify what function will be called. - Add !IS_ERR_OR_NULL() check because alloc_trace_kprobe() returns an e

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

2025-01-07 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Use __free() in trace_probe to cleanup some gotos. Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/trace_probe.c | 52 +++- 1 file changed, 18 insertions(+), 34 deletions(-) diff --git a/kernel/trace/trace_pro

[PATCH v3 0/5] tracing/probes: Cleanup with guard and __free for kprobe and fprobe

2025-01-07 Thread Masami Hiramatsu (Google)
Hi, Here is the 3rd version of the series to fix and cleanup probe events in ftrace with __free(). I resend this without dynevent and argv_free parts because it has been sent by Steve[1]. And I updated the version tag. In this version, I fixed some issues[5/7] and update DEFINE_FREE() tag name to

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

2025-01-07 Thread Masami Hiramatsu (Google)
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 objects correctly. Fixes: 6212dd29683e ("tracing/kprobes: Use dyn_event framework f

Re: [PATCH v2 3/7] tracing: Use __free() for argv in dynevent

2025-01-07 Thread Google
On Tue, 7 Jan 2025 01:03:27 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > Use __free() for the args allocated by argv_split() in dynevent. Lol, the same one has already done by Steve. https://lore.kernel.org/linux-trace-kernel/20241220103313.4a74e...@gandalf.

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

2025-01-07 Thread Shuai Xue
在 2024/11/23 19:31, 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. The failure characterization analysis illustrates the significance of

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

2025-01-07 Thread Shiju Jose
>-Original Message- >From: Steven Rostedt >Sent: 06 January 2025 22:12 >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