Re: [PATCH] ftrace/selftest: Test combination of function_graph tracer and function profiler

2024-08-25 Thread Google
looks good to me, but note that this depends on the above fix, unless that, this may crash the kernel. I think the above fix should be merged in v6.11-rcX so this may be safe for released kernel. Thanks, > > Signed-off-by: Steven Rostedt (Google) > --- > .../ftrace/test.d/ftrace/fgr

Re: [PATCH v2] selftests/ftrace: Skip test for optimized probes on PowerPC if Secure Boot is enabled

2024-08-25 Thread Google
s.tc > @@ -10,6 +10,11 @@ x86_64) > arm*) > ;; > ppc*) > + lsprop_output=$(lsprop /proc/device-tree/ibm,secure-boot) > + if echo "$lsprop_output" | grep -q "0002"; then > +echo "Secure Boot is enabled on PowerPC." > +exit_unsupported > + fi > ;; > *) >echo "Please implement other architecture here" > -- > 2.45.2 > -- Masami Hiramatsu (Google)

[PATCH v5 3/3] selftests/tracing: Add hist poll() support test

2024-08-18 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a testcase for poll() on hist file. This introduces a helper binary to the ftracetest, because there is no good way to reliably execute poll() on hist file. Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Shuah Khan --- Changes in v5: - Update

[PATCH v5 2/3] tracing/hist: Support POLLPRI event for poll on histogram

2024-08-18 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since POLLIN will not be flashed until read the hist file, user needs to repeat read() and poll() on hist for monitoring the event continuously. But the read() is somewhat redundant only for monitoring events. This add POLLPRI poll event on hist, this event

[PATCH v5 1/3] tracing/hist: Add poll(POLLIN) support on hist file

2024-08-18 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add poll syscall support on the `hist` file. The Waiter will be waken up when the histogram is updated with POLLIN. Currently, there is no way to wait for a specific event in userspace. So user needs to peek the `trace` periodicaly, or wait on `trace_pipe`. But

[PATCH v5 0/3] tracing: Support poll on event hist file

2024-08-18 Thread Masami Hiramatsu (Google)
or update poll pri $EVENT/hist # Event arrived. echo "process free event is comming" tail $TRACEFS/trace The 'poll' command is in the selftest patch. You can take this series also from here; https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/log/?h=topic/eve

Re: [PATCH v4 3/3] selftests/tracing: Add hist poll() support test

2024-08-18 Thread Google
On Sun, 18 Aug 2024 00:06:20 +0900 Masami Hiramatsu (Google) wrote: > On Fri, 16 Aug 2024 08:04:41 -0600 > Shuah Khan wrote: > > > On 8/15/24 20:31, Masami Hiramatsu (Google) wrote: > > > From: Masami Hiramatsu (Google) > > > > > > Add a testcase

Re: [PATCH v4 3/3] selftests/tracing: Add hist poll() support test

2024-08-17 Thread Google
On Fri, 16 Aug 2024 08:04:41 -0600 Shuah Khan wrote: > On 8/15/24 20:31, Masami Hiramatsu (Google) wrote: > > From: Masami Hiramatsu (Google) > > > > Add a testcase for poll() on hist file. This introduces a helper binary > > to the ftracetest, because there is no g

[PATCH v4 3/3] selftests/tracing: Add hist poll() support test

