[PATCH 2/3] tracing: Remove orphaned function using_ftrace_ops_list_func().

2018-07-26 Thread Masami Hiramatsu
("tracing: Clean up stack tracing and fix fentry updates"). So it is not called anymore. Signed-off-by: Masami Hiramatsu --- 0 files changed diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index caf9cbf35816..b8b3324ca1c8 100644 --- a/kernel/trace/ftrace.c +++ b/k

[PATCH 3/3] tracing: Remove orphaned function ftrace_nr_registered_ops()

2018-07-26 Thread Masami Hiramatsu
lftest function recursion accounting"). So it is not called anymore. Signed-off-by: Masami Hiramatsu --- 0 files changed diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index ebb77674be90..63af5eb0ff46 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -234,10 +

[PATCH 00/25] selftests/ftrace: Improve ftracetest with coverage check

2018-07-27 Thread Masami Hiramatsu
owing testcase improvements are remaining. - Checking of various supported types (like u8, u64 etc.) testcases - Filter actions for ftrace testcases Thank you, --- Masami Hiramatsu (25): tracing: Allow gcov profiling on only ftrace subsystem selftests/ftrace: Add --stop-fail hidden o

[PATCH 01/25] tracing: Allow gcov profiling on only ftrace subsystem

2018-07-27 Thread Masami Hiramatsu
Add GCOV_PROFILE_FTRACE to allow gcov profiling on only files in ftrace subsystem. This kconfig flag will be used for checking kselftest/ftrace coverage. Signed-off-by: Masami Hiramatsu --- kernel/trace/Kconfig | 13 + kernel/trace/Makefile |5 + 2 files changed, 18

[PATCH 02/25] selftests/ftrace: Add --stop-fail hidden option for debug

2018-07-27 Thread Masami Hiramatsu
Add --stop-fail option for debugging the ftracetest. Signed-off-by: Masami Hiramatsu --- tools/testing/selftests/ftrace/ftracetest | 13 + 1 file changed, 13 insertions(+) diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest index

[PATCH 03/25] selftests/ftrace: Add --console hidden option

2018-07-27 Thread Masami Hiramatsu
Add --console hidden option for debug test cases. This option allows to put "sh" or something else when the test case hits a bug. Signed-off-by: Masami Hiramatsu --- tools/testing/selftests/ftrace/ftracetest | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) di

[PATCH 04/25] selftests/ftrace: Add case number prefix to logfile

2018-07-27 Thread Masami Hiramatsu
Add a case number prefix to each logfile. This makes it easier to find which logfile is corresponding to which failure. Signed-off-by: Masami Hiramatsu --- tools/testing/selftests/ftrace/ftracetest |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing

[PATCH 05/25] selftests/ftrace: More initialize features in initialize_ftrace

2018-07-27 Thread Masami Hiramatsu
Clear pid filter, synthetic_events, snapshots, and trace log in initialize_ftrace(), since those are used in test cases. Signed-off-by: Masami Hiramatsu --- tools/testing/selftests/ftrace/test.d/functions |4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/ftrace

[PATCH 06/25] selftests/ftrace: Cleanup ftrace after running test

2018-07-27 Thread Masami Hiramatsu
Cleanup ftrace by initialize_ftrace() after running all test cases. This means we also don't need cleanup ftrace on each test case, except for some special options. Signed-off-by: Masami Hiramatsu --- tools/testing/selftests/ftrace/ftracetest |1 + 1 file changed, 1 insertion(+) diff

[PATCH 07/25] selftests/ftrace: Remove unneeded per-test init/cleanup ftrace

2018-07-27 Thread Masami Hiramatsu
Since ftracetest framework calls initialize_ftrace() right before each test and after all tests, we don't need to init/cleanup ftrace for each test case. Just remove such unneeded init/cleanup code because it can increase logfile size. Signed-off-by: Masami Hiramatsu --- .../selftests/f

[PATCH 08/25] selftests/ftrace: Fix to test kprobe $comm arg only if available

2018-07-27 Thread Masami Hiramatsu
Test $comm in kprobe-event argument syntax testcase only if it is supported on the kernel because $comm has been introduced 4.8 kernel. So on older stable kernel, it should be skipped. Signed-off-by: Masami Hiramatsu --- .../ftrace/test.d/kprobe/kprobe_args_syntax.tc |3 +++ 1 file

[PATCH 09/25] selftests/ftrace: Fix checkbashisms errors

2018-07-27 Thread Masami Hiramatsu
Fix a test case to make checkbashisms clean. Signed-off-by: Masami Hiramatsu --- .../trigger/trigger-trace-marker-snapshot.tc |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-snapshot.tc b

[PATCH 10/25] selftests/ftrace: Use loopback address instead of localhost

2018-07-27 Thread Masami Hiramatsu
Use raw loopback address instead of localhost, because "localhost" can depend on nsswitch and in some case we can not resolve the localhost. Signed-off-by: Masami Hiramatsu --- .../selftests/ftrace/test.d/event/event-enable.tc |2 +- .../selftests/ftrace/test.d/event/ev

[PATCH 12/25] selftests/ftrace: Improve kprobe testcase to check log data

2018-07-27 Thread Masami Hiramatsu
Improve kprobe testcase to check the log data correctness and ensure the event definition is corrctly including argument definition. Signed-off-by: Masami Hiramatsu --- .../selftests/ftrace/test.d/kprobe/kprobe_args.tc |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a

