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: NOTHING
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
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
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)
---
arch/arm64/kernel
From: Masami Hiramatsu (Google)
Expand the maximum reserved data size to 32 from 4. On 64bit system,
this will allow reserving 256 bytes on the ret_stack in maximum but
that may not happen.
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c |4 ++--
1 file changed, 2
From: Masami Hiramatsu (Google)
Make the fgraph_retrieve_data() returns the reverved data size via
size_byte parameter.
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h|2 +-
kernel/trace/fgraph.c |5 -
kernel/trace/trace_selftest.c | 10
From: Masami Hiramatsu (Google)
Fix to check the return value ('ret_stack') of ftrace_pop_return_trace()
instead of passed storage ('ret') because ret_stack becomes NULL in
error case.
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c |2 +-
1 file changed, 1 insertion
From: Masami Hiramatsu (Google)
Fix to initialize the ftrace_ops of fgraph_ops with ftrace_graph_func
instead of ftrace_stub.
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/fgraph.c b
From: Masami Hiramatsu (Google)
__ftrace_return_to_handler() missed to update the curr_ret_stack when it
gets a FGRAPH_TYPE_ARRAY. Since that type entry will follows some data
words, it must update curr_ret_stack by entry size value (__get_index(val))
instead of 1.
Signed-off-by: Masami
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)
---
kernel/trace/trace_selftest.c | 161 +
1 file
shadow ret_stack and this then can be
retrived by fgraph_retrieve_data() called by the corresponding retfunc().
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h |3 +
kernel/trace/fgraph.c | 244
are)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/trace_recursion.h |7 ---
kernel/trace/trace.h |9 +
kernel/trace/trace_functions_graph.c | 10 ++
3 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/include/li
are)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/trace_recursion.h | 29 -
kernel/trace/trace.h| 34 --
2 files changed, 32 insertions(+), 31 deletions(-)
diff --git a/include/linux/trace_recursion.h b/incl
are)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/trace_recursion.h |5 +
kernel/trace/trace.h | 32 +---
kernel/trace/trace_functions_graph.c |6 +++---
kernel/trace/trace_irqsoff.c |4 ++--
kernel/tr
s on a per task basis
having a way to maintain state for each task.
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h |2 +
kernel/trace/fgraph.c | 73 +++-
2 files changed, 74 insert
(Google)
---
include/linux/ftrace.h |1 +
kernel/trace/fgraph.c| 60 +-
kernel/trace/ftrace.c|6 ++-
kernel/trace/trace.h | 16 +
kernel/trace/trace_functions.c |2 +
kernel/trace
to compile because dynamic
ftrace is disabled.
This change is needed to move some of the logic of what is passed to
ftrace_startup() out of the parameters of ftrace_startup().
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h | 18
-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h |1 +
kernel/trace/ftrace.c|1 +
kernel/trace/trace.h | 12 ++
kernel/trace/trace_functions.c |8
kernel/trace
to the function graph tracer.
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/ftrace.h | 10 +++---
kernel/trace/fgraph.c| 17 ++---
kernel/trace/ftrace.c|6 --
kernel
into the
function_graph tracer.
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c | 72 +++-
kernel/trace/ftrace.c |2 -
kernel/trace/ftrace_internal.h |2 -
3 files changed, 20 insertions(+), 56
are called is not completely
handled yet, but that shouldn't be too hard to manage.
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c | 332 +
1 file changed, 280 insertions(+), 52 deletions
on
the shadow stack. We need to only save the index, because this will allow
the fgraph_ops to be freed before the function returns (which may happen if
the function call schedule for a long time).
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c
for the return side of the functions.
Signed-off-by: Steven Rostedt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
include/linux/sched.h |2 -
kernel/trace/fgraph.c | 124 -
2 files changed, 71 insertions(+), 55 deletions(-)
diff --git
dt (VMware)
Signed-off-by: Masami Hiramatsu (Google)
---
kernel/trace/fgraph.c |9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
index 30edeb6d4aa9..837daf929d2a 100644
--- a/kernel/trace/fgraph.c
+++ b/kernel/trac
-by: Steven Rostedt (Google)
Signed-off-by: Masami Hiramatsu (Google)
---
lib/seq_buf.c |1 +
1 file changed, 1 insertion(+)
diff --git a/lib/seq_buf.c b/lib/seq_buf.c
index 45c450f423fa..46a1b00c3815 100644
--- a/lib/seq_buf.c
+++ b/lib/seq_buf.c
@@ -189,6 +189,7 @@ int seq_buf_puts(struct
below branch.
https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/log/?h=topic/fprobe-on-fgraph
Thank you,
---
Christophe JAILLET (1):
seq_buf: Export seq_buf_puts()
Masami Hiramatsu (Google) (16):
function_graph: Fix to update curr_ret_stack with ARRAY entry size
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
supp
; > and all modules. If mod is sepecified, search the symbol on the specific
> > module'.
> >
> > Thus, "if func_name is only part of the module named mod", the
> > module_kallsyms_on_each_symbol() will count the 'func_name' in 'mod' module
> > correctly.
>
> Sorry, I looked to quickly and forgot about the return value of strcmp()...
No problem, strcmp() always traps us :)
>
> From the code, everything seems OK!
> If I have some time, I will test it and potentially come back with a "Tested-
> by" tag but without any warranty.
Thank you!
>
> > Thank you,
> >
> >
> > Thank you,
>
> Best regards.
>
>
--
Masami Hiramatsu (Google)
On Wed, 01 Nov 2023 13:25:49 -0400
Steven Rostedt wrote:
> From: "Steven Rostedt (Google)"
>
> Looking at how dentry is removed via the tracefs system, I found that
> eventfs does not do everything that it did under tracefs. The tracefs
> removal of a dentry calls
On Tue, 31 Oct 2023 12:24:53 -0400
Steven Rostedt wrote:
> From: "Steven Rostedt (Google)"
>
> The following can crash the kernel:
>
> # cd /sys/kernel/tracing
> # echo 'p:sched schedule' > kprobe_events
> # exec 5>>events/kprobes/sched
On Wed, 01 Nov 2023 13:25:48 -0400
Steven Rostedt wrote:
> From: "Steven Rostedt (Google)"
>
> The top level events directory is no longer special with regards to how it
> should be delete. Remove the extra processing for it in
> eventfs_set_ei_status_free().
>
On Wed, 01 Nov 2023 13:25:46 -0400
Steven Rostedt wrote:
> From: "Steven Rostedt (Google)"
>
> The callback function that is used to create inodes and dentries is not
> protected by anything and the data that is passed to it could become
> stale. After event
On Tue, 31 Oct 2023 18:33:30 -0400
Steven Rostedt wrote:
> From: "Steven Rostedt (Google)"
>
> Now that inodes and dentries are created on the fly, they are also
> reclaimed on memory pressure. Since the ownership and file mode are saved
> in the inode, if th
On Tue, 31 Oct 2023 18:33:28 -0400
Steven Rostedt wrote:
> From: "Steven Rostedt (Google)"
>
> As the eventfs_inode is freed in two different locations, make a helper
> function free_ei() to make sure all the allocated fields of the
> eventfs_inode is freed.
&g
On Tue, 31 Oct 2023 18:33:27 -0400
Steven Rostedt wrote:
> From: "Steven Rostedt (Google)"
>
> The eventfs_inode->is_freed was a union with the rcu_head with the
> assumption that when it was on the srcu list the head would contain a
> pointer whic
continue;
...
So with above change, 'if mod is not specified, search the symbols in kernel
and all modules. If mod is sepecified, search the symbol on the specific
module'.
Thus, "if func_name is only part of the module named mod", the
module_kallsyms_on_each_symbol() will count the 'func_name' in 'mod' module
correctly.
Thank you,
Thank you,
--
Masami Hiramatsu (Google)
On Sat, 28 Oct 2023 16:46:50 -0400
Steven Rostedt wrote:
> From: "Steven Rostedt (Google)"
>
> The eventfs_inode (ei) is protected by SRCU, but the ei->dentry is not. It
> is protected by the eventfs_mutex. Anytime the eventfs_mutex is released,
> and access to the
From: Masami Hiramatsu (Google)
Check the number of probe target symbols in the target module when
the module is loaded. If the probe is not on the unique name symbols
in the module, it will be rejected at that point.
Note that the symbol which has a unique name in the target module
blems if you end up doing operations on both
> > the entire word and a sub-unit of the same thing.
>
> Thank you for pointing out this. I'll do some research on these
> implementations.
arc also has the LL-SC instruction but depends on the core feature,
so I think we can use it.
Thank you,
>
> > Arnd
>
> Regards,
> wuqiang
>
--
Masami Hiramatsu (Google)
On Sat, 28 Oct 2023 10:41:44 +0900
Masami Hiramatsu (Google) wrote:
> Hi,
>
> On Fri, 27 Oct 2023 16:31:26 -0700
> Andrii Nakryiko wrote:
>
> > Recent changes to count number of matching symbols when creating
> > a kprobe event failed to take
t;
> - count = 0;
> - kallsyms_on_each_match_symbol(count_symbols, func_name, );
> + module_kallsyms_on_each_symbol(NULL, count_mod_symbols, );
>
> - return count;
> + return ctx.count;
> }
>
> static int __trace_kprobe_create(int argc, const char *argv[])
> --
> 2.34.1
>
--
Masami Hiramatsu (Google)
org
> > Cc: Masami Hiramatsu
> > Cc: Steven Rostedt
> > Fixes: b022f0c7e404 ("tracing/kprobes: Return EADDRNOTAVAIL when func
> > matches several symbols")
> > Signed-off-by: Andrii Nakryiko
>
> Acked-by: Song Liu
Good catch! Thanks!
--
Masami Hiramatsu (Google)
* @cmd: A pointer to the dynevent_cmd struct representing the new event
> > - * @args: Variable number of arg (pairs), one pair for each field
> > + * @...: Variable number of arg (pairs), one pair for each field
> >*
> >* NOTE: Users normally won't want to call this function directly, but
> >* rather use the kprobe_event_add_fields() wrapper, which
--
Masami Hiramatsu (Google)
On Tue, 24 Oct 2023 12:36:28 -0400
Steven Rostedt wrote:
> From: "Steven Rostedt (Google)"
>
> As the comment right above a WARN_ON() in create_file_dentry() states:
>
> * Note, with the mutex held, the e_dentry cannot have content
> * and the ei->is
966e1740 T device_show_int
> 966e1770 T device_show_bool
> c04e10a0 t device_show [mmc_core]
> c04e10a0 t device_show@drivers_mmc_core_sdio_bus_c_45 [mmc_core]
>
> Signed-off-by: Alessandro Carminati (Red Hat)
>
Thanks for update. I tested that.
On Wed, 25 Oct 2023 19:26:37 +0800
"wuqiang.matt" wrote:
> On 2023/10/24 22:52, Masami Hiramatsu (Google) wrote:
> > From: Masami Hiramatsu (Google)
> >
> > Use generic_cmpxchg_local() for arch_cmpxchg_local() implementation
> > in SH archi
From: Masami Hiramatsu (Google)
Use __generic_cmpxchg_local() for arch_cmpxchg_local() implementation
in SH architecture because it does not implement arch_cmpxchg_local().
Reported-by: kernel test robot
Closes:
https://lore.kernel.org/oe-kbuild-all/202310241310.ir5uukog-...@intel.com/
Signed
matsu wrote:
> > > > On Tue, 24 Oct 2023 16:08:12 +0100
> > > > Mark Rutland wrote:
> > > > > On Tue, Oct 24, 2023 at 11:52:54PM +0900, Masami Hiramatsu (Google)
> > > > > wrote:
> > > > > > From: Masami Hiramatsu (G
On Tue, 24 Oct 2023 16:08:12 +0100
Mark Rutland wrote:
> On Tue, Oct 24, 2023 at 11:52:54PM +0900, Masami Hiramatsu (Google) wrote:
> > From: Masami Hiramatsu (Google)
> >
> > Use generic_cmpxchg_local() for arch_cmpxchg_local() implementation
> > in SH a
From: Masami Hiramatsu (Google)
Use generic_cmpxchg_local() for arch_cmpxchg_local() implementation
in SH architecture because it does not implement arch_cmpxchg_local().
Reported-by: kernel test robot
Closes:
https://lore.kernel.org/oe-kbuild-all/202310241310.ir5uukog-...@intel.com/
Signed
On Tue, 24 Oct 2023 09:57:17 +0800
"wuqiang.matt" wrote:
> On 2023/10/24 09:01, Masami Hiramatsu (Google) wrote:
> > On Mon, 23 Oct 2023 11:43:04 -0400
> > Steven Rostedt wrote:
> >
> >> On Mon, 23 Oct 2023 19:24:52 +0800
> >> "wuqiang.mat
uot; as a parameter to objpool_try_add_slot() and adding:
>
> int cpu = raw_smp_processor_id();
>
> Which now shows that this function *only* deals with the current CPU.
Oh indeed. It used to search all CPUs to push the object, but
I asked him to stop that because there should be enough space to
push it in the local ring. This is a remnant of that time.
Wuqiang, can you make another patch to fix it?
Thank you,
>
> -- Steve
--
Masami Hiramatsu (Google)
32T48T64T96T 128T
> lock: 957553042 1435814086 1680872925 2043126796 2165424198
> local: 968526317 1454991286 1861053557 2059530343 2171732306
>
Yeah, slot->tail is only used on the local CPU. This looks good to me.
Acked-by: Masa
ll of them
> should be removed.
>
> Reported-by: kernel test robot
> Closes:
> https://lore.kernel.org/oe-kbuild-all/202310191512.vvypku5z-...@intel.com/
Looks good to me.
Acked-by: Masami Hiramatsu (Google)
Thanks,
>
> Signed-off-by: wuqiang.matt
> ---
> kerne
when func matches several
> symbols
> selftests/ftrace: Add new test case which checks non unique symbol
>
> kernel/trace/trace_kprobe.c | 63 +++
> kernel/trace/trace_probe.h| 1 +
> .../test.d/kprobe/kprobe_non_uniq_symbol.tc | 13
> 3 files changed, 77 insertions(+)
> create mode 100644
> tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc
>
> Best regards and thank you in advance.
> ---
> [1]:
> https://lore.kernel.org/lkml/20230816163517.112518-1-flan...@linux.microsoft.com/
> [2]:
> https://lore.kernel.org/lkml/20230819101105.b0c104ae4494a7d1f2eea...@kernel.org/
> --
> 2.34.1
>
--
Masami Hiramatsu (Google)
On Thu, 19 Oct 2023 09:51:04 -0400
Steven Rostedt wrote:
> On Thu, 19 Oct 2023 21:18:43 +0900
> Masami Hiramatsu (Google) wrote:
>
> > > So why is this adding stable? (and as Greg's form letter states, that's
> > > not
> > > how you do that)
> > &g
address may NOT be the instruction boundary.
To avoid this issue, it should check the given symbol is unique.
Thank you,
>
> -- Steve
--
Masami Hiramatsu (Google)
Hi,
On Mon, 16 Oct 2023 22:23:14 +0900
Masami Hiramatsu (Google) wrote:
> Hi Peter,
>
> This freelist has been introduced by you, is it OK to remove this because no
> other user exists?
I'll pick this on my probes/for-next branch. If there is any issue reported,
I'll revert it
alability improvement with objpool
> kprobes: freelist.h removed
> MAINTAINERS: objpool added
OK, this version looks good to me.
Acked-by: Masami Hiramatsu (Google)
I'll pick this series on for-next branch.
Thank you,
>
> MAINTAINERS | 7 +
> include/linu
Hi Francis,
On Thu, 31 Aug 2023 09:14:55 +0200
Francis Laniel wrote:
> Hi.
>
> Le mercredi 30 août 2023, 01:57:19 CEST Steven Rostedt a écrit :
> > On Fri, 25 Aug 2023 22:13:21 +0900
> >
> > Masami Hiramatsu (Google) wrote:
> > > > Excellent catch! Than
r_id();
> + for (i = 0; i < num_possible_cpus(); i++) {
> + obj = objpool_try_get_slot(pool, cpu);
> + if (obj)
> + break;
> + cpu = cpumask_next_wrap(cpu, cpu_possible_mask, -1, 1);
> + }
> + raw_l
From: Masami Hiramatsu (Google)
The number of active retprobes can be zero but it is not acceptable,
so return EINVAL error if detected.
Reported-by: wuqiang.matt
Closes:
https://lore.kernel.org/all/20231016222103.cb9f426edc60220eabd8a...@kernel.org/
Fixes: 5b0ab78998e3 ("fprobe
*/
> - atomic_fetch_add(-2, >refs);
> -
> - return head;
> - }
> -
> - /*
> - * OK, the head must have changed on us, but we still need to
> decrement
> - * the refcount we increased.
> - */
> - refs = atomic_fetch_add(-1, >refs);
> - if (refs == REFS_ON_FREELIST + 1)
> - __freelist_add(prev, list);
> - }
> -
> - return NULL;
> -}
> -
> -#endif /* FREELIST_H */
> --
> 2.40.1
>
--
Masami Hiramatsu (Google)
, GFP_KERNEL,
> + rp->rph, kretprobe_init_inst, kretprobe_fini_pool)) {
> + kfree(rp->rph);
> + rp->rph = NULL;
> + return -ENOMEM;
> }
> - refcount_set(>rph->ref, i);
> -
> + rp->rph->rp = rp;
> rp->nmissed = 0;
> /* Establish function entry probe point */
> ret = register_kprobe(>kp);
> diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
> index 3b21f4063258..f5bf98e6b2ac 100644
> --- a/kernel/trace/fprobe.c
> +++ b/kernel/trace/fprobe.c
> @@ -187,9 +187,9 @@ static void fprobe_init(struct fprobe *fp)
>
> static int fprobe_init_rethook(struct fprobe *fp, int num)
> {
> - int i, size;
> + int size;
>
> - if (num < 0)
> + if (num <= 0)
> return -EINVAL;
Oops, this must be a bugfix. Let me fix it.
>
> if (!fp->exit_handler) {
> @@ -202,29 +202,21 @@ static int fprobe_init_rethook(struct fprobe *fp, int
> num)
> size = fp->nr_maxactive;
> else
> size = num * num_possible_cpus() * 2;
> - if (size < 0)
> + if (size <= 0)
> return -E2BIG;
Here too.
Except for this point, it looks good to me.
Thanks!
--
Masami Hiramatsu (Google)
Hi Wuqiang,
On Mon, 16 Oct 2023 10:45:30 +0800
"wuqiang.matt" wrote:
> On 2023/10/16 07:26, Masami Hiramatsu (Google) wrote:
> > On Mon, 16 Oct 2023 00:06:11 +0800
> > "wuqiang.matt" wrote:
> >
> >> On 2023/10/15 23:43, Masami Hiramatsu (Googl
On Mon, 16 Oct 2023 00:06:11 +0800
"wuqiang.matt" wrote:
> On 2023/10/15 23:43, Masami Hiramatsu (Google) wrote:
> > On Sun, 15 Oct 2023 13:32:47 +0800
> > "wuqiang.matt" wrote:
> >
> >> objpool is a scalable implementation of high performanc
Hi,
Sorry please ignore this. I found that the arch/riscv doesn't support
HAVE_DYNAMIC_FTRACE_WITH_ARGS. Thus this might add a new feature support.
Let me update it.
Thank you,
On Sun, 15 Oct 2023 23:15:23 +0900
Masami Hiramatsu (Google) wrote:
> Hi,
>
> Gentry ping.
>
> I th
during pool
> + * initialization in objpool_init()
> + */
> + if (refcount_dec_and_test(>ref))
> + objpool_free(pool);
Nit: you can call objpool_drop() instead of repeating the same thing here.
Thank you,
> + } while (obj);
> +}
> +EXPORT_SYMBOL_GPL(objpool_fini);
> --
> 2.40.1
>
--
Masami Hiramatsu (Google)
Hi,
Gentry ping.
I think this should be an important fix because if a fprobe handler without
FTRACE_OPS_FL_SAVE_REGS tries to access any register via ftrace_regs, that
will get a wrong value.
Thank you,
On Mon, 2 Oct 2023 21:50:34 +0900
"Masami Hiramatsu (Google)" wrote:
>
On Fri, 13 Oct 2023 01:36:05 +0800
"wuqiang.matt" wrote:
> On 2023/10/12 22:02, Masami Hiramatsu (Google) wrote:
> > Hi Wuqiang,
> >
> > On Mon, 9 Oct 2023 17:23:34 +0800
> > wuqiang wrote:
> >
> >> Hello Masami,
> >>
> >>
try_cmpxchg_acquire(>tail, , next)
>WRITE_ONCE(slot->entries[tail & slot->mask], obj)
> return slot->entries[head & slot->mask]
>
>
> Regards,
> wuqiang
>
> On 2023/9/25 17:42, Masami Hiramatsu (Google) wrote:
> &
From: Masami Hiramatsu (Google)
Move the BTF APIs used in tracing to the BTF library code for sharing it
with others.
Previously, to avoid complex dependency in a series I made it on the
tracing tree, but now it is a good time to move it to BPF tree because
these functions are pure BTF functions
> >
> > > Hi all, can someone provide comments on this change.
> >
> > Hi all, can someone please review this change. It has
> > been not
> > reviewed for quite some time.
>
> That's because trivial typos in comments are considered very low priority,
> and are usually only added (if they are ever added) if the maintainer has
> extra time, which may not be for a while.
Anyway, let me pick this. I found this in my inbox now. :)
Thank you,
>
> -- Steve
--
Masami Hiramatsu (Google)
Hi,
On Mon, 9 Oct 2023 02:40:53 +0800
wuqiang wrote:
> On 2023/9/23 17:48, Masami Hiramatsu (Google) wrote:
> > Hi Wuqiang,
> >
> > Sorry for replying later.
> >
> > On Tue, 5 Sep 2023 09:52:51 +0800
> > "wuqiang.matt" wrote:
> >
&
_ONCE(slot->entries[tail & slot->mask], obj)
> return slot->entries[head & slot->mask]
>
>
> Regards,
> wuqiang
>
> On 2023/9/25 17:42, Masami Hiramatsu (Google) wrote:
> > Hi Wuqiang,
> >
> > On Tue, 5 S
On Mon, 9 Oct 2023 02:31:34 +0800
wuqiang wrote:
> On 2023/10/7 10:02, Masami Hiramatsu (Google) wrote:
> > On Tue, 5 Sep 2023 09:52:53 +0800
> > "wuqiang.matt" wrote:
> >
> >> kretprobe is using freelist to manage return-instances, but freelist,
> &
On Mon, 9 Oct 2023 02:33:09 +0800
wuqiang wrote:
> On 2023/9/23 16:57, Masami Hiramatsu (Google) wrote:
> > Hi Wuqiang,
> >
> > I dug my mail box and found this. Sorry for replying late.
> >
> > On Tue, 5 Sep 2023 09:52:50 +0800
> > "wuqia
On Tue, 3 Oct 2023 18:40:59 -0400
Steven Rostedt wrote:
> From: "Steven Rostedt (Google)"
>
> Instead of having a descriptor for every file represented in the eventfs
> directory, only have the directory itself represented. Change the API to
> send in a list of e
gt; objpool: 334605663 448310646 675018951 903449904 1339693418
>
This looks good to me (and I have tested with updated objpool)
Acked-by: Masami Hiramatsu (Google)
Wuqiang, can you update the above number with the simplified
objpool? I got better number (always 80% of the native
fix this by implementing arch_syscall_match_sym_name() which allows us
> to ignore this prefix.
>
> And also ignore compat syscalls like x86/arm64 by implementing
> arch_trace_is_compat_syscall().
>
Looks good to me,
Acked-by: Masami Hiramatsu (Google)
Thank you,
> Fixes: 08d0ce30e0e4 (&q
On Sat, 30 Sep 2023 18:14:35 +0900
Masami Hiramatsu (Google) wrote:
> On Fri, 29 Sep 2023 17:12:07 -0700
> Alexei Starovoitov wrote:
>
> > On Thu, Sep 28, 2023 at 6:21 PM Masami Hiramatsu
> > wrote:
> > >
> > >
> > > Thus, what I need is to m
From: Masami Hiramatsu (Google)
Since ftrace_func_t requires to pass 'struct ftrace_regs *' as the 4th
argument even if FTRACE_OPS_FL_SAVE_REGS is not set, ftrace_caller must
pass 'struct ftrace_regs *', which is a partial pt_regs, on the stack
to the ftrace_func_t functions, so
On Sat, 30 Sep 2023 09:01:06 -0400
Steven Rostedt wrote:
> From: "Steven Rostedt (Google)"
>
> The dcache_dir_open_wrapper() could be called when a dynamic event is
> being deleted leaving a dentry with no children. In this case the
> dlist->dentries array will ne
Good catch! This looks good to me.
> >
> > Acked-by: Masami Hiramatsu (Google)
> >
> > And
> >
> > Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
>
> Thanks. I didn't include that because it's not a bug. But it does
*)
https://lore.kernel.org/all/20230905015255.81545-1-wuqiang.m...@bytedance.com/
Thank you,
--
Masami Hiramatsu (Google)
On Thu, 28 Sep 2023 12:43:34 +0200
Julia Lawall wrote:
> Drop break after return.
>
Good catch! This looks good to me.
Acked-by: Masami Hiramatsu (Google)
And
Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
> Signed-off-by: Julia Lawall
>
d: {str(e)}")
> +raise SystemExit("Script terminated due to an error")
> diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> index a432b171be82..c110b0f58a19 100755
> --- a/scripts/link-vmlinux.sh
> +++ b/scripts/link-vmlinux.sh
> @@ -91,7 +91,12 @@ vmlinux_link()
>
> # The kallsyms linking does not need debug symbols included.
> if [ "$output" != "${output#.tmp_vmlinux.kallsyms}" ] ; then
> - ldflags="${ldflags} ${wl}--strip-debug"
> + # The kallsyms linking does not need debug symbols included,
> + # unless the KALLSYMS_ALIAS_SRCLINE.
> + if ! is_enabled CONFIG_KALLSYMS_ALIAS_SRCLINE && \
> +[ "$output" != "${output#.tmp_vmlinux.kallsyms}" ] ; then
> + ldflags="${ldflags} ${wl}--strip-debug"
> + fi
> fi
>
> if is_enabled CONFIG_VMLINUX_MAP; then
> @@ -161,7 +166,19 @@ kallsyms()
> fi
>
> info KSYMS ${2}
> - scripts/kallsyms ${kallsymopt} ${1} > ${2}
> + ALIAS=""
> + KAS_DATA=""
> + if is_enabled CONFIG_KALLSYMS_ALIAS_SRCLINE_DATA; then
> + KAS_DATA="--data"
> + fi
> + if is_enabled CONFIG_KALLSYMS_ALIAS_SRCLINE; then
> + ALIAS=".alias"
> + ${srctree}/scripts/kas_alias.py \
> + --addr2line ${ADDR2LINE} --vmlinux ${kallsyms_vmlinux} \
> + --nmdata ${1} --outfile ${1}${ALIAS} \
> + --basedir ${srctree} --separator @ ${KAS_DATA}
> + fi
> + scripts/kallsyms ${kallsymopt} ${1}${ALIAS} > ${2}
> }
>
> # Perform one step in kallsyms generation, including temporary linking of
> --
> 2.34.1
>
--
Masami Hiramatsu (Google)
erf pt_regs.
> - Update fprobe-events to use ftrace_regs natively.
> - Update bpf multi-kprobe handler use ftrace_partial_regs().
And need to add patches
- Introduce a generized function exit hook interface for ftrace.
- Replace rethook in fprobe with the function exit hook interface.
On Tue, 26 Sep 2023 00:14:33 +0200
Jiri Olsa wrote:
> On Mon, Sep 25, 2023 at 09:15:15PM +0900, Masami Hiramatsu wrote:
> > Hi Jiri,
> >
> > On Mon, 25 Sep 2023 12:41:59 +0200
> > Jiri Olsa wrote:
> >
> > > On Sun, Sep 24, 2023 at 10:36:3
Hi Jiri,
On Mon, 25 Sep 2023 12:41:59 +0200
Jiri Olsa wrote:
> On Sun, Sep 24, 2023 at 10:36:36PM +0900, Masami Hiramatsu (Google) wrote:
> > From: Masami Hiramatsu (Google)
> >
> > This allows fprobes to be available with CONFIG_DYNAMIC_FTRACE_
248miss:
0async & hrtimer: percpu objpool from vmalloc
Can you test it too?
Thanks,
>From f1f442ff653e329839e5452b8b88463a80a12ff3 Mon Sep 17 00:00:00 2001
From: "Masami Hiramatsu (Google)"
Date: Mon, 25 Sep 2023 16:07:12 +0900
Subject: [PATCH] objpool: S
t; +
> + return -EAGAIN;
> +}
> +EXPORT_SYMBOL_GPL(objpool_drop);
To make this work correctly, you need to disable the objpool (no more
pop the object from it) and ensure the objpool is disabled.
Also, when disabling the objpool, its refcount must be set to the "active"
number of objects.
Thank you,
--
Masami Hiramatsu (Google)
On Wed, 20 Sep 2023 22:15:37 -0400
Steven Rostedt wrote:
> From: "Steven Rostedt (Google)"
>
> Using the following code with libtracefs:
>
> int dfd;
>
> // create the directory events/kprobes/kp1
> tracefs_kprobe_raw(NULL, &quo
From: Masami Hiramatsu (Google)
Add a note about the argument and return value accecss will be best
effort. Depending on the type, it will be passed via stack or a
pair of the registers, but $argN and $retval only support the
single register access.
Suggested-by: Alexei Starovoitov
Signed-off
From: Masami Hiramatsu (Google)
Update fprobe document so that the entry/exit handler uses ftrace_regs
instead of pt_regs.
Signed-off-by: Masami Hiramatsu (Google)
Acked-by: Florent Revest
---
Documentation/trace/fprobe.rst | 14 ++
1 file changed, 6 insertions(+), 8 deletions
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
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
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
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
From: Masami Hiramatsu (Google)
Change the fprobe exit handler and rethook 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. Only
701 - 800 of 1394 matches
Mail list logo