2024-08-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a testcase for poll() on hist file. This introduces a helper binary to the ftracetest, because there is no good way to reliably execute poll() on hist file. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v4: - Use getopt() in poll.c (command

[PATCH v4 2/3] tracing/hist: Support POLLPRI event for poll on histogram

2024-08-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since POLLIN will not be flashed until read the hist file, user needs to repeat read() and poll() on hist for monitoring the event continuously. But the read() is somewhat redundant only for monitoring events. This add POLLPRI poll event on hist, this event

[PATCH v4 1/3] tracing/hist: Add poll(POLLIN) support on hist file

2024-08-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add poll syscall support on the `hist` file. The Waiter will be waken up when the histogram is updated with POLLIN. Currently, there is no way to wait for a specific event in userspace. So user needs to peek the `trace` periodicaly, or wait on `trace_pipe`. But

[PATCH v4 0/3] tracing: Support poll on event hist file

2024-08-15 Thread Masami Hiramatsu (Google)
/mhiramat/linux.git/log/?h=topic/event-hist-poll Thank you, --- Masami Hiramatsu (Google) (3): tracing/hist: Add poll(POLLIN) support on hist file tracing/hist: Support POLLPRI event for poll on histogram selftests/tracing: Add hist poll() support test include/linux/

Re: [PATCH v3 3/3] selftests/tracing: Add hist poll() support test

2024-08-14 Thread Google
On Wed, 14 Aug 2024 05:38:24 -0600 Shuah Khan wrote: > On 8/13/24 18:11, Masami Hiramatsu (Google) wrote: > > From: Masami Hiramatsu (Google) > > > > Add a testcase for poll() on hist file. This introduces a helper binary > > to the ftracetest, because there is no g

Re: [PATCH] selftests/ftrace: Add required dependency for kprobe tests

2024-08-14 Thread Google
On Wed, 14 Aug 2024 05:43:29 -0600 Shuah Khan wrote: > On 8/13/24 18:53, Masami Hiramatsu (Google) wrote: > > Hi Shuah, > > > > Can you pick this? I confirmed this can be applied on v6.11-rc3. > > > > > > > > On Thu, 13 Jun 2024 07:12:10

Re: [PATCH] selftests/ftrace: Add required dependency for kprobe tests

2024-08-13 Thread Google
Hi Shuah, Can you pick this? I confirmed this can be applied on v6.11-rc3. On Thu, 13 Jun 2024 07:12:10 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > kprobe_args_{char,string}.tc are using available_filter_functions file > which i

[PATCH v3 3/3] selftests/tracing: Add hist poll() support test

2024-08-13 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a testcase for poll() on hist file. This introduces a helper binary to the ftracetest, because there is no good way to reliably execute poll() on hist file. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Update poll command to support both

[PATCH v3 2/3] tracing/hist: Support POLLPRI event for poll on histogram

2024-08-13 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since POLLIN will not be flashed until read the hist file, user needs to repeat read() and poll() on hist for monitoring the event continuously. But the read() is somewhat redundant only for monitoring events. This add POLLPRI poll event on hist, this event

[PATCH v3 1/3] tracing/hist: Add poll(POLLIN) support on hist file

2024-08-13 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add poll syscall support on the `hist` file. The Waiter will be waken up when the histogram is updated with POLLIN. Currently, there is no way to wait for a specific event in userspace. So user needs to peek the `trace` periodicaly, or wait on `trace_pipe`. But

[PATCH v3 0/3] tracing: Support poll on event hist file

2024-08-13 Thread Masami Hiramatsu (Google)
rived. echo "process free event is comming" tail $TRACEFS/trace The 'poll' command is in the selftest patch. You can take this series also from here; https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/log/?h=topic/event-hist-poll Thank you, --- Masam

Re: [PATCH] lib: Move KUnit tests into tests/ subdirectory

2024-07-22 Thread Google
ooks good to me. Acked-by: Masami Hiramatsu (Google) For kprobes and fprobe tests. BTW, should we also rename the file from tests/test_foo.c to tests/foo_kunit.c ? Thank you, > --- > I can carry this in the hardening tree. To disrupt people as little as > possible, I'm hoping to s

[PATCH v2 3/3] selftests/tracing: Add hist poll() support test

2024-07-02 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a testcase for poll() on hist file. This introduces a helper binary to the ftracetest, because there is no good way to reliably execute poll() on hist file. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Update poll command to support both

[PATCH v2 2/3] tracing/hist: Support POLLPRI event for poll on histogram

2024-07-02 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since POLLIN will not be flashed until read the hist file, user needs to repeat read() and poll() on hist for monitoring the event continuously. But the read() is somewhat redundant only for monitoring events. This add POLLPRI poll event on hist, this event

[PATCH v2 1/3] tracing/hist: Add poll(POLLIN) support on hist file

2024-07-02 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add poll syscall support on the `hist` file. The Waiter will be waken up when the histogram is updated with POLLIN. Currently, there is no way to wait for a specific event in userspace. So user needs to peek the `trace` periodicaly, or wait on `trace_pipe`. But

[PATCH v2 0/3] tracing: Support poll on event hist file

2024-07-02 Thread Masami Hiramatsu (Google)
$EVENT/hist # Event arrived. echo "process free event is comming" tail $TRACEFS/trace The 'poll' command is in the selftest patch. You can take this series also from here; https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/log/?h=topic/event-hist-poll Thank y

Re: [RFC PATCH 0/3] tracing: Support poll on event hist file

2024-07-02 Thread Google
On Sun, 30 Jun 2024 16:07:43 -0500 Tom Zanussi wrote: > Hi Masami, > > On Wed, 2024-06-26 at 00:16 +0900, Masami Hiramatsu (Google) wrote: > > Hi, > > > > Here is an RFC patch to support polling on event 'hist' file. > > > > There has been int

Re: selftests/ftrace kprobe_eventname test fails on s390x QEMU (KVM/Linux)

2024-06-27 Thread Google
/fork.c:2927 > (discriminator 1)) > __do_sys_clone (/build/linux-3nCxw2/linux-6.8.0/kernel/fork.c:3055) > __s390x_sys_clone (/build/linux-3nCxw2/linux-6.8.0/kernel/fork.c:3027) > __do_syscall > (/build/linux-3nCxw2/linux-6.8.0/arch/s390/include/asm/ptrace.h:195 > (discriminator 3) > /build/linux-3nCxw2/linux-6.8.0/arch/s390/include/asm/ptrace.h:200 > (discriminator 3) > /build/linux-3nCxw2/linux-6.8.0/arch/s390/kernel/syscall.c:145 > (discriminator 3) > /build/linux-3nCxw2/linux-6.8.0/arch/s390/kernel/syscall.c:168 > (discriminator 3)) > system_call (/build/linux-3nCxw2/linux-6.8.0/arch/s390/kernel/entry.S:309) > Last Breaking-Event-Address: > 0x4404c00180 > > > It's not easy for me to resolve this issue. If advice or guidance can be > provided on how to resolve this issue, I'll try sending a patch! > > > Warm regards, > Yunseong Kim > -- Masami Hiramatsu (Google)