[PATCH 11/25] selftests/ftrace: Improve kprobe on module testcase to load/unload module

2018-07-27 Thread Masami Hiramatsu
Improve kprobe events on module testcase to check module load/unload with disabled/enabled events. This also change the target module to trace_printk.ko, so it depends on CONFIG_SAMPLE_TRACE_PRINTK=m. Signed-off-by: Masami Hiramatsu --- tools/testing/selftests/ftrace/config |4

[PATCH 13/25] selftests/ftrace: Improve kretprobe testcase to check log data

2018-07-27 Thread Masami Hiramatsu
Improve kretprobe testcase to check the log data correctness and ensure the event definition is corrctly including argument definition. Signed-off-by: Masami Hiramatsu --- .../ftrace/test.d/kprobe/kretprobe_args.tc |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff

[PATCH 14/25] selftests/ftrace: Test kprobe-event argument with various bitsize

2018-07-27 Thread Masami Hiramatsu
Improve the kprobe-event with argument types testcase to test it with various bitsize. kprobe-event argument can be recorded in given types with various bitsize (8, 16, 32, 64), thus the type testcase should test the different bitsize too. Signed-off-by: Masami Hiramatsu --- .../ftrace/test.d

[PATCH 15/25] selftests/ftrace: Check set_event_pid result

2018-07-27 Thread Masami Hiramatsu
Ensure the set_event_pid shows set pid list. Signed-off-by: Masami Hiramatsu --- .../selftests/ftrace/test.d/event/event-pid.tc |1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/ftrace/test.d/event/event-pid.tc b/tools/testing/selftests/ftrace/test.d/event

[PATCH 16/25] selftests/ftrace: Add kprobe event with $comm argument testcase

2018-07-27 Thread Masami Hiramatsu
Add kprobe-event with $comm argument testcase to ftracetest. This not only checks syntax but also checks log file. Signed-off-by: Masami Hiramatsu --- .../ftrace/test.d/kprobe/kprobe_args_comm.tc | 17 + 1 file changed, 17 insertions(+) create mode 100644 tools/testing

[PATCH 17/25] selftests/ftrace: Add kprobe profile testcase

2018-07-27 Thread Masami Hiramatsu
Add a testcase for testing kprobe_profile interface which provides per-kprobe event hit/misshit counts. Signed-off-by: Masami Hiramatsu --- .../selftests/ftrace/test.d/kprobe/profile.tc | 15 +++ 1 file changed, 15 insertions(+) create mode 100644 tools/testing/selftests

[PATCH 18/25] selftests/ftrace: Add a testcase for nop tracer

2018-07-27 Thread Masami Hiramatsu
Add a testcase for nop tracer. This tracer has 2 test options, so check it too. Signed-off-by: Masami Hiramatsu --- .../testing/selftests/ftrace/test.d/tracer/nop.tc | 22 1 file changed, 22 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/tracer

[PATCH 19/25] selftests/ftrace: Add kprobe-event with symbol argument test

2018-07-27 Thread Masami Hiramatsu
Add a testcase for kprobe-event with @symbol argument. Since @symbol needs to refer the kernel data symbol (linux_proc_banner), it requires CONFIG_KALLSYMS_ALL. Signed-off-by: Masami Hiramatsu --- tools/testing/selftests/ftrace/config |1 + .../ftrace/test.d/kprobe

[PATCH 20/25] selftests/ftrace: Add trace_printk sample module test

2018-07-27 Thread Masami Hiramatsu
Add trace_printk sample module test. This requires to enable trace_printk.ko module for test. Signed-off-by: Masami Hiramatsu --- .../selftests/ftrace/test.d/event/trace_printk.tc | 27 1 file changed, 27 insertions(+) create mode 100644 tools/testing/selftests/ftrace

[PATCH 21/25] selftests/ftrace: Add ringbuffer size changing testcase

2018-07-27 Thread Masami Hiramatsu
Add a testcase for changing ringbuffer size. This tests not only ringbuffer size but also tests the imbalance per-cpu buffer size change too. Signed-off-by: Masami Hiramatsu --- .../ftrace/test.d/00basic/ringbuffer_size.tc | 21 1 file changed, 21 insertions

[PATCH 22/25] selftests/ftrace: Add function profiling stat testcase

2018-07-27 Thread Masami Hiramatsu
Add a testcase for function profiling per-cpu statistics interface. There is already func_profile.tc, but that is mainly focusing on the combination of function-profiler and function tracer. This testcase ensures trace_stat per-cpu function statistics is correctly updated. Signed-off-by: Masami

[PATCH 23/25] selftests/ftrace: Add max stack tracer testcase

2018-07-27 Thread Masami Hiramatsu
Add a testcase for max stack tracer, which checks basic max stack usage tracing and its filter feature. Signed-off-by: Masami Hiramatsu --- .../ftrace/test.d/ftrace/func_stack_tracer.tc | 39 1 file changed, 39 insertions(+) create mode 100644 tools/testing

[PATCH 25/25] selftests/ftrace: Add trace_pipe testcase

2018-07-27 Thread Masami Hiramatsu
Add a simple testcase for trace_pipe which can consume ringbuffer. Signed-off-by: Masami Hiramatsu --- .../selftests/ftrace/test.d/00basic/trace_pipe.tc | 15 +++ 1 file changed, 15 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/00basic/trace_pipe.tc

