[PATCH 4/4] PM: tracing: Hide power_domain_target event under ARCH_OMAP2PLUS

2025-06-12 Thread Steven Rostedt
From: Steven Rostedt The power_domain_target event event is only called when CONFIG_OMAP2PLUS is defined. As each event can take up to 5K regardless if they are used or not, it's best not to define them when they are not used. Add #ifdef around these events when they are not used. Signed-o

[PATCH 0/4] PM: tracing: Don't compile in unused trace events

2025-06-12 Thread Steven Rostedt
used. The powernv_throttle event is only used by the powernv code so I moved it to its own header file and it gets created when the powernv code is compiled in. For the other power events, I just added #ifdef around them with the configs that enable them. Steven Rostedt (4): PM: cpufreq: po

[PATCH 2/4] PM: tracing: Hide psci_domain_idle events under ARM_PSCI_CPUIDLE

2025-06-12 Thread Steven Rostedt
From: Steven Rostedt The events psci_domain_idle_enter and psci_domain_idle_exit events are only called when CONFIG_ARM_PSCI_CPUIDLE is defined. As each event can take up to 5K (less for DEFINE_EVENT()) regardless if they are used or not, it's best not to define them when they are not used

[PATCH 1/4] PM: cpufreq: powernv/tracing: Move powernv_throttle trace event

2025-06-12 Thread Steven Rostedt
From: Steven Rostedt As the trace event powernv_throttle is only used by the powernv code, move it to a separate include file and have that code directly enable it. Trace events can take up around 5K of memory when they are defined regardless if they are used or not. It wastes memory to have

[PATCH 3/4] PM: tracing: Hide device_pm_callback events under PM_SLEEP

2025-06-12 Thread Steven Rostedt
From: Steven Rostedt The events device_pm_callback_start and device_pm_callback_end events are only called when CONFIG_PM_SLEEP is defined. As each event can take up to 5K regardless if they are used or not, it's best not to define them when they are not used. Add #ifdef around these events

Re: [BUG?] ppc64le: fentry BPF not triggered after live patch (v6.14)

2025-04-05 Thread Steven Rostedt
On Mon, 31 Mar 2025 21:19:36 +0800 Shung-Hsi Yu wrote: > Hi all, > > On ppc64le (v6.14, kernel config attached), I've observed that fentry > BPF programs stop being invoked after the target kernel function is live > patched. This occurs regardless of whether the BPF program was attached > before

Re: [PATCH v2 0/5] kallsyms: Emit symbol for holes in text and fix weak function issue

2025-01-21 Thread Steven Rostedt
Sorry for the late reply. Forgot about this as I was focused on other end-of-year issues. On Sat, 14 Dec 2024 16:37:59 +0800 Zheng Yejian wrote: > The direct cause of this issue is the wrong fentry being founded by > ftrace_location(), > following the approach of "FTRACE_MCOUNT_MAX_OFFSET",

Re: [PATCH] treewide: const qualify ctl_tables where applicable