[RFC PATCH 3/3] selftests/tracing: Add hist poll() support test

2024-06-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a testcase for poll() on hist file. This introduces a helper binary to the ftracetest, because there is no good way to reliably execute poll() on hist file. Signed-off-by: Masami Hiramatsu (Google) --- tools/testing/selftests/ftrace/Makefile

[RFC PATCH 2/3] tracing/hist: Support POLLPRI event for poll on histogram

2024-06-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since POLLIN will not be flashed until read the hist file, user needs to repeat read() and poll() on hist for monitoring the event continuously. But the read() is somewhat redundant only for monitoring events. This add POLLPRI poll event on hist, this event

[RFC PATCH 1/3] tracing/hist: Add poll(POLLIN) support on hist file

2024-06-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add poll syscall support on the `hist` file. The Waiter will be waken up when the histogram is updated with POLLIN. Currently, there is no way to wait for a specific event in userspace. So user needs to peek the `trace` periodicaly, or wait on `trace_pipe`. But

[RFC PATCH 0/3] tracing: Support poll on event hist file

2024-06-25 Thread Masami Hiramatsu (Google)
/kernel/git/mhiramat/linux.git/log/?h=topic/event-hist-poll Thank you, --- Masami Hiramatsu (Google) (3): tracing/hist: Add poll(POLLIN) support on hist file tracing/hist: Support POLLPRI event for poll on histogram selftests/tracing: Add hist poll() support test include/linux

[PATCH] selftests/ftrace: Add required dependency for kprobe tests

2024-06-12 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) kprobe_args_{char,string}.tc are using available_filter_functions file which is provided by function tracer. Thus if function tracer is disabled, these tests are failed on recent kernels because tracefs_create_dir is not raised events by adding a dynamic event

Re: [PATCH 2/2] selftests/tracing: Fix to check the required syscall event

2024-05-31 Thread Google
On Fri, 31 May 2024 08:41:00 -0600 Shuah Khan wrote: > On 5/31/24 03:43, Masami Hiramatsu (Google) wrote: > > From: Masami Hiramatsu (Google) > > > > Since test_duplicates.tc depends on syscalls/sys_enter_openat event, > > it must add the event file to `requires`

[PATCH 2/2] selftests/tracing: Fix to check the required syscall event