[PATCH 24/25] selftests/ftrace: Add function filter on module testcase

2018-07-27 Thread Masami Hiramatsu
Add a testcase for function filter on module. Signed-off-by: Masami Hiramatsu --- .../ftrace/test.d/ftrace/func_mod_trace.tc | 24 1 file changed, 24 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/func_mod_trace.tc diff --git a

Re: [PATCH v2 2/3] selftest/ftrace: Move kprobe selftest function to separate compile unit

2018-07-27 Thread Masami Hiramatsu
On Thu, 26 Jul 2018 19:29:43 -0400 Steven Rostedt wrote: > On Thu, 26 Jul 2018 14:53:55 +0900 > Masami Hiramatsu wrote: > > > From: Francis Deslauriers > > > > Move selftest function to its own compile unit so it can be compiled > > with the ftrace cflags (C

[PATCH v2.1 2/3] selftest/ftrace: Move kprobe selftest function to separate compile unit

2018-07-27 Thread Masami Hiramatsu
From: Francis Deslauriers Move selftest function to its own compile unit so it can be compiled with the ftrace cflags (CC_FLAGS_FTRACE) allowing it to be probed during the ftrace startup tests. Signed-off-by: Francis Deslauriers Signed-off-by: Masami Hiramatsu --- kernel/trace/Makefile

Re: [PATCH v2 3/3] selftests/ftrace: Fix kprobe string testcase to not probe notrace function

2018-07-27 Thread Masami Hiramatsu
On Thu, 26 Jul 2018 15:22:22 -0600 Shuah Khan wrote: > On 07/26/2018 01:58 PM, Steven Rostedt wrote: > > On Thu, 26 Jul 2018 16:44:09 +0900 > > Masami Hiramatsu wrote: > > > >> On Thu, 26 Jul 2018 14:54:23 +0900 > >> Masami Hiramatsu wrote: > >&

Re: [PATCH] tracing/kprobes: Simplify the logic of enable_trace_kprobe()

2018-07-27 Thread Masami Hiramatsu
e() > without looking at the code. > > Maybe call it __enable_trace_kprobe()? +1, I this this is better. With that function name change, Acked-by: Masami Hiramatsu Thanks! > > Otherwise it's a definite improvement. > > Reviewed-by: Josh Poimboeuf > > -- > Josh -- Masami Hiramatsu

Re: [PATCH v2 3/3] selftests/ftrace: Fix kprobe string testcase to not probe notrace function

2018-07-27 Thread Masami Hiramatsu
On Fri, 27 Jul 2018 17:43:07 -0400 Steven Rostedt wrote: > On Thu, 26 Jul 2018 14:54:23 +0900 > Masami Hiramatsu wrote: > > > Fix kprobe string argument testcase to not probe notrace > > function. Instead, it probes tracefs function which must > > be available

Re: [PATCH v2 1/3] tracing: kprobes: Prohibit probing on notrace function

2018-07-27 Thread Masami Hiramatsu
On Thu, 26 Jul 2018 14:53:27 +0900 Masami Hiramatsu wrote: > Prohibit kprobe-events probing on notrace function. > Since probing on the notrace function can cause recursive > event call. In most case those are just skipped, but > in some case it falls into infinit recursive cal

[PATCH v3 0/3] tracing: kprobes: Prohibit probing on notrace functions

2018-07-27 Thread Masami Hiramatsu
. Thank you, --- Francis Deslauriers (1): selftest/ftrace: Move kprobe selftest function to separate compile unit Masami Hiramatsu (2): tracing: kprobes: Prohibit probing on notrace function selftests/ftrace: Fix kprobe string testcase to not probe notrace function kernel/trace

[PATCH v3 2/3] selftest/ftrace: Move kprobe selftest function to separate compile unit

2018-07-27 Thread Masami Hiramatsu
From: Francis Deslauriers Move selftest function to its own compile unit so it can be compiled with the ftrace cflags (CC_FLAGS_FTRACE) allowing it to be probed during the ftrace startup tests. Signed-off-by: Francis Deslauriers Signed-off-by: Masami Hiramatsu --- kernel/trace/Makefile

[PATCH v3 1/3] tracing: kprobes: Prohibit probing on notrace function

2018-07-27 Thread Masami Hiramatsu
, but it is highly recommended to keep it "n" for normal kernel. Signed-off-by: Masami Hiramatsu Tested-by: Francis Deslauriers --- Changes in v2 - Add CONFIG_KPROBE_EVENTS_ON_NOTRACE kconfig for knocking down the protection. Changes in v3 - Fix to check raw-address (no sym

[PATCH v3 3/3] selftests/ftrace: Fix kprobe string testcase to not probe notrace function

2018-07-27 Thread Masami Hiramatsu
Fix kprobe string argument testcase to not probe notrace function. Instead, it probes tracefs function which must be available with ftrace. Signed-off-by: Masami Hiramatsu --- Changes in v3: - Fix probepoint testcase too. --- .../ftrace/test.d/kprobe/kprobe_args_string.tc | 30

Re: [PATCH v2 3/3] selftests/ftrace: Fix kprobe string testcase to not probe notrace function

2018-07-27 Thread Masami Hiramatsu
bounced it to you. > > -- Steve Sorry Shuah and Steve, I've fixed a problem in this patch. I've sent v3 patch to you. Thank you, -- Masami Hiramatsu

Re: [PATCH v2 1/3] tracing: kprobes: Prohibit probing on notrace function

2018-07-28 Thread Masami Hiramatsu
xt-20180727] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Masami-Hiramatsu/tracing-kprobes-Prohibit-probing-on-notrace-functions/20180728-145919 > config: x86_64-ra

[PATCH v4 0/3] tracing: kprobes: Prohibit probing on notrace functions

2018-07-28 Thread Masami Hiramatsu
Deslauriers (1): selftest/ftrace: Move kprobe selftest function to separate compile unit Masami Hiramatsu (2): tracing: kprobes: Prohibit probing on notrace function selftests/ftrace: Fix kprobe string testcase to not probe notrace function kernel/trace/Kconfig

[PATCH v4 1/3] tracing: kprobes: Prohibit probing on notrace function

2018-07-28 Thread Masami Hiramatsu
, but it is highly recommended to keep it "n" for normal kernel. Signed-off-by: Masami Hiramatsu Tested-by: Francis Deslauriers --- Changes in v2 - Add CONFIG_KPROBE_EVENTS_ON_NOTRACE kconfig for knocking down the protection. Changes in v3 - Fix to check raw-address (no sym

[PATCH v4 3/3] selftests/ftrace: Fix kprobe string testcase to not probe notrace function

2018-07-28 Thread Masami Hiramatsu
Fix kprobe string argument testcase to not probe notrace function. Instead, it probes tracefs function which must be available with ftrace. Signed-off-by: Masami Hiramatsu --- Changes in v3: - Fix probepoint testcase too. --- .../ftrace/test.d/kprobe/kprobe_args_string.tc | 30

[PATCH v4 2/3] selftest/ftrace: Move kprobe selftest function to separate compile unit

2018-07-28 Thread Masami Hiramatsu
From: Francis Deslauriers Move selftest function to its own compile unit so it can be compiled with the ftrace cflags (CC_FLAGS_FTRACE) allowing it to be probed during the ftrace startup tests. Signed-off-by: Francis Deslauriers Signed-off-by: Masami Hiramatsu --- kernel/trace/Makefile

Re: [PATCH v4 1/3] tracing: kprobes: Prohibit probing on notrace function

2018-07-30 Thread Masami Hiramatsu
On Sat, 28 Jul 2018 22:55:27 +0900 Masami Hiramatsu wrote: > Prohibit kprobe-events probing on notrace function. > Since probing on the notrace function can cause recursive > event call. In most case those are just skipped, but > in some case it falls into infinit recursive cal

[PATCH v5 0/3] tracing: kprobes: Prohibit probing on notrace functions

2018-07-30 Thread Masami Hiramatsu
selftest function to separate compile unit Masami Hiramatsu (2): tracing: kprobes: Prohibit probing on notrace function selftests/ftrace: Fix kprobe string testcase to not probe notrace function kernel/trace/Kconfig | 20 +++ kernel/trace/

[PATCH v5 1/3] tracing: kprobes: Prohibit probing on notrace function

2018-07-30 Thread Masami Hiramatsu
, but it is highly recommended to keep it "n" for normal kernel. Note that this is only available if "kprobes on ftrace" has been implemented on target arch and CONFIG_KPROBES_ON_FTRACE=y. Signed-off-by: Masami Hiramatsu --- Changes in v2 - Add CONFIG_KPROBE_EVENTS_ON

[PATCH v5 2/3] selftest/ftrace: Move kprobe selftest function to separate compile unit

2018-07-30 Thread Masami Hiramatsu
From: Francis Deslauriers Move selftest function to its own compile unit so it can be compiled with the ftrace cflags (CC_FLAGS_FTRACE) allowing it to be probed during the ftrace startup tests. Signed-off-by: Francis Deslauriers Signed-off-by: Masami Hiramatsu --- kernel/trace/Makefile

[PATCH v5 3/3] selftests/ftrace: Fix kprobe string testcase to not probe notrace function

2018-07-30 Thread Masami Hiramatsu
Fix kprobe string argument testcase to not probe notrace function. Instead, it probes tracefs function which must be available with ftrace. Signed-off-by: Masami Hiramatsu --- Changes in v3: - Fix probepoint testcase too. --- .../ftrace/test.d/kprobe/kprobe_args_string.tc | 30

Re: [lkp-robot] [tracing] ecadccb31b: kernel_selftests.ftrace.ftracetest.fail

2018-07-21 Thread Masami Hiramatsu
failed: 0 > # of undefined(test bug): 0 > not ok 1..1 selftests: ftrace: ftracetest [FAIL] > make: Leaving directory > '/usr/src/perf_selftests-x86_64-rhel-7.2-ecadccb31b8f1516dd045cc64fc7bc7a2d72947f/tools/testing/selftests/ftrace' > > > to reproduce: > > git clone https://github.com/intel/lkp-tests.git > cd lkp-tests > bin/lkp install job.yaml # job file is attached in this email > bin/lkp run job.yaml > > > > thanks, > rong, chen -- Masami Hiramatsu

Re: [lkp-robot] [tracing] ecadccb31b: kernel_selftests.ftrace.ftracetest.fail

2018-07-21 Thread Masami Hiramatsu
On Sat, 21 Jul 2018 18:40:32 +0900 Masami Hiramatsu wrote: > Hi, > > OK, I'll handle this. > The reason why this error is that kprobe event tests probe ftrace itself for > test. So one possible fix is below patch. Another possible way to fix is to allow instrumentation

Re: [PATCH v5 0/3] tracing: kprobes: Prohibit probing on notrace functions

2018-07-30 Thread Masami Hiramatsu
> Francis > Le lun. 30 juill. 2018, à 06 h 20, Masami Hiramatsu > a écrit : > > > > Hi, > > > > This is the 5th version of the series to prohibit kprobe > > on notrace functions. > > > > This fixes a build error when CONFIG_FUNCTION_TRACER=y but &

Re: [PATCH v5 1/3] tracing: kprobes: Prohibit probing on notrace function

2018-07-30 Thread Masami Hiramatsu
On Mon, 30 Jul 2018 18:40:10 -0400 Steven Rostedt wrote: > On Mon, 30 Jul 2018 19:20:14 +0900 > Masami Hiramatsu wrote: > > > Prohibit kprobe-events probing on notrace function. > > Since probing on the notrace function can cause recursive > > event call. In most

Re: [PATCH 11/25] selftests/ftrace: Improve kprobe on module testcase to load/unload module

2018-08-01 Thread Masami Hiramatsu
On Fri, 27 Jul 2018 21:15:08 +0900 Masami Hiramatsu wrote: > --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc > +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc > @@ -4,11 +4,18 @@ > > [ -f kprobe_events ] || exit_unsupported # this

Re: [PATCH 11/25] selftests/ftrace: Improve kprobe on module testcase to load/unload module

2018-08-02 Thread Masami Hiramatsu
On Thu, 2 Aug 2018 10:02:40 +0900 Masami Hiramatsu wrote: > On Fri, 27 Jul 2018 21:15:08 +0900 > Masami Hiramatsu wrote: > > > --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc > > +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.

[BUGFIX PATCH] tracing/kprobes: Fix within_notrace_func() to check only notrace functions

2018-08-02 Thread Masami Hiramatsu
nts always refuses if user defines a probe on "currenly unloaded module". Fixes: commit 45408c4f9250 ("tracing: kprobes: Prohibit probing on notrace function") Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_kprobe.c |8 +--- 1 file changed, 5 insertions(+), 3 del

Re: [PATCH v6 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-07-24 Thread Masami Hiramatsu
Hi Ravi, Thank you for updating the series. At least trace_uprobe side, it looks good to me ;) Reviewed-by: Masami Hiramatsu Thanks! On Mon, 16 Jul 2018 14:17:03 +0530 Ravi Bangoria wrote: > Userspace Statically Defined Tracepoints[1] are dtrace style markers > inside userspace applic

Re: [PATCH 2/3] [BUGFIX] ring_buffer: tracing: Inherit the tracing setting to next ring buffer

2018-07-24 Thread Masami Hiramatsu
On Mon, 23 Jul 2018 22:25:34 -0400 Steven Rostedt wrote: > On Sat, 14 Jul 2018 01:28:15 +0900 > Masami Hiramatsu wrote: > > > Inherit the tracing on/off setting on ring_buffer to next > > trace buffer when taking a snapshot. > > > > Taking a snapshot is

Re: [PATCH 1/3] [BUGFIX] tracing: Fix double free of event_trigger_data

2018-07-24 Thread Masami Hiramatsu
On Mon, 23 Jul 2018 22:10:06 -0400 Steven Rostedt wrote: > On Sat, 14 Jul 2018 01:27:47 +0900 > Masami Hiramatsu wrote: > > > Fix a double free bug of event_trigger_data caused by > > calling unregister_trigger() from register_snapshot_trigger(). > > This kicks

Re: [PATCH 1/3] [BUGFIX] tracing: Fix double free of event_trigger_data

2018-07-24 Thread Masami Hiramatsu
On Tue, 24 Jul 2018 16:49:59 -0400 Steven Rostedt wrote: > On Wed, 25 Jul 2018 00:09:09 +0900 > Masami Hiramatsu wrote: > > > Hmm, your patch seems to leak a memory since event_trigger_init() will > > be called twice on same trigger_data (Note that event_trigger_init()

Re: [PATCH 1/3] [BUGFIX] tracing: Fix double free of event_trigger_data

2018-07-24 Thread Masami Hiramatsu
ret = -ENOENT; > - goto out_free; > - } else if (ret < 0) > - goto out_free; > - ret = 0; > + } else if (ret > 0) > + ret = 0; > + > + /* Down the counter of trigger_data or free it if not used anymore */ > + event_trigger_free(trigger_ops, trigger_data); > out: > return ret; > -- Masami Hiramatsu

Re: [PATCH 1/3] [BUGFIX] tracing: Fix double free of event_trigger_data

2018-07-25 Thread Masami Hiramatsu
On Tue, 24 Jul 2018 22:41:49 -0400 Steven Rostedt wrote: > On Wed, 25 Jul 2018 10:16:53 +0900 > Masami Hiramatsu wrote: > > > Hm, as far as I can see, when register_trigger() returns >= 0, it already > > calls ->init the trigger_data. This means its refcount++,

Re: [PATCH] kprobes: fix trace_probe flags in enable_trace_kprobe

2018-07-25 Thread Masami Hiramatsu
; > else > > ret = enable_kprobe(&tk->rp.kp); > > } > > + > > + if (ret) { > > + if (file) { > > + list_del(&link->list); > > + kfree(link); > > + tk->tp.flags &= ~TP_FLAG_TRACE; > > + } else { > > + tk->tp.flags &= ~TP_FLAG_PROFILE; > > + } > > + } > > out: > > return ret; > > } > -- Masami Hiramatsu