2025-01-09 Thread Steven Rostedt
nts_sysctl(const struct > ctl_table *table, int write, > return ret; > } > > -static struct ctl_table user_event_sysctls[] = { > +static const struct ctl_table user_event_sysctls[] = { > { > .procname = "user_events_max", > .data = &max_user_events, Acked-by: Steven Rostedt (Google) # for kernel/trace/ -- Steve

Re: [PATCH v2] selftests/ftrace: adjust offset for kprobe syntax error test

2024-12-05 Thread Steven Rostedt
On Thu, 5 Dec 2024 09:06:43 -0700 Shuah Khan wrote: > I applied this to linux-kselftest fixes - will send it up for rc2 or rc3 Thanks Shuah, -- Steve

Re: [PATCH v2] selftests/ftrace: adjust offset for kprobe syntax error test

2024-12-03 Thread Steven Rostedt
On Tue, 3 Dec 2024 18:01:06 -0700 Shuah Khan wrote: > On 12/2/24 12:41, Steven Rostedt wrote: > > On Sat, 30 Nov 2024 01:56:21 +0530 > > Hari Bathini wrote: > > > >> In 'NOFENTRY_ARGS' test case for syntax check, any offset X of > >> `vfs_

Re: [PATCH v2] selftests/ftrace: adjust offset for kprobe syntax error test

2024-12-02 Thread Steven Rostedt
; configuration (see arch_kprobe_on_func_entry() for implementation > details). So, use `vfs_read+20` to accommodate that scenario too. > > Suggested-by: Masami Hiramatsu > Signed-off-by: Hari Bathini Acked-by: Steven Rostedt (Google) Shuah, Can you take this through your tree? Thanks,

Re: [PATCH v7 0/8] x86/module: use large ROX pages for text allocations

2024-11-18 Thread Steven Rostedt
On Wed, 23 Oct 2024 19:27:03 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Hi, > > This is an updated version of execmem ROX caches. > FYI, I booted a kernel before and after applying these patches with my change: https://lore.kernel.org/20241017113105.1edfa...@gandal

Re: linux-next: build failure after merge of the ftrace tree

2024-11-06 Thread Steven Rostedt
On Wed, 6 Nov 2024 14:04:14 +1100 Stephen Rothwell wrote: > Hi all, > > After merging the ftrace tree, today's linux-next build (powerpc > ppc64_defconfig) failed like this: > > In file included from include/linux/ftrace.h:23, > from include/linux/kvm_host.h:32, >

Re: [PATCH] selftests/ftrace: update kprobe syntax error test for ppc64le

2024-11-04 Thread Steven Rostedt
On Mon, 4 Nov 2024 04:36:15 -0600 Segher Boessenkool wrote: > > >>Querying for function arguments is supported on kprobes only at function > > >>entry. This is a negative test case where the offset is intentionally > > >>set beyond function entry while querying for function arguments. > > >>I gue

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

2024-10-17 Thread Steven Rostedt
On Thu, 17 Oct 2024 14:25:05 +0300 Mike Rapoport wrote: > With this series the module text is allocated as ROX at the first place, so > the modifications ftrace does to module text have to either use text poking > even before complete_formation() or deal with a writable copy like I did > for relo

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

2024-10-17 Thread Steven Rostedt
On Wed, 16 Oct 2024 17:01:28 -0400 Steven Rostedt wrote: > If this is only needed for module load, can we at least still use the > text_poke_early() at boot up? > > if (ftrace_poke_late) { > text_poke_queue((void *)ip, new_code, MCOUNT_INSN_SIZE, NULL); &g

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

2024-10-16 Thread Steven Rostedt
On Wed, 16 Oct 2024 15:24:22 +0300 Mike Rapoport wrote: > diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c > index 8da0e66ca22d..b498897b213c 100644 > --- a/arch/x86/kernel/ftrace.c > +++ b/arch/x86/kernel/ftrace.c > @@ -118,10 +118,13 @@ ftrace_modify_code_direct(unsigned long ip

Re: [PATCH v3] ftrace: Consolidate ftrace_regs accessor functions for archs using pt_regs

2024-10-11 Thread Steven Rostedt
On Fri, 11 Oct 2024 11:26:10 +0100 Catalin Marinas wrote: > On Thu, Oct 10, 2024 at 08:21:14PM -0400, Steven Rostedt wrote: > > diff --git a/arch/arm64/include/asm/ftrace.h > > b/arch/arm64/include/asm/ftrace.h > > index bbb69c7751b9..5ccff4de7f09 100644 > > -

[PATCH v3] ftrace: Consolidate ftrace_regs accessor functions for archs using pt_regs

2024-10-10 Thread Steven Rostedt
From: Steven Rostedt Most architectures use pt_regs within ftrace_regs making a lot of the accessor functions just calls to the pt_regs internally. Instead of duplication this effort, use a HAVE_ARCH_FTRACE_REGS for architectures that have their own ftrace_regs that is not based on pt_regs and

Re: [PATCH] ftrace: Make ftrace_regs abstract from direct use

2024-10-10 Thread Steven Rostedt
] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: > https://github.com/intel-lab-lkp/lin

Re: [PATCH v2 2/2] ftrace: Consolidate ftrace_regs accessor functions for archs using pt_regs

2024-10-09 Thread Steven Rostedt
Loongarch maintainers, please note the below comments! On Tue, 08 Oct 2024 19:05:29 -0400 Steven Rostedt wrote: > diff --git a/arch/arm64/include/asm/ftrace.h b/arch/arm64/include/asm/ftrace.h > index bbb69c7751b9..5ccff4de7f09 100644 > --- a/arch/arm64/include/asm/ftrace.h >

Re: [PATCH v2 2/2] ftrace: Consolidate ftrace_regs accessor functions for archs using pt_regs

2024-10-09 Thread Steven Rostedt
On Wed, 9 Oct 2024 13:47:23 +0900 Masami Hiramatsu (Google) wrote: > > --- /dev/null > > +++ b/include/linux/ftrace_regs.h > > @@ -0,0 +1,36 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +#ifndef _LINUX_FTRACE_TYPES_H > > +#define _LINUX_FTRACE_TYPES_H > Is

[PATCH v2 1/2] ftrace: Make ftrace_regs abstract from direct use

2024-10-08 Thread Steven Rostedt
From: Steven Rostedt ftrace_regs was created to hold registers that store information to save function parameters, return value and stack. Since it is a subset of pt_regs, it should only be used by its accessor functions. But because pt_regs can easily be taken from ftrace_regs (on most archs

[PATCH v2 2/2] ftrace: Consolidate ftrace_regs accessor functions for archs using pt_regs

2024-10-08 Thread Steven Rostedt
From: Steven Rostedt Most architectures use pt_regs within ftrace_regs making a lot of the accessor functions just calls to the pt_regs internally. Instead of duplication this effort, use a HAVE_ARCH_FTRACE_REGS for architectures that have their own ftrace_regs that is not based on pt_regs and

[PATCH v2 0/2] ftrace: Make ftrace_regs abstract and consolidate code

2024-10-08 Thread Steven Rostedt
() and made it a static inline function - Added a second patch that consolidates a lot of the duplicate code when an architecture has pt_regs embedded in the ftrace_regs. Steven Rostedt (2): ftrace: Make ftrace_regs abstract from direct use ftrace: Consolidate ftrace_regs accessor

Re: [PATCH] ftrace: Make ftrace_regs abstract from direct use

2024-10-08 Thread Steven Rostedt
On Wed, 9 Oct 2024 07:41:40 +0900 Masami Hiramatsu (Google) wrote: > Hi Steve, > > > diff --git a/include/asm-generic/ftrace.h b/include/asm-generic/ftrace.h > > index 3a23028d69d2..ba7b7d6e55d6 100644 > > --- a/include/asm-generic/ftrace.h > > +++ b/include/asm-generic/ftrace.h > > @@ -10,4 +1

Re: [PATCH] ftrace: Make ftrace_regs abstract from direct use

2024-10-08 Thread Steven Rostedt
On Tue, 8 Oct 2024 08:24:22 +0200 Christophe Leroy wrote: > >> + > >> +struct ftrace_regs; > >> +#define arch_ftrace_regs(fregs) ((struct __arch_ftrace_regs *)(fregs)) > >> + > > > > I just realized I can simplify it with: > > > > #define arch_ftrace_get_regs(fregs) ({ &arch_ftrace_regs(fregs

Re: [PATCH] ftrace: Make ftrace_regs abstract from direct use

2024-10-08 Thread Steven Rostedt
On Tue, 8 Oct 2024 16:58:52 +0200 Heiko Carstens wrote: > On Mon, Oct 07, 2024 at 08:54:58PM -0400, Steven Rostedt wrote: > > On Mon, 7 Oct 2024 20:47:43 -0400 > > Steven Rostedt wrote: > > #define arch_ftrace_get_regs(fregs) ({ &arch_ftrace_regs(fregs)->regs;

Re: [PATCH] ftrace: Make ftrace_regs abstract from direct use

2024-10-07 Thread Steven Rostedt
On Mon, 7 Oct 2024 20:47:43 -0400 Steven Rostedt wrote: > +#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS > +struct __arch_ftrace_regs { > + struct pt_regs regs; > +}; > + > +#define arch_ftrace_get_regs(fregs) \ > + ({ str

[PATCH] ftrace: Make ftrace_regs abstract from direct use

2024-10-07 Thread Steven Rostedt
From: Steven Rostedt ftrace_regs was created to hold registers that store information to save function parameters, return value and stack. Since it is a subset of pt_regs, it should only be used by its accessor functions. But because pt_regs can easily be taken from ftrace_regs (on most archs

Re: [PATCH v14 05/19] function_graph: Pass ftrace_regs to retfunc

2024-09-15 Thread Steven Rostedt
Can I get an Acked-by from the POWERPC maintainers for this patch? Thanks! -- Steve [ Note this is modifies the return side ] On Fri, 13 Sep 2024 00:09:02 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > Pass ftrace_regs to the fgraph_ops::retfunc(). If ftrac

Re: [PATCH v14 03/19] function_graph: Pass ftrace_regs to entryfunc

2024-09-15 Thread Steven Rostedt
Can I get an Acked-by from the POWERPC maintainers for this patch? Thanks! -- Steve On Fri, 13 Sep 2024 00:08:40 +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 N

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

2024-09-09 Thread Steven Rostedt
On Mon, 9 Sep 2024 17:34:48 +0300 Mike Rapoport wrote: > > This is insane, just force BUILDTIME_MCOUNT_SORT > > The comment in ftrace.c says "... while mcount loc in modules can not be > sorted at build time" > > I don't know enough about objtool, but I'd presume it's because the sorting > s

Re: [PATCH v2 5/8] ftrace: Add swap_func to ftrace_process_locs()

2024-08-26 Thread Steven Rostedt
On Mon, 26 Aug 2024 09:55:29 +0300 Mike Rapoport wrote: > From: Song Liu > > ftrace_process_locs sorts module mcount, which is inside RO memory. Add a > ftrace_swap_func so that archs can use RO-memory-poke function to do the > sorting. Can you add the above as a comment above the ftrace_swap_

Re: [RFC PATCH v2 3/5] powerpc/ftrace: Unify 32-bit and 64-bit ftrace entry code

2024-06-11 Thread Steven Rostedt
On Tue, 11 Jun 2024 20:17:19 +0530 Naveen N Rao wrote: > > I know it's very unlikely, but in theory, I think the race exists. > > I *think* you are assuming that we will be patching back the 'stw' Yes, that was what I was assuming :-p > instruction here? So, there could be an issue if a cpu

[PATCH 0/2] function_graph: ftrace_graph_ret_addr(); there can be only one!

2024-06-10 Thread Steven Rostedt
I noticed a slight bug in ftrace_graph_ret_addr() for when HAVE_FUNCTION_GRAPH_RET_ADDR_PTR was defined and fixed it up. I then noticed it was buggy when not defined. Looking for an architecture that did not have it defined, I couldn't find any. So I removed it. Steven Rostedt (Googl

[PATCH 2/2] function_graph: Everyone uses HAVE_FUNCTION_GRAPH_RET_ADDR_PTR, remove it

2024-06-10 Thread Steven Rostedt
From: "Steven Rostedt (Google)" All architectures that implement function graph also implements HAVE_FUNCTION_GRAPH_RET_ADDR_PTR. Remove it, as it is no longer a differentiator. Signed-off-by: Steven Rostedt (Google) --- Documentation/trace/ftrace-design.rst | 12 - arch/arm

[PATCH 1/2] function_graph: Fix up ftrace_graph_ret_addr()

2024-06-10 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Yang Li sent a patch to fix the kerneldoc of ftrace_graph_ret_addr(). While reviewing it, I realized that the comments in the entire function header needed a rewrite. When doing that, I realized that @idx parameter was being ignored. Every time this was

Re: [RFC PATCH v2 3/5] powerpc/ftrace: Unify 32-bit and 64-bit ftrace entry code

2024-06-10 Thread Steven Rostedt
On Mon, 10 Jun 2024 14:08:16 +0530 Naveen N Rao wrote: > On 32-bit powerpc, gcc generates a three instruction sequence for > function profiling: > mflrr0 > stw r0, 4(r1) > bl _mcount > > On kernel boot, the call to _mcount() is nop-ed out, to be patched back > in w

Re: [RFC PATCH v2 2/5] powerpc/ftrace: Remove pointer to struct module from dyn_arch_ftrace

2024-06-10 Thread Steven Rostedt
On Mon, 10 Jun 2024 14:08:15 +0530 Naveen N Rao wrote: > Pointer to struct module is only relevant for ftrace records belonging > to kernel modules. Having this field in dyn_arch_ftrace wastes memory > for all ftrace records belonging to the kernel. Remove the same in > favour of looking up the m

Re: [PATCH v1 1/1] treewide: Align match_string() with sysfs_match_string()

2024-06-04 Thread Steven Rostedt
On Tue, 04 Jun 2024 10:45:37 +0300 Jani Nikula wrote: > On Sun, 02 Jun 2024, Andy Shevchenko > wrote: > > Make two APIs look similar. Hence convert match_string() to be > > a 2-argument macro. In order to avoid unneeded churn, convert > > all users as well. There is no functional change intende

Re: [PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-05-17 Thread Steven Rostedt
On Fri, 17 May 2024 10:36:37 -0700 Guenter Roeck wrote: > Building csky:allmodconfig (and others) ... failed > -- > Error log: > In file included from include/trace/trace_events.h:419, > from include/trace/define_trace.h:102, > from drivers/cxl/core/t

Re: [PATCH v3] kprobe/ftrace: bail out if ftrace was killed

2024-05-06 Thread Steven Rostedt
On Mon, 6 May 2024 14:46:57 + Christophe Leroy wrote: > Isn't it safer to provide a fonction rather than a direct access to a > variable ? > > By the way, wouldn't it be more performant to use a static branch (jump > label) ? A static branch could work, but the point of this is that if ft

Re: [PATCH v8 13/17] x86/ftrace: enable dynamic ftrace without CONFIG_MODULES

2024-05-06 Thread Steven Rostedt
| 10 -- > 2 files changed, 1 insertion(+), 10 deletions(-) Reviewed-by: Steven Rostedt (Google) -- Steve

Re: [PATCH v8 06/17] mm: introduce execmem_alloc() and execmem_free()

2024-05-06 Thread Steven Rostedt
Trampolines can only be created if modules are supported */ > diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c Acked-by: Steven Rostedt (Google) -- Steve

Re: [PATCH v3] kprobe/ftrace: bail out if ftrace was killed

2024-05-01 Thread Steven Rostedt
eave a ticking time bomb. > > Signed-off-by: Stephen Brennan > --- > Changes in v3: > Don't expose ftrace_is_dead(). Create a "kprobe_ftrace_disabled" > variable and check it directly in the kprobe handlers. Reviewed-by: Steven Rostedt (Google) Thanks, -- Steve

Re: [PATCH v2] kprobe/ftrace: bail out if ftrace was killed

2024-04-29 Thread Steven Rostedt
On Mon, 29 Apr 2024 10:47:18 -0700 Stephen Brennan wrote: > If an error happens in ftrace, ftrace_kill() will prevent disarming > kprobes. Eventually, the ftrace_ops associated with the kprobes will be > freed, yet the kprobes will still be active, and when triggered, they > will use the freed me

Re: [FYI][PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-03-14 Thread Steven Rostedt
On Thu, 14 Mar 2024 09:57:57 -0700 Alison Schofield wrote: > On Fri, Feb 23, 2024 at 12:56:34PM -0500, Steven Rostedt wrote: > > From: "Steven Rostedt (Google)" > > > > [ > >This is a treewide change. I will likely re-create this patch again in > >

Re: Kernel WARNING at lib/vsprintf.c:2721 while running ftrace kernel selftests

2024-02-27 Thread Steven Rostedt
On Tue, 27 Feb 2024 11:56:14 -0500 Steven Rostedt wrote: > On Tue, 27 Feb 2024 22:08:18 +0530 > Sachin Sant wrote: > > > > Can you apply this, and see if it triggers and if it does, print the line > > > that has the max size? > > > >

Re: Kernel WARNING at lib/vsprintf.c:2721 while running ftrace kernel selftests

2024-02-27 Thread Steven Rostedt
On Tue, 27 Feb 2024 22:08:18 +0530 Sachin Sant wrote: > > Can you apply this, and see if it triggers and if it does, print the line > > that has the max size? > > > > With this I see following trace > > [ 61.327138] [ cut here ] > [ 61.327159] MAX OUT OF RANGE 634

Re: Kernel WARNING at lib/vsprintf.c:2721 while running ftrace kernel selftests

2024-02-27 Thread Steven Rostedt
On Tue, 27 Feb 2024 21:38:57 +0530 Sachin Sant wrote: > This warning was not triggered. Interesting. > > I have attached .config This is what I was looking for: > # CONFIG_PPC_4K_PAGES is not set > CONFIG_PPC_64K_PAGES=y > CONFIG_PAGE_SIZE_64KB=y > CONFIG_PPC_PAGE_SHIFT=16 So the pages are

Re: Kernel WARNING at lib/vsprintf.c:2721 while running ftrace kernel selftests

2024-02-27 Thread Steven Rostedt
On Tue, 27 Feb 2024 15:06:18 +0530 Sachin Sant wrote: > I used this setup to again run bisect between 6.7.0 and 6.8-rc1. > Bisect points to following patch > > commit 8ec90be7f15fac42992ea821be929d3b06cd0fd9 > tracing: Allow for max buffer data size trace_marker writes Thanks, that was wha

Re: Kernel WARNING at lib/vsprintf.c:2721 while running ftrace kernel selftests

2024-02-26 Thread Steven Rostedt
On Sun, 25 Feb 2024 22:01:50 +0530 Sachin Sant wrote: > While running ftrace specific kernel selftests following warning > is seen on a Power10 logical partition (LPAR) booted with > latest mainline kernel. > > [ cut here ] > precision 63492 too large > WARNING: CPU: 15 P

Re: [FYI][PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-02-23 Thread Steven Rostedt
On Fri, 23 Feb 2024 13:46:53 -0500 Steven Rostedt wrote: > Now one thing I could do is to not remove the parameter, but just add: > > WARN_ON_ONCE((src) != __data_offsets->item##_ptr_); > > in the __assign_str() macro to make sure that it's still the same that is

Re: [FYI][PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-02-23 Thread Steven Rostedt
On Fri, 23 Feb 2024 14:50:49 -0500 Kent Overstreet wrote: > Tangentially related though, what would make me really happy is if we > could create the string with in the TP__fast_assign() section. I have to > have a bunch of annoying wrappers right now because the string length > has to be known wh

Re: [FYI][PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-02-23 Thread Steven Rostedt
On Fri, 23 Feb 2024 10:30:45 -0800 Jeff Johnson wrote: > On 2/23/2024 9:56 AM, Steven Rostedt wrote: > > From: "Steven Rostedt (Google)" > > > > [ > >This is a treewide change. I will likely re-create this patch again in > >the second week of

Re: [FYI][PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-02-23 Thread Steven Rostedt
On Fri, 23 Feb 2024 12:56:34 -0500 Steven Rostedt wrote: > Note, the same updates will need to be done for: > > __assign_str_len() > __assign_rel_str() > __assign_rel_str_len() Correction: The below macros do not pass in their source to the entry macros, so they will

Re: [RFC PATCH 6/9] powerpc/ftrace: Update and move function profile instructions out-of-line

2023-12-21 Thread Steven Rostedt
On Thu, 21 Dec 2023 10:46:08 + Christophe Leroy wrote: > > To enable ftrace, the nop at function entry is changed to an > > unconditional branch to 'tramp'. The call to ftrace_caller() may be > > updated to ftrace_regs_caller() depending on the registered ftrace ops. > > On 64-bit powerpc, we

Re: [linux-next:master] BUILD REGRESSION 2dac75696c6da3c848daa118a729827541c89d33

2023-10-18 Thread Steven Rostedt
On Thu, 19 Oct 2023 04:07:35 +0800 kernel test robot wrote: > Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml: > Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml: > fs/tracefs/event_inode.c:782:11-21: ERROR: ei is NULL but dereferenced. This was already reported and I'm currently test

Re: [PATCH] tracing: Have all levels of checks prevent recursion

2023-07-21 Thread Steven Rostedt
On Fri, 21 Jul 2023 18:06:07 +0200 Alexander Lobakin wrote: > > Just because you disable interrupts does not mean you are in interrupt > > context. > > Ah okay, thanks! IOW, if we want to check in some code that we're > certainly have interrupts enabled and are not in the interrupt context, >

Re: [PATCH] tracing: Have all levels of checks prevent recursion

2023-07-21 Thread Steven Rostedt
On Fri, 21 Jul 2023 17:34:41 +0200 Alexander Lobakin wrote: > From: Steven Rostedt > Date: Fri, 15 Oct 2021 14:25:41 -0400 > > Sorry for such a necroposting :z > Just wanted to know if this is a bug, so that I could send a fix, or > intended behaviour. > > > On Fri,

Re: [PATCH 00/79] fs: new accessors for inode->i_ctime

2023-06-21 Thread Steven Rostedt
On Wed, 21 Jun 2023 10:45:05 -0400 Jeff Layton wrote: > Most of this conversion was done via coccinelle, with a few of the more > non-standard accesses done by hand. There should be no behavioral > changes with this set. That will come later, as we convert individual > filesystems to use multigra

Re: [PATCH v2 06/12] mm/execmem: introduce execmem_data_alloc()

2023-06-20 Thread Steven Rostedt
On Mon, 19 Jun 2023 02:43:58 +0200 Thomas Gleixner wrote: > Now you might argue that it _is_ a "hotpath" due to the BPF usage, but > then even more so as any intermediate wrapper which converts from one > data representation to another data representation is not going to > increase performance, r

Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-04 Thread Steven Rostedt
On Thu, 1 Jun 2023 16:54:36 -0700 Nadav Amit wrote: > > The way text_poke() is used here, it is creating a new writable alias > > and flushing it for *each* write to the module (like for each write of > > an individual relocation, etc). I was just thinking it might warrant > > some batching or so

Re: [RFC PATCH] powerpc/ftrace: Refactoring and support for -fpatchable-function-entry

2023-05-23 Thread Steven Rostedt
On Sat, 20 May 2023 23:58:01 +0530 Naveen N Rao wrote: > > > > At the begining of ftrace_replace_code(), don't you miss: > > > > if (unlikely(ftrace_disabled)) > > return; > > ftrace_disabled is a static, so it can't be tested here. FWIW, x86 also > implements ftrace_replace

Re: [PATCH v2 19/24] xtensa/cpu: Make sure cpu_die() doesn't return

2023-02-14 Thread Steven Rostedt
On Tue, 14 Feb 2023 10:23:22 -0800 Josh Poimboeuf wrote: > void __ref cpu_die(void) > { > idle_task_exit(); > local_irq_disable(); > __asm__ __volatile__( > " movia2, cpu_restart\n" > " jx a2\n"); > > BUG()

Re: [RFC PATCH v2 0/8] Generic IPI sending tracepoint

2022-11-14 Thread Steven Rostedt
good starting point. For the tracing portions: Reviewed-by: Steven Rostedt (Google) -- Steve

Re: [RFC PATCH 0/5] Generic IPI sending tracepoint

2022-10-11 Thread Steven Rostedt
On Tue, 11 Oct 2022 17:40:26 +0100 Valentin Schneider wrote: > > You could keep the tracepoint as a mask, and then make it pretty, like > > cpus=3-5,8 > > in user-space. For example with a trace-cmd/perf loadable plugin, > > libtracefs helper. > > > > That's a nice idea, the one downside I s

Re: [RFC PATCH 0/5] Generic IPI sending tracepoint

2022-10-11 Thread Steven Rostedt
On Tue, 11 Oct 2022 17:17:04 +0100 Valentin Schneider wrote: > tep_get_field_val() just yields an unsigned long long of value 0x200018, > which AFAICT is just the [length, offset] thing associated with dynamic > arrays. Not really usable, and I don't see anything exported in the lib to > extract

Re: [RFC PATCH 0/5] Generic IPI sending tracepoint

2022-10-08 Thread Steven Rostedt
On Fri, 7 Oct 2022 17:01:33 -0300 Marcelo Tosatti wrote: > > As for the targeted CPUs, the existing tracepoint does export them, albeit > > in > > cpumask form, which is quite inconvenient from a tooling perspective. For > > instance, as far as I'm aware, it's not possible to do event filtering

Re: [RFC PATCH 4/5] irq_work: Trace calls to arch_irq_work_raise()

2022-10-08 Thread Steven Rostedt
On Fri, 7 Oct 2022 16:45:32 +0100 Valentin Schneider wrote: > } > > +static inline void irq_work_raise(void) > +{ > + if (arch_irq_work_has_interrupt()) > + trace_ipi_send_cpu(_RET_IP_, smp_processor_id()); To save on the branch, let's make the above: if (trace_ipi_se

Re: [PATCH v2 33/44] ftrace: WARN on rcuidle

2022-09-27 Thread Steven Rostedt
Nit, the subject should have "tracing:" an not "ftrace:" as the former encompasses the tracing infrastructure and the latter is for the function hook part of that. On Mon, 19 Sep 2022 12:00:12 +0200 Peter Zijlstra wrote: > CONFIG_GENERIC_ENTRY disallows any and all tracing when RCU isn't > ena

Re: [PATCH] powerpc/ftrace: Ignore weak functions

2022-08-16 Thread Steven Rostedt
ded by > 'mflr r0' and 'stw r0,4(r1)'. > > With this patch, and with ppc64le_guest_defconfig and some ftrace/bpf > config items enabled: > # grep __ftrace_invalid_address available_filter_functions | wc -l > 79 I wonder if this patch answers the question

Re: [PATCH 0/2] ftrace/recordmcount: Handle object files without section symbols

2022-08-16 Thread Steven Rostedt
On Wed, 27 Apr 2022 15:01:20 +0530 "Naveen N. Rao" wrote: > This solves a build issue on powerpc with binutils v2.36 and newer [1]. > Since commit d1bcae833b32f1 ("ELF: Don't generate unused section > symbols") [2], binutils started dropping section symbols that it thought > were unused. Due to t

Re: [PATCH 24/36] printk: Remove trace_.*_rcuidle() usage

2022-06-14 Thread Steven Rostedt
.com, yury.no...@gmail.com, ulli.kr...@googlemail.com, vgu...@kernel.org, linux-...@vger.kernel.org, mon...@monstr.eu, r...@vger.kernel.org, b...@alien8.de, bc...@quicinc.com, tsbog...@alpha.franken.de, linux-par...@vger.kernel.org, sudeep.ho...@arm.com, shawn...@kernel.org, da...@davemloft.net

Re: [PATCH 18/30] notifier: Show function names on notifier routines if DEBUG_NOTIFIERS is set

2022-05-10 Thread Steven Rostedt
On Thu, 28 Apr 2022 09:01:13 +0800 Xiaoming Ni wrote: > > +#ifdef CONFIG_DEBUG_NOTIFIERS > > + { > > + char sym_name[KSYM_NAME_LEN]; > > + > > + pr_info("notifiers: registered %s()\n", > > + notifier_name(n, sym_name)); > > + } > > Duplicate Code. > >

Re: [PATCH 04/30] firmware: google: Convert regular spinlock into trylock on panic path

2022-05-10 Thread Steven Rostedt
On Tue, 10 May 2022 13:38:39 +0200 Petr Mladek wrote: > As already mentioned in the other reply, panic() sometimes stops > the other CPUs using NMI, for example, see kdump_nmi_shootdown_cpus(). > > Another situation is when the CPU using the lock ends in some > infinite loop because something we

Re: [PATCH 23/30] printk: kmsg_dump: Introduce helper to inform number of dumpers

2022-05-10 Thread Steven Rostedt
On Wed, 27 Apr 2022 19:49:17 -0300 "Guilherme G. Piccoli" wrote: > Currently we don't have a way to check if there are dumpers set, > except counting the list members maybe. This patch introduces a very > simple helper to provide this information, by just keeping track of > registered/unregistere

Re: [PATCH 2/2] recordmcount: Handle sections with no non-weak symbols

2022-05-04 Thread Steven Rostedt
On Wed, 4 May 2022 16:50:58 + Christophe Leroy wrote: > In vmlinux, relocations are resolved, trampolines are installed for > unreachable destinations and you don't anymore have a section with all > the relocations to mcount. It means 'recordmcount' or whatever tool we > use will have to r

Re: [PATCH 2/2] recordmcount: Handle sections with no non-weak symbols

2022-05-03 Thread Steven Rostedt
On Tue, 3 May 2022 11:20:22 + Christophe Leroy wrote: > Maybe I misunderstood. When you say 'after linking', do you mean vmlinux > or vmlinux.o ? Whichever ;-) > > In vmlinux, the addresses to be saved in __mcount_loc table might not > contain anymore a call to _mcount but a call to a tr

Re: [PATCH 2/2] recordmcount: Handle sections with no non-weak symbols

2022-05-02 Thread Steven Rostedt
On Mon, 2 May 2022 14:44:56 + Christophe Leroy wrote: > If we do that after the linking, won't it be a nightmare with the > trampolines installed by the linker when the destination is over the 24 > bits limit ? Not sure what you mean. The locations I'm talking about is the full address sav

Re: [PATCH v2 2/2] ftrace: recordmcount: Handle sections with no non-weak symbols

2022-04-29 Thread Steven Rostedt
On Sat, 30 Apr 2022 01:03:01 +0530 "Naveen N. Rao" wrote: > > The point of this section is to know which functions in __mcount_loc may > > have been overridden, as they would be found in the __mcount_loc_weak > > section. And then we can do something "special" to them. > > I'm not sure I follo

Re: [PATCH v2 2/2] ftrace: recordmcount: Handle sections with no non-weak symbols

2022-04-29 Thread Steven Rostedt
On Fri, 29 Apr 2022 23:09:19 +0530 "Naveen N. Rao" wrote: > If I'm understanding your suggestion right: > - we now create a new section in each object file: __mcount_loc_weak, > and capture such relocations using weak symbols there. Yes, but it would be putting the same information it puts in

Re: [PATCH 17/30] tracing: Improve panic/die notifiers

2022-04-29 Thread Steven Rostedt
On Fri, 29 Apr 2022 10:46:35 -0300 "Guilherme G. Piccoli" wrote: > Thanks Sergei and Steven, good idea! I thought about the switch change > you propose, but I confess I got a bit confused by the "fallthrough" > keyword - do I need to use it? No. The fallthrough keyword is only needed when there'

Re: [PATCH 17/30] tracing: Improve panic/die notifiers

2022-04-29 Thread Steven Rostedt
Why not: > > case DIE_OOPS: > case PANIC_NOTIFIER: > do_dump = 1; > break; Agreed. Other than that. Acked-by: Steven Rostedt (Google) -- Steve

Re: [PATCH v2 2/2] ftrace: recordmcount: Handle sections with no non-weak symbols

2022-04-28 Thread Steven Rostedt
On Thu, 28 Apr 2022 22:49:52 +0530 "Naveen N. Rao" wrote: > But, with ppc64 elf abi v1 which only supports the old -pg flag, mcount > location can differ between the weak and non-weak variants of a > function. In such scenarios, one of the two mcount entries will be > invalid. Such architectures

Re: [PATCH 2/2] recordmcount: Handle sections with no non-weak symbols

2022-04-28 Thread Steven Rostedt
On Thu, 28 Apr 2022 13:15:22 +0530 "Naveen N. Rao" wrote: > Indeed, plain old -pg will be a problem. I'm not sure there is a generic > way to address this. I suppose architectures will have to validate the > mcount locations, something like this? Perhaps another solution is to make the mcount

Re: [PATCH 2/2] recordmcount: Handle sections with no non-weak symbols

2022-04-27 Thread Steven Rostedt
On Wed, 27 Apr 2022 15:01:22 +0530 "Naveen N. Rao" wrote: > If one or both of these weak functions are overridden in future, in the > final vmlinux mcount table, references to these will change over to the > non-weak variant which has its own mcount location entry. As such, there > will now be tw

Re: [PATCH 1/2] ftrace: Drop duplicate mcount locations

2022-04-27 Thread Steven Rostedt
On Wed, 27 Apr 2022 15:01:21 +0530 "Naveen N. Rao" wrote: > In the absence of section symbols [1], objtool (today) and recordmcount > (with a subsequent patch) generate __mcount_loc relocation records with > weak symbols as the base. This works fine as long as those weak symbols > are not overrid

Re: [PATCH v1 07/22] powerpc/ftrace: Use patch_instruction() return directly

2022-04-18 Thread Steven Rostedt
On Mon, 18 Apr 2022 11:51:16 +0530 "Naveen N. Rao" wrote: > > --- a/arch/powerpc/kernel/trace/ftrace.c > > +++ b/arch/powerpc/kernel/trace/ftrace.c > > @@ -78,10 +78,7 @@ ftrace_modify_code(unsigned long ip, ppc_inst_t old, > > ppc_inst_t new) > > } > > > > /* replace the text with the

Re: [PATCH v2] ftrace: Make ftrace_graph_is_dead() a static branch

2022-03-30 Thread Steven Rostedt
On Wed, 30 Mar 2022 06:55:26 + Christophe Leroy wrote: > > Small nit. Please order the includes in "upside-down x-mas tree" fashion: > > > > #include > > #include > > #include > > #include > > > > That's the first time I get such a request. Usually people request > #includes to be i

Re: [PATCH v2] ftrace: Make ftrace_graph_is_dead() a static branch

2022-03-29 Thread Steven Rostedt
On Fri, 25 Mar 2022 09:03:08 +0100 Christophe Leroy wrote: > --- a/kernel/trace/fgraph.c > +++ b/kernel/trace/fgraph.c > @@ -10,6 +10,7 @@ > #include > #include > #include > +#include > Small nit. Please order the includes in "upside-down x-mas tree" fashion: #include #include #inclu

Re: [PATCH v2] MAINTAINERS: Enlarge coverage of TRACING inside architectures

2022-03-29 Thread Steven Rostedt
s containing > 'ftrace' as part of the name but with some prefix or suffix. Acked-by: Steven Rostedt (Google) -- Steve

Re: [PATCH v1] ftrace: Make ftrace_graph_is_dead() static inline

2022-03-24 Thread Steven Rostedt
On Thu, 24 Mar 2022 11:01:45 +0100 Christophe Leroy wrote: > @@ -1006,7 +1006,20 @@ unsigned long ftrace_graph_ret_addr(struct task_struct > *task, int *idx, > extern int register_ftrace_graph(struct fgraph_ops *ops); > extern void unregister_ftrace_graph(struct fgraph_ops *ops); > > -extern

Re: [PATCH] MAINTAINERS: Add arch/powerpc/kernel/trace to TRACING

2022-03-24 Thread Steven Rostedt
On Thu, 24 Mar 2022 15:38:28 +0100 Christophe Leroy wrote: > diff --git a/MAINTAINERS b/MAINTAINERS > index e127c2fb08a7..3b5943f34568 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -19592,6 +19592,7 @@ T:git > git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git > F:

Re: [PATCH v2 02/13] tracing: Fix selftest config check for function graph start up test

2022-02-24 Thread Steven Rostedt
On Thu, 24 Feb 2022 15:13:12 + Christophe Leroy wrote: > > But I'm working on a series to send to Linus. I can pick this patch up, as > > it touches just my code. > > > > That would be great, thanks. It's in my queue and running through my tests, which take 7 to 13 hours to complete (dep

Re: [PATCH v2 02/13] tracing: Fix selftest config check for function graph start up test

2022-02-24 Thread Steven Rostedt
On Thu, 24 Feb 2022 13:43:02 + Christophe Leroy wrote: > Hi Michael, > > Le 20/12/2021 à 17:38, Christophe Leroy a écrit : > > CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS is required to test > > direct tramp. > > > > Signed-off-by: Christophe Leroy > > You didn't apply this patch when you m

Re: [PATCH v2 09/13] powerpc/ftrace: Implement CONFIG_DYNAMIC_FTRACE_WITH_ARGS

2022-02-15 Thread Steven Rostedt
On Tue, 15 Feb 2022 19:06:48 +0530 "Naveen N. Rao" wrote: > As I understand it, the reason ftrace_get_regs() was introduced was to > be able to only return the pt_regs, if _all_ registers were saved into > it, which we don't do when coming in through ftrace_caller(). See the > x86 implementati

Re: [PATCH v2 11/13] powerpc/ftrace: directly call of function graph tracer by ftrace caller

2022-02-14 Thread Steven Rostedt
On Mon, 14 Feb 2022 22:54:23 +0530 "Naveen N. Rao" wrote: > For x86, commit 0c0593b45c9b4e ("x86/ftrace: Make function graph use > ftrace directly") also adds recursion check before the call to > function_graph_enter() in prepare_ftrace_return(). Do we need that on > powerpc as well? Yes. The

Re: [RFC PATCH 2/3] powerpc/ftrace: Override ftrace_location_lookup() for MPROFILE_KERNEL

2022-02-10 Thread Steven Rostedt
On Thu, 10 Feb 2022 16:40:28 + "Naveen N. Rao" wrote: > The other option is to mark ftrace_cmp_recs() as a __weak function, but > I have a vague recollection of you suggesting #ifdef rather than a > __weak function in the past. I might be mis-remembering, so if you think > making this a __

  1   2   3   4   5   6   7   >