Re: [PATCH] fgraph: fix unused value in register_ftrace_graph()

2024-10-21 Thread Steven Rostedt
On Mon, 21 Oct 2024 12:24:29 +0200 Gianfranco Trad wrote: > Coverity reports unused assignment to value ret. [1] > ret is assigned to 0 here, but that stored value is overwritten before > it can be used. The overwrite might happen either at line 1277, 1290 > or eventually at line 1306. Therefore

Re: [PATCH v3 0/2] uprobes: Improve scalability by reducing the contention on siglock

2024-10-21 Thread Liao, Chang
在 2024/10/22 1:18, Andrii Nakryiko 写道: > On Mon, Oct 21, 2024 at 3:43 AM Liao, Chang wrote: >> >> >> >> 在 2024/10/12 3:34, Andrii Nakryiko 写道: >>> On Tue, Sep 17, 2024 at 7:05 PM Liao, Chang wrote: Hi, Peter and Masami I look forward to your inputs on these series. Andrii h

Re: [PATCH RFC 1/2] m68k: Add tracirqs

2024-10-21 Thread Jean-Michel Hautbois
Hi Steve, On 22/10/2024 07:28, Steven Rostedt wrote: On Mon, 21 Oct 2024 11:44:42 +0200 Jean-Michel Hautbois wrote: The TRACE_IRQFLAGS_SUPPORT requires the architecture to call trace_hardirqs_off() when interrupts are disabled and trace_hardirqs_on() when they are enabled. Add those calls to

Re: [PATCH] tracing/probes: fix traceprobe out-of-bounds argument allocation

2024-10-21 Thread Google
Hi, On Thu, 5 Sep 2024 00:19:16 +0200 "Fernando F. Mancera" wrote: > Hi, > > On 26/08/2024 01:56, Masami Hiramatsu (Google) wrote: > > On Sun, 25 Aug 2024 19:06:22 +0200 > > "Fernando F. Mancera" wrote: > > > >> Hi, > >> > >> On 25/08/2024 09:41, Masami Hiramatsu (Google) wrote: > >>> Hi, > >

Re: [PATCH RFC 1/2] m68k: Add tracirqs

2024-10-21 Thread Steven Rostedt
On Mon, 21 Oct 2024 11:44:42 +0200 Jean-Michel Hautbois wrote: > The TRACE_IRQFLAGS_SUPPORT requires the architecture to call > trace_hardirqs_off() when interrupts are disabled and > trace_hardirqs_on() when they are enabled. > Add those calls to do_IRQ function. > > Signed-off-by: Jean-Michel

Re: [PATCH v2] objpool: fix choosing allocation for percpu slots

2024-10-21 Thread Google
On Mon, 26 Aug 2024 08:07:18 +0200 Viktor Malik wrote: > objpool intends to use vmalloc for default (non-atomic) allocations of > percpu slots and objects. However, the condition checking if GFP flags > are equal to GFP_ATOMIC is wrong b/c GFP_ATOMIC is a combination of bits You meant "whether G

Re: [PATCH v3 1/2] uprobes: Remove redundant spinlock in uprobe_deny_signal()

2024-10-21 Thread Google
On Thu, 15 Aug 2024 01:46:28 + Liao Chang wrote: > Since clearing a bit in thread_info is an atomic operation, the spinlock > is redundant and can be removed, reducing lock contention is good for > performance. > Looks good to me. Acked-by: Masami Hiramatsu (Google) Thanks! > Acked-by:

Re: [PATCH v3 2/2] uprobes: Remove the spinlock within handle_singlestep()

2024-10-21 Thread Google
Hi Liao, On Thu, 15 Aug 2024 01:46:29 + Liao Chang wrote: > This patch introduces a flag to track TIF_SIGPENDING is suppress > temporarily during the uprobe single-step. Upon uprobe singlestep is > handled and the flag is confirmed, it could resume the TIF_SIGPENDING > directly without acqui

Re: [PATCH] uprobes: Remove redundant spinlock in uprobe_deny_signal