Re: [PATCH v2] tracing/kprobes: Fix trace_probe flags on enable_trace_kprobe() failure

2018-07-25 Thread Masami Hiramatsu
le to remove the probe through kprobe_events file since probes_open() > expects every probe to be disabled. > Looks good to me. Acked-by: Masami Hiramatsu Thanks! > Signed-off-by: Artem Savkov > --- > kernel/trace/trace_kprobe.c | 13 +++-- > 1 file changed,

Re: [PATCH] tracing: Fix double free of event_trigger_data

2018-07-25 Thread Masami Hiramatsu
ger function > as it would only up and lower the ref count for it. If the register > trigger function fails, then the event_trigger_free() called after it > will free the trigger data normally. > > Link: http://lkml.kernel.org/r/20180724191331.738eb...@gandalf.local.home > Looks goo

Re: [PATCH] tracing: Fix double free of event_trigger_data

2018-07-25 Thread Masami Hiramatsu
> I take this back. Looks like it just needs to be handled slightly > differently. Thoughts? Ah, I see, the filter should be cleared :) OK, this should work. Reivewed-by: Masami Hiramatsu Thanks, > > -- Steve > > diff --git a/kernel/trace/trace_events_trigger.c >

Re: [PATCH 2/2] kprobe: fix: Add ftrace_ops_assist_func to kprobe blacklist