2024-05-31 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since test_duplicates.tc depends on syscalls/sys_enter_openat event, it must add the event file to `requires`. Without this fix, the test fails if CONFIG_FTRACE_SYSCALLS=n. Fixes: 297e1dcdca3d ("selftests/ftrace: Add selftest for testing duplicate eprobe

[PATCH 1/2] selftests/tracing: Fix event filter test to retry up to 10 times

2024-05-31 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Commit eb50d0f250e9 ("selftests/ftrace: Choose target function for filter test from samples") choose the target function from samples, but sometimes this test failes randomly because the target function does not hit at the next time. So retry getting sam

[PATCH 0/2] selftests/tracing: Fix ftracetest testcase issues

2024-05-31 Thread Masami Hiramatsu (Google)
Here is a couple of patches to fix issues related to runing environment and kernel configuration. Thank you, --- Masami Hiramatsu (Google) (2): selftests/tracing: Fix event filter test to retry up to 10 times selftests/tracing: Fix to check the required syscall event .../ftrace

[PATCH] selftests/uprobes: Add a basic uprobe testcase

2024-05-23 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a basic uprobe testcase which checks whether add/remove/trace operations works on /bin/sh. Signed-off-by: Masami Hiramatsu (Google) --- .../ftrace/test.d/dynevent/add_remove_uprobe.tc| 26 1 file changed, 26 insertions(+) create

Re: [PATCH] tracing/selftests: Run the ownership test twice

2024-05-23 Thread Google
On Thu, 23 May 2024 12:45:41 -0400 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > A regression happened where running the ownership test passes on the first > iteration but fails running it a second time. This was caught and fixed, > but a later ch

Re: [PATCH] tracing/selftests: Fix kprobe event name test for .isra. functions

2024-05-20 Thread Google
On Mon, 20 May 2024 20:57:37 -0400 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > The kprobe_eventname.tc test checks if a function with .isra. can have a > kprobe attached to it. It loops through the kallsyms file for all the > functions that have the .

[PATCH 2/2] selftests/ftrace: Update required config

2024-05-20 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Update required config options for running all tests. This also sorts the config entries alphabetically. Signed-off-by: Masami Hiramatsu (Google) --- tools/testing/selftests/ftrace/config | 26 +++--- 1 file changed, 19 insertions(+), 7

[PATCH 1/2] selftests/ftrace: Fix to check required event file

2024-05-20 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) The dynevent/test_duplicates.tc test case uses `syscalls/sys_enter_openat` event for defining eprobe on it. Since this `syscalls` events depend on CONFIG_FTRACE_SYSCALLS=y, if it is not set, the test will fail. Add the event file to `required` line so that the

[PATCH 0/2] selftests/ftrace: Fix config related issues

2024-05-20 Thread Masami Hiramatsu (Google)
Here is a couple of patches to fix some issues related to kconfig. I found these issues when I built the kernel with tools/testing/selftests/ftrace/config. Thank you, --- Masami Hiramatsu (Google) (2): selftests/ftrace: Fix to check required event file selftests/ftrace: Update

[PATCH for-next] selftests/ftrace: Fix required features for VFS type test case

