Re: [RFC PATCH v2 20/31] function_graph: Add a new exit handler with parent_ip and ftrace_regs

2023-11-08 Thread Google
On Wed, 8 Nov 2023 23:28:11 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > Add a new return handler to fgraph_ops as 'retregfunc' which takes > parent_ip and ftrace_regs instead of ftrace_graph_ret. This handler > is available only if the arch support

Re: [RFC PATCH v2 01/31] tracing: Add a comment about ftrace_regs definition

2023-11-08 Thread Google
On Wed, 8 Nov 2023 23:24:32 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > To clarify what will be expected on ftrace_regs, add a comment to the > architecture independent definition of the ftrace_regs. > > Signed-off-by: Masami Hiramatsu (Google) > --- >

Re: [PATCH v7 00/13] selftests/sgx: Fix compilation errors

2023-11-08 Thread Dave Hansen
On 11/8/23 12:31, Jo Van Bulck wrote: > Just a kind follow-up: from what I can see, this series has not been > merged into the x86/sgx branch of tip yet (assuming that's where it > should go next)? > > Apologies if I've overlooked anything, and please let me know if there's > something on my end

Re: [PATCH v7 00/13] selftests/sgx: Fix compilation errors

2023-11-08 Thread Jo Van Bulck
On 23.10.23 23:32, Jarkko Sakkinen wrote: On Fri Oct 13, 2023 at 2:45 PM EEST, Jo Van Bulck wrote: On 10.10.23 11:44, Jarkko Sakkinen wrote: Folks (sorry for top posting): I've now taken my old NUC7 out of the dust and tested the series :-) Tested-by: Jarkko Sakkinen Thanks for testing

[RFC PATCH v2 31/31] Documentation: probes: Update fprobe on function-graph tracer

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Update fprobe documentation for the new fprobe on function-graph tracer. This includes some bahvior changes and pt_regs to ftrace_regs interface change. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Update @fregs parameter explanation. ---

[RFC PATCH v2 30/31] selftests: ftrace: Remove obsolate maxactive syntax check

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since the fprobe event does not support maxactive anymore, stop testing the maxactive syntax error checking. Signed-off-by: Masami Hiramatsu (Google) --- .../ftrace/test.d/dynevent/fprobe_syntax_errors.tc |4 +--- 1 file changed, 1 insertion(+), 3

[RFC PATCH v2 29/31] bpf: Enable kprobe_multi feature if CONFIG_FPROBE is enabled

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Enable kprobe_multi feature if CONFIG_FPROBE is enabled. The pt_regs is converted from ftrace_regs by ftrace_partial_regs(), thus some registers may always returns 0. But it should be enough for function entry (access arguments) and exit (access return value).

[RFC PATCH v2 28/31] tracing/fprobe: Enable fprobe events with CONFIG_DYNAMIC_FTRACE_WITH_ARGS

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Allow fprobe events to be enabled with CONFIG_DYNAMIC_FTRACE_WITH_ARGS. With this change, fprobe events mostly use ftrace_regs instead of pt_regs. Note that if the arch doesn't enable HAVE_PT_REGS_COMPAT_FTRACE_REGS, fprobe events will not be able to be used from

[RFC PATCH v2 27/31] tracing/fprobe: Remove nr_maxactive from fprobe

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Remove depercated fprobe::nr_maxactive. This involves fprobe events to rejects the maxactive number. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Newly added. --- include/linux/fprobe.h |2 -- kernel/trace/trace_fprobe.c | 44

[RFC PATCH v2 26/31] fprobe: Rewrite fprobe on function-graph tracer

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Rewrite fprobe implementation on function-graph tracer. Major API changes are: - 'nr_maxactive' field is deprecated. - This depends on CONFIG_DYNAMIC_FTRACE_WITH_ARGS or !CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS, and CONFIG_HAVE_FUNCTION_GRAPH_FREGS. So

[RFC PATCH v2 25/31] tracing: Add ftrace_fill_perf_regs() for perf event

2023-11-08 Thread Masami Hiramatsu (Google)
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_mode(regs) == false' and can be used for stack tracing. Signed-off-by: Masami

[RFC PATCH v2 24/31] tracing: Add ftrace_partial_regs() for converting ftrace_regs to pt_regs

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add ftrace_partial_regs() which converts the ftrace_regs to pt_regs. If the architecture defines its own ftrace_regs, this copies partial registers to pt_regs and returns it. If not, ftrace_regs is the same as pt_regs and ftrace_partial_regs() will return

[RFC PATCH v2 23/31] fprobe: Use ftrace_regs in fprobe exit handler

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Change the fprobe exit handler to use ftrace_regs structure instead of pt_regs. This also introduce HAVE_PT_REGS_TO_FTRACE_REGS_CAST which means the ftrace_regs's memory layout is equal to the pt_regs so that those are able to cast. Fprobe introduces a new

[RFC PATCH v2 22/31] fprobe: Use ftrace_regs in fprobe entry handler

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) This allows fprobes to be available with CONFIG_DYNAMIC_FTRACE_WITH_ARGS instead of CONFIG_DYNAMIC_FTRACE_WITH_REGS, then we can enable fprobe on arm64. Signed-off-by: Masami Hiramatsu (Google) Acked-by: Florent Revest --- Changes from previous series:

[RFC PATCH v2 21/31] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Support HAVE_FUNCTION_GRAPH_FREGS on x86-64, which saves ftrace_regs on the stack in ftrace_graph return trampoline so that the callbacks can access registers via ftrace_regs APIs. Note that this only recovers 'rax' and 'rdx' registers because other registers are

[RFC PATCH v2 20/31] function_graph: Add a new exit handler with parent_ip and ftrace_regs

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a new return handler to fgraph_ops as 'retregfunc' which takes parent_ip and ftrace_regs instead of ftrace_graph_ret. This handler is available only if the arch support CONFIG_HAVE_FUNCTION_GRAPH_FREGS. Note that the 'retfunc' and 'reregfunc' are mutual

[RFC PATCH v2 19/31] function_graph: Add a new entry handler with parent_ip and ftrace_regs

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a new entry handler to fgraph_ops as 'entryregfunc' which takes parent_ip and ftrace_regs. Note that the 'entryfunc' and 'entryregfunc' are mutual exclusive. You can set only one of them. Signed-off-by: Masami Hiramatsu (Google) ---

[RFC PATCH v2 18/31] function_graph: Add selftest for passing local variables

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Add boot up selftest that passes variables from a function entry to a function exit, and make sure that they do get passed around. Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Add reserved size test. -

[RFC PATCH v2 17/31] function_graph: Implement fgraph_reserve_data() and fgraph_retrieve_data()

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Added functions that can be called by a fgraph_ops entryfunc and retfunc to store state between the entry of the function being traced to the exit of the same function. The fgraph_ops entryfunc() may call fgraph_reserve_data() to store up to 32 words onto the task's

[RFC PATCH v2 16/31] function_graph: Move graph notrace bit to shadow stack global var

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) The use of the task->trace_recursion for the logic used for the function graph no-trace was a bit of an abuse of that variable. Now that there exists global vars that are per stack for registered graph traces, use that instead. Signed-off-by: Steven Rostedt

[RFC PATCH v2 15/31] function_graph: Move graph depth stored data to shadow stack global var

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) The use of the task->trace_recursion for the logic used for the function graph depth was a bit of an abuse of that variable. Now that there exists global vars that are per stack for registered graph traces, use that instead. Signed-off-by: Steven Rostedt (VMware)

[RFC PATCH v2 14/31] function_graph: Move set_graph_function tests to shadow stack global var

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) The use of the task->trace_recursion for the logic used for the set_graph_funnction was a bit of an abuse of that variable. Now that there exists global vars that are per stack for registered graph traces, use that instead. Signed-off-by: Steven Rostedt (VMware)