2018-07-12 Thread Masami Hiramatsu
can be compile with CC_FLAGS_FTRACE to ensure that it > + * can be probed by the selftests. > + */ > +int kprobe_trace_selftest_target(int a1, int a2, int a3, int a4, int > a5, int a6); > -- > 2.7.4 > > > Le mar. 3 juill. 2018, à 18 h 31, Steven

Re: [PATCH 2/2] kprobe: fix: Add ftrace_ops_assist_func to kprobe blacklist

2018-07-12 Thread Masami Hiramatsu
race functions. From ftrace, we can prohibit probing on notrace funcs, but if user makes an out-of-tree kprobe module and put it on notrace funcs, that can cause a problem (if they enable some kprobe events at same time). Thank you, -- Masami Hiramatsu

Re: [PATCH 1/2] tracing: kprobes: Prohibit probing on notrace functions

2018-07-12 Thread Masami Hiramatsu
On Thu, 12 Jul 2018 13:54:12 -0400 Francis Deslauriers wrote: > From: Masami Hiramatsu > > Prohibit kprobe-events probing on notrace function. > Since probing on the notrace function can cause recursive > event call. In most case those are just skipped, but > in some

[PATCH 0/3] tracing: Fix bugs on snapshot feature

2018-07-13 Thread Masami Hiramatsu
odd behavior of snapshotting. Since it is easy to reproduce, I made a kselftest testcase for this bug too. Thank you, --- Masami Hiramatsu (3): [BUGFIX] tracing: Fix double free of event_trigger_data [BUGFIX] ring_buffer: tracing: Inherit the tracing setting to next ring buffer