2024-05-03 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since the VFS type argument test case uses fprobe events, it must check the availablity of dynamic_events file and fprobe events syntax in README. Without this fix, the test fails if CONFIG_FPROBE_EVENTS=n. Fixes: ee97e5e135c6 ("selftests/ftrace: add fprobe

[PATCH 2/2] selftests/ftrace: Fix checkbashisms errors

2024-05-03 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Fix the below checkbashisms errors. Because of these errors, these tests will fail on dash shell. possible bashism in test.d/kprobe/kretprobe_entry_arg.tc line 14 ('function' is useless): function streq() { possible bashism in test.d/dynevent/fprobe_en

[PATCH 1/2] selftests/ftrace: Fix BTFARG testcase to check fprobe is enabled correctly

2024-05-03 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since the dynevent/add_remove_btfarg.tc test case forgets to ensure that fprobe is enabled for some structure field access tests which uses the fprobe, it fails if CONFIG_FPROBE=n or CONFIG_FPROBE_EVENTS=n. Fixes it to ensure the fprobe events are supported

[PATCH 0/2] selftests/ftrace: Fix some errors

2024-05-03 Thread Masami Hiramatsu (Google)
Here is a couple of patches for fixing errors on ftracetest. Shuah, can you pick these to your fixes branch? Or I also can push it. Thank you, --- Masami Hiramatsu (Google) (2): selftests/ftrace: Fix BTFARG testcase to check fprobe is enabled correctly selftests/ftrace: Fix

Re: [PATCH 0/2] tracing/selftests: Verbosity improvements to KTAP output

2024-04-06 Thread Google
On Thu, 4 Apr 2024 10:32:33 -0600 Shuah Khan wrote: > On 3/26/24 13:11, Shuah Khan wrote: > > On 3/26/24 10:08, Steven Rostedt wrote: > >> > >> Shuah, > >> > >> If Masami is OK with this, can you take this through your tree? > >> >

Re: [PATCH] selftests/ftrace: Fix event filter target_func selection

2024-03-20 Thread Google
#x27; command will leave this unchanged. Consequently, the test will > decide to use 'kmem_cache_free' as the filter function, resulting in the > failure seen above. > > Fix this by matching the 'call_site=' part specifically to extract > the function name. > L

[PATCH v2 08/15] selftests/sched: Migrate cs_prctl_test to kselfttest

2024-03-12 Thread Joel Fernandes (Google)
This test begs to be a kselftest, is in the kselftest hierarchy and does not even use a single kselftest API. Convert it. It simplifies some of the code and the output also looks much nicer now: Totals: pass:17 fail:0 xfail:0 xpass:0 skip:0 error:0 Signed-off-by: Joel Fernandes (Google

[PATCH v2 07/15] selftests/sched: Add a test to verify that DL server works with core scheduling

2024-03-12 Thread Joel Fernandes (Google)
9 seconds. We expect the CFS task (PID 7) to get ~50% of the 9 seconds. The DL server is configured for 50% bandwidth. The RT tasks (PID 98, 99) each get 50% as well, because they run concurrently on 2 hyperthreads of a core. Signed-off-by: Joel Fernandes (Google) --- tools/testing/selft

[PATCH v3 8/8] Documentation: tracing: Add entry argument access at function exit

2024-03-03 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a notes about the entry argument access at function exit probes for kprobes and fprobe trace event. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v3: - Add usage example in fprobetrace.rst. --- Documentation/trace/fprobetrace.rst | 31

[PATCH v3 7/8] selftests/ftrace: Add test cases for entry args at function exit

2024-03-03 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add kretprobe and function exit probe test cases for checking whether those can access entry arguments at function exit correctly. Signed-off-by: Masami Hiramatsu (Google) --- .../ftrace/test.d/dynevent/fprobe_entry_arg.tc | 18

[PATCH v3 6/8] tracing/probes: Support $argN in return probe (kprobe and fprobe)

2024-03-03 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Support accessing $argN in the return probe events. This will help users to record entry data in function return (exit) event for simplfing the function entry/exit information in one event, and record the result values (e.g. allocated object/initialized object) at

[PATCH v3 5/8] tracing: Remove redundant #else block for BTF args from README

2024-03-03 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Remove redundant #else block for BTF args from README message. This is a cleanup, so no change on the message. Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) --- kernel/trace/trace.c |4 +--- 1 file changed, 1 insertion(+), 3

[PATCH v3 4/8] tracing/probes: cleanup: Set trace_probe::nr_args at trace_probe_init

2024-03-03 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Instead of incrementing the trace_probe::nr_args, init it at trace_probe_init(). Without this change, there is no way to get the number of trace_probe arguments while parsing it. This is a cleanup, so the behavior is not changed. Signed-off-by: Masami Hiramatsu

[PATCH v3 3/8] tracing/probes: Cleanup probe argument parser

2024-03-03 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Cleanup traceprobe_parse_probe_arg_body() to split out the type parser and post-processing part of fetch_insn. This makes no functional change. Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) --- kernel/trace/trace_probe.c | 230

[PATCH v3 2/8] tracing/fprobe-event: cleanup: Fix a wrong comment in fprobe event

2024-03-03 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Despite the fprobe event, "Kretprobe" was commented. So fix it. Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) --- kernel/trace/trace_fprobe.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ke

[PATCH v3 1/8] fprobe: Fix to allocate entry_data_size buffer with rethook instances

2024-03-03 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Fix to allocate fprobe::entry_data_size buffer with rethook instances. If fprobe doesn't allocate entry_data_size buffer for each rethook instance, fprobe entry handler can cause a buffer overrun when storing entry data in entry handler. Link:

[PATCH v3 0/8] tracing/probes: Support function parameter access from return probe

2024-03-03 Thread Masami Hiramatsu (Google)
4/0x3d0 <- vfs_open) mode=0xa800d inode=0x888004ada8d8 So as you can see those fields are initialized at exit. This series is based on v6.8-rc5 kernel or you can checkout from https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/log/?h=topic/entry-data Thank you, ---

Re: [PATCH v2 3/7] tracing/probes: cleanup: Set trace_probe::nr_args at trace_probe_init

2024-03-03 Thread Google
On Thu, 29 Feb 2024 22:37:53 -0500 Steven Rostedt wrote: > On Mon, 26 Feb 2024 12:58:23 +0900 > "Masami Hiramatsu (Google)" wrote: > > > From: Masami Hiramatsu (Google) > > > > Instead of incrementing the trace_probe::nr_args, init it at > > trace_

Re: [PATCH v2 0/7] tracing/probes: Support function parameter access from return probe

2024-03-03 Thread Google
On Thu, 29 Feb 2024 22:41:34 -0500 Steven Rostedt wrote: > On Thu, 29 Feb 2024 17:52:16 +0900 > Masami Hiramatsu (Google) wrote: > > > Lol, I haven't allocate the entry data size when initialize rethook. > > That's a bug. > > Please try below. > &g

Re: [PATCH v2 0/7] tracing/probes: Support function parameter access from return probe