[RFC PATCH v2 13/31] function_graph: Add "task variables" per task for fgraph_ops

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Add a "task variables" array on the tasks shadow ret_stack that is the size of longs for each possible registered fgraph_ops. That's a total of 16, taking up 8 * 16 = 128 bytes (out of a page size 4k). This will allow for fgraph_ops to do specific features on a per

[RFC PATCH v2 12/31] function_graph: Have the instances use their own ftrace_ops for filtering

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Allow for instances to have their own ftrace_ops part of the fgraph_ops that makes the funtion_graph tracer filter on the set_ftrace_filter file of the instance and not the top instance. Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Masami Hiramatsu

[RFC PATCH v2 11/31] ftrace: Allow ftrace startup flags exist without dynamic ftrace

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Some of the flags for ftrace_startup() may be exposed even when CONFIG_DYNAMIC_FTRACE is not configured in. This is fine as the difference between dynamic ftrace and static ftrace is done within the internals of ftrace itself. No need to have use cases fail to

[RFC PATCH v2 10/31] ftrace: Allow function_graph tracer to be enabled in instances

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Now that function graph tracing can handle more than one user, allow it to be enabled in the ftrace instances. Note, the filtering of the functions is still joined by the top level set_ftrace_filter and friends, as well as the graph and nograph files.

[RFC PATCH v2 09/31] ftrace/function_graph: Pass fgraph_ops to function graph callbacks

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Pass the fgraph_ops structure to the function graph callbacks. This will allow callbacks to add a descriptor to a fgraph_ops private field that wil be added in the future and use it for the callbacks. This will be useful when more than one callback can be registered

[RFC PATCH v2 08/31] function_graph: Remove logic around ftrace_graph_entry and return

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) The function pointers ftrace_graph_entry and ftrace_graph_return are no longer called via the function_graph tracer. Instead, an array structure is now used that will allow for multiple users of the function_graph infrastructure. The variables are still used by the

[RFC PATCH v2 07/31] function_graph: Allow multiple users to attach to function graph

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Allow for multiple users to attach to function graph tracer at the same time. Only 16 simultaneous users can attach to the tracer. This is because there's an array that stores the pointers to the attached fgraph_ops. When a function being traced is entered, each of

[RFC PATCH v2 06/31] function_graph: Add an array structure that will allow multiple callbacks

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Add an array structure that will eventually allow the function graph tracer to have up to 16 simultaneous callbacks attached. It's an array of 16 fgraph_ops pointers, that is assigned when one is registered. On entry of a function the entry of the first item in the

[RFC PATCH v2 05/31] fgraph: Use BUILD_BUG_ON() to make sure we have structures divisible by long

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Instead of using "ALIGN()", use BUILD_BUG_ON() as the structures should always be divisible by sizeof(long). Link: http://lkml.kernel.org/r/2019052444.gi2...@hirez.programming.kicks-ass.net Suggested-by: Peter Zijlstra Signed-off-by: Steven Rostedt (VMware)

[RFC PATCH v2 04/31] function_graph: Convert ret_stack to a series of longs

2023-11-08 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) In order to make it possible to have multiple callbacks registered with the function_graph tracer, the retstack needs to be converted from an array of ftrace_ret_stack structures to an array of longs. This will allow to store the list of callbacks on the stack for

[RFC PATCH v2 03/31] seq_buf: Export seq_buf_puts()

2023-11-08 Thread Masami Hiramatsu (Google)
From: Christophe JAILLET Mark seq_buf_puts() which is part of the seq_buf API to be exported to kernel loadable GPL modules. Link: https://lkml.kernel.org/r/b9e3737f66ec2450221b492048ce0d9c65c84953.1698861216.git.christophe.jail...@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by:

[RFC PATCH v2 02/31] x86: tracing: Add ftrace_regs definition in the header

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add ftrace_regs definition for x86_64 in the ftrace header to clarify what register will be accessible from ftrace_regs. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Newly added. --- arch/x86/include/asm/ftrace.h |6 ++ 1 file

[RFC PATCH v2 01/31] tracing: Add a comment about ftrace_regs definition

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) To clarify what will be expected on ftrace_regs, add a comment to the architecture independent definition of the ftrace_regs. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - newly added. --- include/linux/ftrace.h | 25