[PATCH 1/3] [BUGFIX] tracing: Fix double free of event_trigger_data

2018-07-13 Thread Masami Hiramatsu
event trigger command") Signed-off-by: Masami Hiramatsu Cc: Steven Rostedt Cc: Ingo Molnar Cc: Tom Zanussi Cc: sta...@vger.kernel.org --- kernel/trace/trace.c|5 + kernel/trace/trace.h|2 ++ kernel/trace/trace_events_trigger.c | 10 +

[PATCH 2/3] [BUGFIX] ring_buffer: tracing: Inherit the tracing setting to next ring buffer

2018-07-13 Thread Masami Hiramatsu
s above strange behavior. Fixes: commit debdd57f5145 ("tracing: Make a snapshot feature available from userspace") Signed-off-by: Masami Hiramatsu Cc: Steven Rostedt Cc: Ingo Molnar Cc: Hiraku Toyooka Cc: sta...@vger.kernel.org --- include/linux/ring_buffer.h |1 +

[PATCH 3/3] selftests/ftrace: Add snapshot and tracing_on test case

2018-07-13 Thread Masami Hiramatsu
Add a testcase for checking snapshot and tracing_on relationship. This ensures that the snapshotting doesn't affect current tracing on/off settings. Signed-off-by: Masami Hiramatsu Cc: Steven Rostedt Cc: Ingo Molnar Cc: Shuah Khan Cc: linux-kselft...@vger.kernel.org --- .../selftests/f

Re: [RFC PATCH -tip 0/2] kprobes: A trial to reuse graph-tracer's return stack for kretprobe

2018-01-24 Thread Masami Hiramatsu
it can support return hook, and kretprobe can piggyback on that. So I'm waiting that your enhancement, or could I try it? :) Thank you, > > -- Steve > > > On Tue, 22 Aug 2017 00:40:05 +0900 > Masami Hiramatsu wrote: > > > Hello, > > > > Here is a

[PATCH 0/8] kprobes: Fix %p in kprobes