2024-02-29 Thread Google
On Thu, 29 Feb 2024 16:13:20 +0900 Masami Hiramatsu (Google) wrote: > On Thu, 29 Feb 2024 15:38:55 +0900 > Masami Hiramatsu (Google) wrote: > > > Hmm, this seems arch_rethook_trampoline caused the issue. > > > > And curiously, it depends on the number of stored

Re: [PATCH v2 0/7] tracing/probes: Support function parameter access from return probe

2024-02-28 Thread Google
On Thu, 29 Feb 2024 15:38:55 +0900 Masami Hiramatsu (Google) wrote: > Hmm, this seems arch_rethook_trampoline caused the issue. > > And curiously, it depends on the number of stored data. > > OK: > /sys/kernel/tracing # echo 'f vfs_read%return $arg1 $arg2 $arg3'

Re: [PATCH v2 0/7] tracing/probes: Support function parameter access from return probe

2024-02-28 Thread Google
On Thu, 29 Feb 2024 14:51:39 +0900 Masami Hiramatsu (Google) wrote: > On Wed, 28 Feb 2024 17:23:34 +0100 > Jiri Olsa wrote: > > > On Mon, Feb 26, 2024 at 12:57:53PM +0900, Masami Hiramatsu (Google) wrote: > > > Hi, > > > > > > Here is version 2 serie

Re: [PATCH v2 0/7] tracing/probes: Support function parameter access from return probe