[RFC PATCH v2 00/31] tracing: fprobe: function_graph: Multi-function graph and fprobe on fgraph

2023-11-08 Thread Masami Hiramatsu (Google)
Hi, Here is the 2nd version of the series to re-implement the fprobe on function-graph tracer. The previous version is; https://lore.kernel.org/all/169920038849.482486.1579638721992967.stgit@devnote2/ In this version I merged the fixes to appropriate patches and fix some typos/bugs, and fix

[PATCH v2] tracing: fprobe-event: Fix to check tracepoint event and return

2023-11-08 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Fix to check the tracepoint event is not valid with $retval. The commit 08c9306fc2e3 ("tracing/fprobe-event: Assume fprobe is a return event by $retval") introduced automatic return probe conversion with $retval. But since tracepoint event does not support return

Re: [PATCH] tracing: fprobe-event: Fix to check tracepoint event and return

2023-11-08 Thread Google
On Wed, 8 Nov 2023 20:01:50 +0900 Masami Hiramatsu (Google) wrote: > On Tue, 7 Nov 2023 09:40:45 +0900 > Masami Hiramatsu (Google) wrote: > > > On Mon, 6 Nov 2023 17:28:11 -0500 > > Steven Rostedt wrote: > > > > > On Sat, 4 Nov 2023 01:05:34 +0900 > > > "Masami Hiramatsu (Google)" wrote: >

Re: [PATCH] tracing: fprobe-event: Fix to check tracepoint event and return

2023-11-08 Thread Google
On Tue, 7 Nov 2023 09:40:45 +0900 Masami Hiramatsu (Google) wrote: > On Mon, 6 Nov 2023 17:28:11 -0500 > Steven Rostedt wrote: > > > On Sat, 4 Nov 2023 01:05:34 +0900 > > "Masami Hiramatsu (Google)" wrote: > > > > > From: Masami Hiramatsu (Google) > > > > > > Fix to check the tracepoint

Re: [PATCH] fs : Fix warning using plain integer as NULL

2023-11-08 Thread Abhinav Singh
On 11/8/23 16:17, Abhinav Singh wrote: Sparse static analysis tools generate a warning with this message "Using plain integer as NULL pointer". In this case this warning is being shown because we are trying to initialize pointer to NULL using integer value 0. Signed-off-by: Abhinav Singh

[PATCH] fs : Fix warning using plain integer as NULL

2023-11-08 Thread Abhinav Singh
Sparse static analysis tools generate a warning with this message "Using plain integer as NULL pointer". In this case this warning is being shown because we are trying to initialize pointer to NULL using integer value 0. Signed-off-by: Abhinav Singh Reviewed-by: Jan Kara --- fs/dax.c |

Re: [PATCH v5 09/11] remoteproc: qcom: Add Hexagon based multipd rproc driver

2023-11-08 Thread Manikanta Mylavarapu
On 8/2/2023 7:36 PM, Manikanta Mylavarapu wrote: It adds support to bring up remoteproc's on multipd model. Pd means protection domain. It's similar to process in Linux. Here QDSP6 processor runs each wifi radio functionality on a separate process. One process can't access other process

Re: [PATCH] fs : Fix warning using plain integer as NULL

2023-11-08 Thread Jan Kara
On Wed 08-11-23 10:15:50, Abhinav Singh wrote: > Sparse static analysis tools generate a warning with this message > "Using plain integer as NULL pointer". In this case this warning is > being shown because we are trying to initialize pointer to NULL using > integer value 0. > > Signed-off-by:

Re: [PATCH] fs : Fix warning using plain integer as NULL

2023-11-08 Thread Christian Brauner
On Wed, 08 Nov 2023 10:15:50 +0530, Abhinav Singh wrote: > Sparse static analysis tools generate a warning with this message > "Using plain integer as NULL pointer". In this case this warning is > being shown because we are trying to initialize pointer to NULL using > integer value 0. > >