2024-10-21 Thread Google
On Tue, 22 Oct 2024 11:22:22 +0900 Masami Hiramatsu (Google) wrote: > On Wed, 31 Jul 2024 16:12:32 +0200 > Oleg Nesterov wrote: > > > On 07/31, Liao Chang wrote: > > > > > > --- a/kernel/events/uprobes.c > > > +++ b/kernel/events/uprobes.c > > > @@ -1979,9 +1979,7 @@ bool uprobe_deny_signal(voi

Re: [PATCH] fgraph: Use CPU hotplug mechanism to initialize idle shadow stacks

2024-10-21 Thread Steven Rostedt
On Mon, 21 Oct 2024 14:58:10 +0900 Masami Hiramatsu (Google) wrote: > > + if (!fgraph_initialized) { > > + ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, > > "fgraph_idle_init", > > Nit: Maybe it is better to call it as "tracing/fgraph:online" ? Ah this already went upstream. But y

Re: [PATCH v2] tracing/probes: Fix MAX_TRACE_ARGS limit handling

2024-10-21 Thread Mikel Rychliski
On Monday, September 30, 2024 4:26:54 P.M. EDT Mikel Rychliski wrote: > V1 -> V2: Return error instead of dropping excessive arguments Hi Masami, Thanks for the feedback so far. Was wondering if you had a chance to look at the updated patch? Thanks, Mikel

Re: [PATCH] uprobes: Remove redundant spinlock in uprobe_deny_signal

2024-10-21 Thread Google
On Wed, 31 Jul 2024 16:12:32 +0200 Oleg Nesterov wrote: > On 07/31, Liao Chang wrote: > > > > --- a/kernel/events/uprobes.c > > +++ b/kernel/events/uprobes.c > > @@ -1979,9 +1979,7 @@ bool uprobe_deny_signal(void) > > WARN_ON_ONCE(utask->state != UTASK_SSTEP); > > > > if (task_sigpendin

Re: [PATCH v12 02/24] docs: geniezone: Introduce GenieZone hypervisor

2024-10-21 Thread 陳麗如
On Tue, 2024-07-30 at 07:13 -0700, Randy Dunlap wrote: > > External email : Please do not click links or open attachments until > you have verified the sender or the content. > Hi-- > > On 7/30/24 1:24 AM, Liju-clr Chen wrote: > > From: Yingshiuan Pan > > > > GenieZone is MediaTek propr

Re: [PATCH v6 6/8] x86/module: prepare module loading for ROX allocations of text

2024-10-21 Thread Nathan Chancellor
alid opcode: [#1] PREEMPT SMP NOPTI [0.885434] CPU: 3 UID: 0 PID: 157 Comm: modprobe Tainted: G W 6.12.0-rc3-debug-next-20241021-06324-g63b3ff03d91a #1 291f0fd70f293827edec681d3c5304f5807a3c7b [0.887084] Tainted: [W]=WARN [0.887409] Hardware name: QEMU Standar

[PATCH v2 2/2] trace: kdb: Replace simple_strtoul with kstrtoul in kdb_ftdump

2024-10-21 Thread Nir Lichtman
The function simple_strtoul performs no error checking in scenarios where the input value overflows the intended output variable. This results in this function successfully returning, even when the output does not match the input string (aka the function returns successfully even when the result is

[PATCH v2 1/2] kdb: Replace the use of simple_strto with safer kstrto in kdb_main

2024-10-21 Thread Nir Lichtman
The simple_str* family of functions perform no error checking in scenarios where the input value overflows the intended output variable. This results in these functions successfully returning even when the output does not match the input string. Or as it was mentioned [1], "...simple_strtol(), sim

[PATCH v2 0/2] Replace the use of simple_strtol/ul functions with kstrto

2024-10-21 Thread Nir Lichtman
The simple_str* family of functions perform no error checking in scenarios where the input value overflows the intended output variable. This results in these function successfully returning even when the output does not match the input string. Or as it was mentioned [1], "...simple_strtol(), simp

Re: [syzbot] [trace?] [bpf?] KASAN: slab-use-after-free Read in bpf_trace_run2 (2)

2024-10-21 Thread Jordan Rife
I performed a bisection and this issue starts with commit a363d27cdbc2 ("tracing: Allow system call tracepoints to handle page faults") which introduces this change. > + * > + * With @syscall=0, the tracepoint callback array dereference is > + * protected by disabling preemption. > + * With @sysca

Re: [PATCH v3 0/2] uprobes: Improve scalability by reducing the contention on siglock

2024-10-21 Thread Andrii Nakryiko
On Mon, Oct 21, 2024 at 3:43 AM Liao, Chang wrote: > > > > 在 2024/10/12 3:34, Andrii Nakryiko 写道: > > On Tue, Sep 17, 2024 at 7:05 PM Liao, Chang wrote: > >> > >> Hi, Peter and Masami > >> > >> I look forward to your inputs on these series. Andrii has proven they are > >> hepful for uprobe scalab

Re: [PATCH v2 tip/perf/core 1/2] uprobes: allow put_uprobe() from non-sleepable softirq context

2024-10-21 Thread Andrii Nakryiko
On Mon, Oct 21, 2024 at 3:31 AM Peter Zijlstra wrote: > > On Fri, Oct 18, 2024 at 11:22:00AM -0700, Andrii Nakryiko wrote: > > On Fri, Oct 18, 2024 at 1:26 AM Peter Zijlstra wrote: > > > > > > On Mon, Oct 07, 2024 at 05:25:55PM -0700, Andrii Nakryiko wrote: > > > > Currently put_uprobe() might tr

Re: [PATCH v17 01/16] function_graph: Pass ftrace_regs to entryfunc

2024-10-21 Thread Will Deacon
On Wed, Oct 16, 2024 at 09:57:55AM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > Pass ftrace_regs to the fgraph_ops::entryfunc(). If ftrace_regs is not > available, it passes a NULL instead. User callback function can access > some registers (including return addre

Re: [PATCH v17 07/16] tracing: Add ftrace_fill_perf_regs() for perf event

2024-10-21 Thread Will Deacon
On Wed, Oct 16, 2024 at 09:59:12AM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > Add ftrace_fill_perf_regs() which should be compatible with the > perf_fetch_caller_regs(). In other words, the pt_regs returned from the > ftrace_fill_perf_regs() must satisfy 'user_m

Re: [PATCH v2 tip/perf/core 2/2] uprobes: SRCU-protect uretprobe lifetime (with timeout)

2024-10-21 Thread Andrii Nakryiko
On Mon, Oct 21, 2024 at 3:48 AM Peter Zijlstra wrote: > > On Fri, Oct 18, 2024 at 11:22:09AM -0700, Andrii Nakryiko wrote: > > > > So... after a few readings I think I'm mostly okay with this. But I got > > > annoyed by the whole HPROBE_STABLE with uprobe=NULL weirdness. Also, > > > that data_race

Re: [PATCH v17 06/16] tracing: Add ftrace_partial_regs() for converting ftrace_regs to pt_regs

2024-10-21 Thread Will Deacon
On Wed, Oct 16, 2024 at 09:59:00AM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > Add ftrace_partial_regs() which converts the ftrace_regs to pt_regs. > This is for the eBPF which needs this to keep the same pt_regs interface > to access registers. > Thus when repla

Re: [PATCH v17 02/16] function_graph: Replace fgraph_ret_regs with ftrace_regs

2024-10-21 Thread Will Deacon
On Wed, Oct 16, 2024 at 09:58:09AM +0900, Masami Hiramatsu (Google) wrote: > From: Masami Hiramatsu (Google) > > Use ftrace_regs instead of fgraph_ret_regs for tracing return value > on function_graph tracer because of simplifying the callback interface. > > The CONFIG_HAVE_FUNCTION_GRAPH_RETVAL

Re: [PATCH v17 11/16] fprobe: Rewrite fprobe on function-graph tracer

2024-10-21 Thread Heiko Carstens
> > Please note that this only works for addresses in the kernel address > > space. For user space the full 64 bit address range (minus the top > > page) can be used for user space applications. > > I wonder what is the unsigned long size (stack entry size) of the > s390? is it 64bit? The s390 ke

[PATCH] fgraph: Remove unused value

2024-10-21 Thread Amit Vadhavana
The variable `ret` is assigned a value which is unused. Fix this by removing the redundant `ret = 0;` assignment. This issue was reported by Coverity Scan. Report: CID 1600916: (#1 of 1): Unused value (UNUSED_VALUE) assigned_value: Assigning value 0 to ret here, but that stored value is overwritte

[PATCH 3/3] tools/rtla: Improve exception handling in timerlat_load.py

2024-10-21 Thread furkanonder
The enhancements made to timerlat_load.py are intended to improve the script's exception handling. Summary of the changes: - Specific exceptions are now caught for CPU affinity and priority settings, with clearer error messages provided. - The timerlat file descriptor opening now includes

[PATCH 2/3] tools/rtla: Enhance argument parsing in timerlat_load.py

2024-10-21 Thread furkanonder
The enhancements made to timerlat_load.py are aimed at improving the clarity of argument parsing. Summary of Changes: - The cpu argument is now specified as an integer type in the argument parser to enforce input validation, and the construction of affinity_mask has been simplified to directl

[PATCH v2 0/3] Lazy preemption leftovers

2024-10-21 Thread Sebastian Andrzej Siewior
This is a followup to PeterZ' https://lore.kernel.org/20241007074609.447006...@infradead.org in PREEMPT_RT we had initially "LAZY preempt" this then morphed into PREEMPT_AUTO and is becoming "Lazy preemption". These are the tracing bits from that time that were used up to PREEMPT_AUTO. Wit

[PATCH 1/3] tools/rtla: Improve code readability in timerlat_load.py

2024-10-21 Thread furkanonder
The enhancements made to timerlat_load.py are intended to improve the script's robustness and readability. Summary of the changes: - Unnecessary semicolons at the end of lines have been removed. - Parentheses surrounding the if statement checking args.prio have been eliminated. - String concatenat

Re: [PATCH v17 11/16] fprobe: Rewrite fprobe on function-graph tracer

2024-10-21 Thread Google
On Fri, 18 Oct 2024 14:49:52 +0200 Heiko Carstens wrote: > On Wed, Oct 16, 2024 at 10:10:22AM -0400, Steven Rostedt wrote: > > On Wed, 16 Oct 2024 14:07:31 +0200 > > Sven Schnelle wrote: > > > I haven't yet fully understood why this logic is needed, but the > > > WARN_ON_ONCE triggers on s390. I

[PATCH v2 2/3] tracing: Record task flag NEED_RESCHED_LAZY.

2024-10-21 Thread Sebastian Andrzej Siewior
From: Thomas Gleixner The scheduler added NEED_RESCHED_LAZY scheduling. Record this state as part of trace flags and expose it in the need_resched field. Record and expose NEED_RESCHED_LAZY. [bigeasy: Commit description, documentation bits.] Reviewed-by: Ankur Arora Reviewed-by: Steven Rosted

[PATCH v2 3/3] riscv: add PREEMPT_LAZY support

2024-10-21 Thread Sebastian Andrzej Siewior
From: Jisheng Zhang riscv has switched to GENERIC_ENTRY, so adding PREEMPT_LAZY is as simple as adding TIF_NEED_RESCHED_LAZY related definitions and enabling ARCH_HAS_PREEMPT_LAZY. [bigeasy: Replace old PREEMPT_AUTO bits with new PREEMPT_LAZY ] Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert

[PATCH v2 1/3] tracing: Replace TRACE_FLAG_IRQS_NOSUPPORT with its config option.

2024-10-21 Thread Sebastian Andrzej Siewior
From: Thomas Gleixner The TRACE_FLAG_IRQS_NOSUPPORT flag is used by tracing_gen_ctx.*() to signal that CONFIG_TRACE_IRQFLAGS_SUPPORT is not enabled and tracing IRQ flags is not supported. This could be replaced by using the 0 as flags and then deducting that there is no IRQFLAGS_SUPPORT based on

Re: [PATCH] fgraph: Separate size of ret_stack from PAGE_SIZE

2024-10-21 Thread Google
On Sat, 19 Oct 2024 15:29:51 -0400 Steven Rostedt wrote: > From: Steven Rostedt > > The ret_stack (shadow stack used by function graph infrastructure) is > currently defined as PAGE_SIZE. But some architectures which have 64K > PAGE_SIZE, this is way overkill. Also there's an effort to allow th

Re: [PATCH 3/3] dma-mapping: Trace more error paths

2024-10-21 Thread Sean Anderson
On 10/21/24 06:38, Robin Murphy wrote: > On 2024-10-17 7:13 pm, Sean Anderson wrote: >> It can be surprising to the user if DMA functions are only traced on >> success. On failure, it can be unclear what the source of the problem >> is. Fix this by tracing all functions even when they fail. Cases w

[PATCH v2] tracing: Make percpu stack trace buffer invariant to PAGE_SIZE

2024-10-21 Thread Ryan Roberts
Previously the size of "struct ftrace_stacks" depended upon PAGE_SIZE. For the common 4K page size, on a 64-bit system, sizeof(struct ftrace_stacks) was 32K. But for a 64K page size, sizeof(struct ftrace_stacks) was 512K. But ftrace stack usage requirements should be invariant to page size. So let

Re: [PATCH 0/3] kprobes: Annotate structs with __counted_by()

2024-10-21 Thread Google
On Tue, 13 Aug 2024 19:53:31 +0800 Jinjie Ruan wrote: > Annotate structs with __counted_by() for kprobe and do some cleanup. > > Jinjie Ruan (3): > kprobes: Annotate structs with __counted_by() > kprobes: Cleanup the config comment > kprobes: Cleanup collect_one_slot() and __disable_kprobe

Re: [PATCH v2 tip/perf/core 2/2] uprobes: SRCU-protect uretprobe lifetime (with timeout)

2024-10-21 Thread Paul E. McKenney
On Mon, Oct 21, 2024 at 12:48:15PM +0200, Peter Zijlstra wrote: > On Fri, Oct 18, 2024 at 11:22:09AM -0700, Andrii Nakryiko wrote: > > > > So... after a few readings I think I'm mostly okay with this. But I got > > > annoyed by the whole HPROBE_STABLE with uprobe=NULL weirdness. Also, > > > that d

[PATCH] x86/kprobes: Cleanup kprobes on ftrace code

2024-10-21 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Cleanup kprobes on ftrace code for x86. - Set instruction pointer (ip + MCOUNT_INSN_SIZE) after pre_handler only when p->post_handler exists. - Use INT3_INSN_SIZE instead of 1. - Use instruction_pointer/instruction_pointer_set() functions instead of access

[PATCH] rtla/timerlat: Do not set params->user_workload with -U

2024-10-21 Thread tglozar
From: Tomas Glozar Since commit fb9e90a67ee9 ("rtla/timerlat: Make user-space threads the default"), rtla-timerlat has been defaulting to params->user_workload if neither that or params->kernel_workload is set. This has unintentionally made -U, which sets only params->user_hist/top but not params

Re: [PATCH v2] uprobes: Improve the usage of xol slots for better scalability

2024-10-21 Thread Liao, Chang
在 2024/10/1 22:29, Oleg Nesterov 写道: > On 09/27, Liao Chang wrote: >> >> The uprobe handler allocates xol slot from xol_area and quickly release >> it in the single-step handler. The atomic operations on the xol bitmap >> and slot_count lead to expensive cache line bouncing between multiple >> C

Re: [PATCH v2] uprobes: Improve the usage of xol slots for better scalability

2024-10-21 Thread Liao, Chang
Oleg, My bad to take so long to reply. I have recently returned from a long vacation. 在 2024/9/28 1:18, Oleg Nesterov 写道: > On 09/27, Liao Chang wrote: >> >> +int recycle_utask_slot(struct uprobe_task *utask, struct xol_area *area) >> +{ >> +int slot = UINSNS_PER_PAGE; >> + >> +/* >> +

Re: [PATCH v2] arm64: insn: Simulate nop instruction for better uprobe performance

2024-10-21 Thread Liao, Chang
在 2024/10/10 18:52, Mark Rutland 写道: > On Mon, Sep 09, 2024 at 07:11:14AM +, Liao Chang wrote: >> v2->v1: >> 1. Remove the simuation of STP and the related bits. >> 2. Use arm64_skip_faulting_instruction for single-stepping or FEAT_BTI >>scenario. >> >> As Andrii pointed out, the uprobe/

Re: [PATCH v2 tip/perf/core 2/2] uprobes: SRCU-protect uretprobe lifetime (with timeout)

2024-10-21 Thread Peter Zijlstra
On Fri, Oct 18, 2024 at 11:22:09AM -0700, Andrii Nakryiko wrote: > > So... after a few readings I think I'm mostly okay with this. But I got > > annoyed by the whole HPROBE_STABLE with uprobe=NULL weirdness. Also, > > that data_race() usage is weird, what is that about? > > People keep saying tha

Re: [PATCH v2] arm64: insn: Simulate nop instruction for better uprobe performance

2024-10-21 Thread Liao, Chang
在 2024/10/16 2:58, Catalin Marinas 写道: > On Mon, 09 Sep 2024 07:11:14 +, Liao Chang wrote: >> v2->v1: >> 1. Remove the simuation of STP and the related bits. >> 2. Use arm64_skip_faulting_instruction for single-stepping or FEAT_BTI >>scenario. >> >> As Andrii pointed out, the uprobe/uret

Re: [PATCH v3 0/2] uprobes: Improve scalability by reducing the contention on siglock

2024-10-21 Thread Liao, Chang
在 2024/10/12 3:34, Andrii Nakryiko 写道: > On Tue, Sep 17, 2024 at 7:05 PM Liao, Chang wrote: >> >> Hi, Peter and Masami >> >> I look forward to your inputs on these series. Andrii has proven they are >> hepful for uprobe scalability. >> >> Thanks. >> >> 在 2024/9/15 23:18, Oleg Nesterov 写道: >>> H

Re: [PATCH 3/3] dma-mapping: Trace more error paths

2024-10-21 Thread Robin Murphy
On 2024-10-17 7:13 pm, Sean Anderson wrote: It can be surprising to the user if DMA functions are only traced on success. On failure, it can be unclear what the source of the problem is. Fix this by tracing all functions even when they fail. Cases where we BUG/WARN are skipped, since those should

Re: [PATCH v2 tip/perf/core 1/2] uprobes: allow put_uprobe() from non-sleepable softirq context

2024-10-21 Thread Peter Zijlstra
On Fri, Oct 18, 2024 at 11:22:00AM -0700, Andrii Nakryiko wrote: > On Fri, Oct 18, 2024 at 1:26 AM Peter Zijlstra wrote: > > > > On Mon, Oct 07, 2024 at 05:25:55PM -0700, Andrii Nakryiko wrote: > > > Currently put_uprobe() might trigger mutex_lock()/mutex_unlock(), which > > > makes it unsuitable

[PATCH] fgraph: fix unused value in register_ftrace_graph()

2024-10-21 Thread Gianfranco Trad
Coverity reports unused assignment to value ret. [1] ret is assigned to 0 here, but that stored value is overwritten before it can be used. The overwrite might happen either at line 1277, 1290 or eventually at line 1306. Therefore, cleanup the unused assignment. [1] Coverity Scan, CID 168 Si

[PATCH RFC 2/2] arch: m68k: Add STACKTRACE support

2024-10-21 Thread Jean-Michel Hautbois
In order to use tracing, implement a basic arch_stack_walk() based on the one in PowerPC. Tested on a M54418 coldfire. Signed-off-by: Jean-Michel Hautbois --- arch/m68k/Kconfig | 5 arch/m68k/kernel/Makefile | 1 + arch/m68k/kernel/stacktrace.c | 70 +++

[PATCH RFC 1/2] m68k: Add tracirqs

2024-10-21 Thread Jean-Michel Hautbois
The TRACE_IRQFLAGS_SUPPORT requires the architecture to call trace_hardirqs_off() when interrupts are disabled and trace_hardirqs_on() when they are enabled. Add those calls to do_IRQ function. Signed-off-by: Jean-Michel Hautbois --- arch/m68k/Kconfig | 1 + arch/m68k/kernel/irq.c | 2 ++ 2

[PATCH RFC 0/2] Add basic tracing support for m68k

2024-10-21 Thread Jean-Michel Hautbois
++ arch/m68k/kernel/stacktrace.c | 70 +++ 4 files changed, 79 insertions(+) --- base-commit: 42f7652d3eb527d03665b09edac47f85fb600924 change-id: 20241021-add-m68k-tracing-support-36c18d2233d8 Best regards, -- Jean-Michel Hautbois

Re: [PATCH] fgraph: Give ret_stack its own kmem cache

2024-10-21 Thread Ryan Roberts
On 21/10/2024 09:37, Steven Rostedt wrote: > On Mon, 21 Oct 2024 08:58:11 +0100 > Ryan Roberts wrote: > >>> @@ -1290,6 +1305,16 @@ int register_ftrace_graph(struct fgraph_ops *gops) >>> >>> mutex_lock(&ftrace_lock); >>> >>> + if (!fgraph_stack_cachep) >>> + fgraph_stack_cachep

Re: [PATCH] fgraph: Give ret_stack its own kmem cache

2024-10-21 Thread Steven Rostedt
On Mon, 21 Oct 2024 08:58:11 +0100 Ryan Roberts wrote: > > @@ -1290,6 +1305,16 @@ int register_ftrace_graph(struct fgraph_ops *gops) > > > > mutex_lock(&ftrace_lock); > > > > + if (!fgraph_stack_cachep) > > + fgraph_stack_cachep = kmem_cache_create("fgraph_stack", > > +

Re: [PATCH v2] arm: Add KPROBES_ON_FTRACE supported

2024-10-21 Thread Google
Hi Jinjie, Sorry for reviewing so late. I have some comments below. On Tue, 18 Jun 2024 11:52:42 +0800 Jinjie Ruan wrote: > Add support for kprobes on ftrace call sites to avoid much of the overhead > with regular kprobes. Try it with simple steps: > > cd /sys/kernel/debug/tracing/ >

Re: [PATCH 1/3] tools/rtla: Code Cleanup and Readability Improvements for timerlat

2024-10-21 Thread Tomas Glozar
ne 20. 10. 2024 v 22:01 odesílatel furkanonder napsal: > > The enhancements made to timerlat_load.py are intended to improve the > script's robustness and readability. > > Summary of the changes: > - Unnecessary semicolons at the end of lines have been removed. > - Parentheses surrounding the if s

Re: [PATCH] fgraph: Separate size of ret_stack from PAGE_SIZE

2024-10-21 Thread Ryan Roberts
On 19/10/2024 20:29, Steven Rostedt wrote: > From: Steven Rostedt > > The ret_stack (shadow stack used by function graph infrastructure) is > currently defined as PAGE_SIZE. But some architectures which have 64K > PAGE_SIZE, this is way overkill. Also there's an effort to allow the > PAGE_SIZE to

Re: [PATCH] fgraph: Give ret_stack its own kmem cache

2024-10-21 Thread Ryan Roberts
On 19/10/2024 20:27, Steven Rostedt wrote: > From: Steven Rostedt > > The ret_stack (shadow stack used by function graph infrastructure) is > created for every task on the system when function graph is enabled. Give > it its own kmem_cache. This will make it easier to see how much memory is > bei

Re: [PATCH] fgraph: Allocate ret_stack_list with proper size

2024-10-21 Thread Google
On Fri, 18 Oct 2024 21:52:12 -0400 Steven Rostedt wrote: > From: Steven Rostedt > > The ret_stack_list is an array of ret_stack shadow stacks for the function > graph usage. When the first function graph is enabled, all tasks in the > system get a shadow stack. The ret_stack_list is a 32 elemen

[PATCH v4] tracing: Fix function name for trampoline

2024-10-21 Thread Tatsuya S
The issue that unrelated function name is shown on stack trace like following even though it should be trampoline code address is caused by the creation of trampoline code in the area where .init.text section of module was freed after module is loaded. bash-1344[002] .43.644608: => (M