2024-02-28 Thread Google
On Wed, 28 Feb 2024 17:23:34 +0100 Jiri Olsa wrote: > On Mon, Feb 26, 2024 at 12:57:53PM +0900, Masami Hiramatsu (Google) wrote: > > Hi, > > > > Here is version 2 series of patches to support accessing function entry data > > from function *return* probes (includin

Re: [PATCH v2] selftests/ftrace: Limit length in subsystem-enable tests

2024-02-25 Thread Google
the first 100 lines of output would be enough to judge whether > there are more than 3 types of sched events. Looks good to me. Acked-by: Masami Hiramatsu (Google) Hi Shuah, can you pick this as a fix? Thank you, > > Fixes: 815b18ea66d6 ("ftracetest: Add basic event tracing test

[PATCH v2 7/7] Documentation: tracing: Add entry argument access at function exit

2024-02-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a notes about the entry argument access at function exit probes for kprobes and fprobe trace event. Signed-off-by: Masami Hiramatsu (Google) --- Documentation/trace/fprobetrace.rst |7 +++ Documentation/trace/kprobetrace.rst |7 +++ 2 files

[PATCH v2 6/7] selftests/ftrace: Add test cases for entry args at function exit

2024-02-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add kretprobe and function exit probe test cases for checking whether those can access entry arguments at function exit correctly. Signed-off-by: Masami Hiramatsu (Google) --- .../ftrace/test.d/dynevent/fprobe_entry_arg.tc | 18

[PATCH v2 5/7] tracing/probes: Support $argN in return probe (kprobe and fprobe)

2024-02-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Support accessing $argN in the return probe events. This will help users to record entry data in function return (exit) event for simplfing the function entry/exit information in one event, and record the result values (e.g. allocated object/initialized object) at

[PATCH v2 4/7] tracing: Remove redundant #else block for BTF args from README

2024-02-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Remove redundant #else block for BTF args from README message. This is a cleanup, so no change on the message. Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/trace.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel

[PATCH v2 3/7] tracing/probes: cleanup: Set trace_probe::nr_args at trace_probe_init

2024-02-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Instead of incrementing the trace_probe::nr_args, init it at trace_probe_init(). This is a cleanup, so the behavior is not changed. Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/trace_eprobe.c |2 +- kernel/trace/trace_probe.c | 10

[PATCH v2 2/7] tracing/probes: Cleanup probe argument parser

2024-02-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Cleanup traceprobe_parse_probe_arg_body() to split out the type parser and post-processing part of fetch_insn. This makes no functional change. Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/trace_probe.c | 230

[PATCH v2 1/7] tracing/fprobe-event: cleanup: Fix a wrong comment in fprobe event

2024-02-25 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Despite the fprobe event, "Kretprobe" was commented. So fix it. Signed-off-by: Masami Hiramatsu (Google) --- kernel/trace/trace_fprobe.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_fprobe.c b/ke

[PATCH v2 0/7] tracing/probes: Support function parameter access from return probe

2024-02-25 Thread Masami Hiramatsu (Google)
g/?h=topic/entry-data Thank you, --- Masami Hiramatsu (Google) (7): tracing/fprobe-event: cleanup: Fix a wrong comment in fprobe event tracing/probes: Cleanup probe argument parser tracing/probes: cleanup: Set trace_probe::nr_args at trace_probe_init tracing: Remove redu

Re: [PATCH] selftests/ftrace: Limit length in subsystem-enable tests

2024-02-25 Thread Google
> It's not that it never stops but on some slower systems it does seem to > > take forever. > > > > Acked-by: Steven Rostedt (Google) > > > > Shuah, > > > > Can you take this through your tree? > > > > Thanks, > > > >

[PATCH 08/10] selftests/sched: Migrate cs_prctl_test to kselfttest

2024-02-16 Thread Joel Fernandes (Google)
This test begs to be a kselftest, is in the kselftest hierarchy and does not even use a single kselftest API. Convert it. It simplifies some of the code and the output also looks much nicer now: Totals: pass:17 fail:0 xfail:0 xpass:0 skip:0 error:0 Signed-off-by: Joel Fernandes (Google

[PATCH 07/10] selftests/sched: Add a test to verify that DL server works with core scheduling

2024-02-16 Thread Joel Fernandes (Google)
9 seconds. We expect the CFS task (PID 7) to get ~50% of the 9 seconds. The DL server is configured for 50% bandwidth. The RT tasks (PID 98, 99) each get 50% as well, because they run concurrently on 2 hyperthreads of a core. Signed-off-by: Joel Fernandes (Google) --- tools/testing/selft

Re: [PATCH] selftests: ftrace: fix typo in test report

2024-02-06 Thread Google
"# Totals:" >echo -n " pass:"`echo $PASSED_CASES | wc -w` > - echo -n " faii:"`echo $FAILED_CASES | wc -w` > + echo -n " fail:"`echo $FAILED_CASES | wc -w` >echo -n " xfail:"`echo $XFAILED_CASES | wc -w` >echo -n " xpass:0" >echo -n " skip:"`echo $UNTESTED_CASES $UNSUPPORTED_CASES | wc -w` > -- > 2.34.1 > -- Masami Hiramatsu (Google)

Re: [PATCH] selftests: ftrace: fix typo in test description

2024-01-31 Thread Google
e. Acked-by: Masami Hiramatsu (Google) > Signed-off-by: Ali Zahraee > --- > tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc >

Re: [PATCH] selftest/ftrace: fix typo in ftracetest script

2024-01-31 Thread Google
Hi, On Mon, 29 Jan 2024 21:58:07 +0530 Kousik Sanagavarapu wrote: > Fix a typo in ftracetest script which is run when running the kselftests > for ftrace. > > s/faii/fail > Thanks, this looks obvious typo. > Signed-off-by: Kousik Sanagavarapu Acked-by: Masami Hiramat

Re: [PATCH v11 5/5] ring-buffer/selftest: Add ring-buffer mapping test

2024-01-14 Thread Google
Hi Vincent, On Sat, 13 Jan 2024 22:39:46 +0900 Masami Hiramatsu (Google) wrote: > On Thu, 11 Jan 2024 16:17:12 + > Vincent Donnefort wrote: > > > This test maps a ring-buffer and validate the meta-page after reset and > > after emitting few events. > > > &

Re: [PATCH v11 5/5] ring-buffer/selftest: Add ring-buffer mapping test

2024-01-13 Thread Google
rt Looks good to me and tested. Reviewed-by: Masami Hiramatsu (Google) Tested-by: Masami Hiramatsu (Google) Thank you, > > diff --git a/tools/testing/selftests/ring-buffer/Makefile > b/tools/testing/selftests/ring-buffer/Makefile > new file mode 100644 > index ..

Re: [PATCH v2] tracing/selftests: Add ownership modification tests for eventfs

2023-12-21 Thread Google
On Thu, 21 Dec 2023 21:07:57 -0500 Steven Rostedt wrote: > On Fri, 22 Dec 2023 10:52:00 +0900 > Masami Hiramatsu (Google) wrote: > > > On Fri, 22 Dec 2023 10:48:41 +0900 > > Masami Hiramatsu (Google) wrote: > > > And I confirmed that this test passed on v6.5.13

Re: [PATCH v3] tracing/selftests: Add ownership modification tests for eventfs

2023-12-21 Thread Google
On Thu, 21 Dec 2023 21:12:29 -0500 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > As there were bugs found with the ownership of eventfs dynamic file > creation. Add a test to test it. > > It will remount tracefs with a different gid and check th

Re: [PATCH v2] tracing/selftests: Add ownership modification tests for eventfs

2023-12-21 Thread Google
On Fri, 22 Dec 2023 10:48:41 +0900 Masami Hiramatsu (Google) wrote: > On Thu, 21 Dec 2023 20:28:13 -0500 > Steven Rostedt wrote: > > > On Fri, 22 Dec 2023 10:21:48 +0900 > > Masami Hiramatsu (Google) wrote: > > > > > The testcase itself is OK but is

Re: [PATCH v2] tracing/selftests: Add ownership modification tests for eventfs

2023-12-21 Thread Google
On Thu, 21 Dec 2023 20:28:13 -0500 Steven Rostedt wrote: > On Fri, 22 Dec 2023 10:21:48 +0900 > Masami Hiramatsu (Google) wrote: > > > The testcase itself is OK but is there any way to identify the system > > supports eventfs or not? I ran this test on v6.5.13 for checki

Re: [PATCH v2] tracing/selftests: Add ownership modification tests for eventfs

2023-12-21 Thread Google
On Thu, 21 Dec 2023 20:28:13 -0500 Steven Rostedt wrote: > On Fri, 22 Dec 2023 10:21:48 +0900 > Masami Hiramatsu (Google) wrote: > > > The testcase itself is OK but is there any way to identify the system > > supports eventfs or not? I ran this test on v6.5.13 for checki

Re: [PATCH v2] tracing/selftests: Add ownership modification tests for eventfs

2023-12-21 Thread Google
Hi Steve, On Thu, 21 Dec 2023 19:45:16 -0500 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > As there were bugs found with the ownership of eventfs dynamic file > creation. Add a test to test it. > > It will remount tracefs with a different gid and

Re: [PATCH v4] tracing/selftests: Add test to test the trace_marker

2023-12-13 Thread Google
On Wed, 13 Dec 2023 11:15:27 -0500 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > Add a test that writes longs strings, some over the size of the sub buffer > and make sure that the entire content is there. This looks good to me. and tested. Acked-by: Ma

Re: [PATCH v2] selftests/ftrace: Add test to exercize function tracer across cpu hotplug

2023-12-13 Thread Google
ot;powerpc/ftrace: Fix stack teardown in ftrace_no_trace"). > Looks good to me. Acked-by: Masami Hiramatsu (Google) Thank you, > Signed-off-by: Naveen N Rao > --- > v2: Add a check for next available online cpu, as suggested by Masami. > > .../ftrace

Re: [PATCH] selftests/ftrace: Add test to exercize function tracer across cpu hotplug

2023-12-12 Thread Google
r > +echo 1 > tracing_on > +(echo 0 > /sys/devices/system/cpu/cpu1/online) > +(echo "forked"; sleep 1) > +(echo 1 > /sys/devices/system/cpu/cpu1/online) > +echo 0 > tracing_on > + > +: "Check CPU1 events are recorded" > +grep -q -e "\[001\]" trace > > base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86 > -- > 2.43.0 > -- Masami Hiramatsu (Google)

Re: [PATCH v2] tracing/selftests: Add test to test max subbuf size with trace_marker

2023-12-12 Thread Google
On Tue, 12 Dec 2023 15:16:32 -0500 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > Now that the trace_marker can write up to the max size of the sub buffer. > Add a test to see if it actually can happen. > > The README is updated to state that the trace

[PATCH] selftests/ftrace: Add test case for a symbol in a module without module name

2023-10-27 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a test case for probing on a symbol in a module without module name. When probing on a symbol in a module, ftrace accepts both the syntax that : and . Current test case only checks the former syntax. This adds a test for the latter one. Signed-off-by: Masami

Re: [FIX PATCH v2] selftests: tracing: Fix to unmount tracefs for recovering environment

2023-09-12 Thread Google
On Tue, 12 Sep 2023 09:35:58 -0600 Shuah Khan wrote: > On 9/11/23 19:24, Steven Rostedt wrote: > > On Tue, 12 Sep 2023 10:10:39 +0900 > > "Masami Hiramatsu (Google)" wrote: > > > >> From: Masami Hiramatsu (Google) > >> > >> F

[FIX PATCH v2] selftests: tracing: Fix to unmount tracefs for recovering environment

2023-09-11 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Fix to unmount the tracefs if the ftracetest mounted it for recovering system environment. If the tracefs is already mounted, this does nothing. Suggested-by: Mark Brown Link: https://lore.kernel.org/all/29fce076-746c-4650-8358-b4e0fa215...@sirena.org.uk/ Fixes

Re: [FIX PATCH] selftests: tracing: Fix to unmount tracefs for recovering environment

2023-09-11 Thread Google
On Mon, 11 Sep 2023 13:09:09 -0400 Steven Rostedt wrote: > On Sat, 9 Sep 2023 18:36:39 +0900 > "Masami Hiramatsu (Google)" wrote: > > > From: Masami Hiramatsu (Google) > > > > Fix to unmount the tracefs if the ftracetest mounted it for recovering >