2018-01-24 Thread Masami Hiramatsu
S, and one critical function uses %px which is called right before BUG(). Also, I tried to fix this issue on each arch port. I searched it by # find arch/* | grep -e 'kprobe.*c' | xargs grep -w %p And fixed all %p uses in those files. Thank you, --- Masami Hiramatsu (8): kpr

[PATCH 1/8] kprobes: Show blacklist addresses as same as kallsyms does

2018-01-24 Thread Masami Hiramatsu
Show kprobes blacklist addresses under same condition of showing kallsyms addresses. Since there are several name conflict for local symbols, kprobe blacklist needs to show each addresses so that user can identify where is on blacklist by comparing with kallsyms. Signed-off-by: Masami Hiramatsu

[PATCH 2/8] kprobes: Show address of kprobes if kallsyms does

2018-01-24 Thread Masami Hiramatsu
Show probed address in debugfs kprobe list file as same as kallsyms does. This information is used for checking kprobes are placed in the expected address. So it should be able to compared with address in kallsyms. Signed-off-by: Masami Hiramatsu --- kernel/kprobes.c | 14 +- 1

[PATCH 3/8] kprobes: Replace %p with other pointer types

2018-01-24 Thread Masami Hiramatsu
Replace %p with appropriate pointer types (or just remove it) - Use %pS if possible - Use %px only for the function right before BUG(). - Remove unneeded error message. Signed-off-by: Masami Hiramatsu --- kernel/kprobes.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions

[PATCH 4/8] kprobes/x86: Fix %p uses in error messages

2018-01-24 Thread Masami Hiramatsu
Fix %p uses in error messages in kprobes/x86. - Some %p uses are not needed. Just remove it (or remove message). - One %p use is right before the BUG() so replaced with %px. Signed-off-by: Masami Hiramatsu --- arch/x86/kernel/kprobes/core.c | 12 1 file changed, 4 insertions

[PATCH 5/8] kprobes/arm: Fix %p uses in error messages

2018-01-24 Thread Masami Hiramatsu
Fix %p uses in error messages by removing it and using general dumper. Signed-off-by: Masami Hiramatsu --- arch/arm/probes/kprobes/core.c | 10 +- arch/arm/probes/kprobes/test-core.c |1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arm/probes/kprobes

[PATCH 7/8] kprobes/MN10300: Fix %p uses in error messages

2018-01-24 Thread Masami Hiramatsu
Replace %p with %px because it is right before BUG(). Signed-off-by: Masami Hiramatsu --- arch/mn10300/kernel/kprobes.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mn10300/kernel/kprobes.c b/arch/mn10300/kernel/kprobes.c index 0311a7fcea16..e539fac00321

[PATCH 6/8] kprobes/arm64: Fix %p uses in error messages

2018-01-24 Thread Masami Hiramatsu
Fix %p uses in error messages by removing it because those are redundant or meaningless. Signed-off-by: Masami Hiramatsu --- arch/arm64/kernel/probes/kprobes.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel

[PATCH 8/8] kprobes/s390: Fix %p uses in error messages

2018-01-24 Thread Masami Hiramatsu
Remove %p because the kprobe will be dumped in dump_kprobe(). Signed-off-by: Masami Hiramatsu --- arch/s390/kernel/kprobes.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index af3722c28fd9..df30e5b9a572 100644

Re: [PATCH 6/8] kprobes/arm64: Fix %p uses in error messages

2018-01-25 Thread Masami Hiramatsu
On Thu, 25 Jan 2018 16:42:31 + Will Deacon wrote: > On Thu, Jan 25, 2018 at 02:29:32PM +0900, Masami Hiramatsu wrote: > > Fix %p uses in error messages by removing it because > > those are redundant or meaningless. > > > > Signed-off-by: Masami Hiramatsu >

Re: [PATCH bpf-next v3 3/5] error-injection: Separate error-injection from kprobe

2018-01-10 Thread Masami Hiramatsu
On Wed, 10 Jan 2018 10:36:15 -0500 Josef Bacik wrote: > On Wed, Jan 10, 2018 at 07:18:05PM +0900, Masami Hiramatsu wrote: > > Since error-injection framework is not limited to be used > > by kprobes, nor bpf. Other kernel subsystems can use it > > freely for checking safene

[PATCH bpf-next v4 0/5] Separate error injection table from kprobes

2018-01-10 Thread Masami Hiramatsu
/858176/ Changes in v3: - [3/5] Change error-injection.h including points to each file which uses ALLOW_ERROR_INJECTION instead of bpf.h - Add Reviewed-by from Josef Bacik except [3/5] Thank you, --- Masami Hiramatsu (5): tracing/kprobe: bpf: Check error injectable event is on function

[PATCH bpf-next v4 1/5] tracing/kprobe: bpf: Check error injectable event is on function entry

2018-01-10 Thread Masami Hiramatsu
value, that operation must be done before the target function starts making stackframe. As a side effect, bpf error injection is no need to depend on function-tracer. It can work with sw-breakpoint based kprobe events too. Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik --- Changes in v3

[PATCH bpf-next v4 2/5] tracing/kprobe: bpf: Compare instruction pointer with original one

2018-01-10 Thread Masami Hiramatsu
Compare instruction pointer with original one on the stack instead using per-cpu bpf_kprobe_override flag. This patch also consolidates reset_current_kprobe() and preempt_enable_no_resched() blocks. Those can be done in one place. Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik

[PATCH bpf-next v4 3/5] error-injection: Separate error-injection from kprobe

2018-01-10 Thread Masami Hiramatsu
eature for kprobe or ftrace etc. Signed-off-by: Masami Hiramatsu --- Changes in v3: - Fix a build error for asmlinkage on i386 by including compiler.h - Fix "CONFIG_FUNCTION_ERROR_INJECT" typo. - Separate CONFIG_MODULES dependent code - Add CONFIG_KPROBES dependency for ar

[PATCH bpf-next v4 4/5] error-injection: Add injectable error types

2018-01-10 Thread Masami Hiramatsu
/debug/error_injection/list open_ctree [btrfs]ERRNO io_ctl_init [btrfs] ERRNO Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik --- fs/btrfs/disk-io.c|2 +- fs/btrfs/free-space-cache.c |2 +- include/asm-generic/error-injection.h | 23

[PATCH bpf-next v4 5/5] error-injection: Support fault injection framework

2018-01-10 Thread Masami Hiramatsu
devices: 1 Devices: IDSIZE PATH 1 1001.00MiB /dev/loop2 mount: mount /dev/loop2 on /opt/tmpmnt failed: Cannot allocate memory SUCCESS! === Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik --- Changes in v3: - Check and adjust error value for

Re: [PATCH v5 0/2] kprobes: improve error handling when arming/disarming kprobes

2018-01-11 Thread Masami Hiramatsu
arming during register_kprobe() fails. > - add Masami's ack on the 2nd patch (unchanged from v1) > > --- > Jessica Yu (2): > kprobes: propagate error from arm_kprobe_ftrace() > kprobes: propagate error from disarm_kprobe_ftrace() > > kernel/kprobes.c | 178 > +++ > 1 file changed, 128 insertions(+), 50 deletions(-) > > -- > 2.13.6 > -- Masami Hiramatsu

Re: [PATCH 1/2] perf-probe: Ensure debuginfo's build-id is correct

2018-01-11 Thread Masami Hiramatsu
Hi Arnaldo, On Thu, 4 Jan 2018 13:17:28 -0300 Arnaldo Carvalho de Melo wrote: > Em Mon, Dec 18, 2017 at 04:29:03PM +0900, Masami Hiramatsu escreveu: > > Ensure that the build-id of debuginfo is correctly > > matched to target build-id, if not, it warns user > > to check

Re: [PATCH bpf-next v4 5/5] error-injection: Support fault injection framework

2018-01-11 Thread Masami Hiramatsu
On Thu, 11 Jan 2018 23:44:57 +0900 Akinobu Mita wrote: > 2018-01-11 9:51 GMT+09:00 Masami Hiramatsu : > > Support in-kernel fault-injection framework via debugfs. > > This allows you to inject a conditional error to specified > > function using debugfs interfaces. > >

Re: [PATCH 1/2] perf-probe: Ensure debuginfo's build-id is correct

2018-01-11 Thread Masami Hiramatsu
On Thu, 11 Jan 2018 12:06:31 -0300 Arnaldo Carvalho de Melo wrote: > Em Thu, Jan 11, 2018 at 11:59:32AM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Thu, Jan 11, 2018 at 09:31:19PM +0900, Masami Hiramatsu escreveu: > > > On Thu, 4 Jan 2018 13:17:28 -0300 > > > Arna

[PATCH bpf-next v5 0/5] Separate error injection table from kprobes

2018-01-12 Thread Masami Hiramatsu
within_error_injection returns false always. - [5/5] Update to support multiple function error injection. Thank you, --- Masami Hiramatsu (5): tracing/kprobe: bpf: Check error injectable event is on function entry tracing/kprobe: bpf: Compare instruction pointer with original one

[PATCH bpf-next v5 1/5] tracing/kprobe: bpf: Check error injectable event is on function entry

2018-01-12 Thread Masami Hiramatsu
value, that operation must be done before the target function starts making stackframe. As a side effect, bpf error injection is no need to depend on function-tracer. It can work with sw-breakpoint based kprobe events too. Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik --- Changes in v3

[PATCH bpf-next v5 2/5] tracing/kprobe: bpf: Compare instruction pointer with original one

2018-01-12 Thread Masami Hiramatsu
Compare instruction pointer with original one on the stack instead using per-cpu bpf_kprobe_override flag. This patch also consolidates reset_current_kprobe() and preempt_enable_no_resched() blocks. Those can be done in one place. Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik

[PATCH bpf-next v5 3/5] error-injection: Separate error-injection from kprobe

2018-01-12 Thread Masami Hiramatsu
eature for kprobe or ftrace etc. Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik --- Changes in v3: - Fix a build error for asmlinkage on i386 by including compiler.h - Fix "CONFIG_FUNCTION_ERROR_INJECT" typo. - Separate CONFIG_MODULES dependent code - Add CONFIG_KP

[PATCH bpf-next v5 5/5] error-injection: Support fault injection framework

2018-01-12 Thread Masami Hiramatsu
devices: 1 Devices: IDSIZE PATH 1 1001.00MiB /dev/loop2 mount: mount /dev/loop2 on /opt/tmpmnt failed: Cannot allocate memory SUCCESS! === Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik --- Changes in v3: - Check and adjust error value for

<    2   3   4   5   6   7   8   9   10   11   >