[PATCH v4] modules: wait do_free_init correctly

2024-02-26 Thread Changbin Du
0.402442] Run /sbin/init as init process With this fix, the above delay can be eliminated. Fixes: 1a7b7d922081 ("modules: Use vmalloc special flag") Signed-off-by: Changbin Du Cc: Xiaoyi Su Cc: Eric Chanudet Cc: Luis Chamberlain Tested-by: Eric Chanudet --- v4: - poli

Re: [PATCH v3] modules: wait do_free_init correctly

2024-02-22 Thread Changbin Du
On Sat, Feb 17, 2024 at 04:18:10PM +0800, Changbin Du wrote: > > The synchronization here is just to ensure the module init's been freed > > before doing W+X checking. > > Some nits, this should read instead: > > Fix the ordering of freeing of a module init so that it happens

[PATCH v3] modules: wait do_free_init correctly

2024-02-17 Thread Changbin Du
_RT kernel. [0.291444] Freeing unused kernel memory: 5568K [0.402442] Run /sbin/init as init process With this fix, the above delay can be eliminated. Fixes: 1a7b7d922081 ("modules: Use vmalloc special flag") Signed-off-by: Changbin Du Cc: Xiaoyi Su Cc: Eric Chanudet --- v

Re: [RESEND PATCH v2] modules: wait do_free_init correctly

2024-02-17 Thread Changbin Du
On Thu, Feb 15, 2024 at 09:18:09AM -0500, Eric Chanudet wrote: > On Tue, Jan 30, 2024 at 06:21:03AM -0800, Luis Chamberlain wrote: > > On Tue, Jan 30, 2024 at 09:40:38AM +0800, Changbin Du wrote: > > > On Mon, Jan 29, 2024 at 09:53:58AM -0800, Luis Chamberlain wrote: > >

Re: [RESEND PATCH v2] modules: wait do_free_init correctly

2024-01-29 Thread Changbin Du
On Mon, Jan 29, 2024 at 09:53:58AM -0800, Luis Chamberlain wrote: > On Mon, Jan 29, 2024 at 10:03:04AM +0800, Changbin Du wrote: > > The commit 1a7b7d922081 ("modules: Use vmalloc special flag") moves > > do_free_init() into a global workqueue instead of call_rcu(). So

[RESEND PATCH v2] modules: wait do_free_init correctly

2024-01-28 Thread Changbin Du
e positive reports in W+X checking, and rcu synchronization is unnecessary. Fixes: 1a7b7d922081 ("modules: Use vmalloc special flag") Signed-off-by: Changbin Du Cc: Xiaoyi Su --- v2: fix compilation issue for no CONFIG_MODULES found by 0-DAY. --- include/linux/moduleloader.h | 8 +

[PATCH v2] modules: wait do_free_init correctly

2023-12-24 Thread Changbin Du
e positive reports in W+X checking. Fixes: 1a7b7d922081 ("modules: Use vmalloc special flag") Signed-off-by: Changbin Du Cc: Xiaoyi Su --- v2: fix compilation issue for no CONFIG_MODULES found by 0-DAY. --- include/linux/moduleloader.h | 8 init/main.c | 5 +++--

Re: [PATCH] modules: wait do_free_init correctly

2023-12-24 Thread Changbin Du
On Thu, Dec 21, 2023 at 10:30:37AM +0800, Changbin Du wrote: > On Wed, Dec 20, 2023 at 06:32:39AM -0800, Luis Chamberlain wrote: > > On Wed, Dec 20, 2023 at 01:27:51PM +0800, Changbin Du wrote: > > > On Tue, Dec 19, 2023 at 01:52:03PM -0800, Luis Chamberlain wrote: > >

Re: [PATCH] modules: wait do_free_init correctly

2023-12-20 Thread Changbin Du
On Wed, Dec 20, 2023 at 06:32:39AM -0800, Luis Chamberlain wrote: > On Wed, Dec 20, 2023 at 01:27:51PM +0800, Changbin Du wrote: > > On Tue, Dec 19, 2023 at 01:52:03PM -0800, Luis Chamberlain wrote: > > > On Tue, Dec 19, 2023 at 12:51:51PM -0800, Andrew Morton wrote: > > &g

Re: [PATCH] modules: wait do_free_init correctly

2023-12-19 Thread Changbin Du
On Tue, Dec 19, 2023 at 01:52:03PM -0800, Luis Chamberlain wrote: > On Tue, Dec 19, 2023 at 12:51:51PM -0800, Andrew Morton wrote: > > On Tue, 19 Dec 2023 22:12:31 +0800 Changbin Du > > wrote: > > > > > The commit 1a7b7d922081 ("modules: Use vmalloc spec

[PATCH] modules: wait do_free_init correctly

2023-12-19 Thread Changbin Du
The commit 1a7b7d922081 ("modules: Use vmalloc special flag") moves do_free_init() into a global workqueue instead of call_rcu(). So now we should wait it via flush_work(). Fixes: 1a7b7d922081 ("modules: Use vmalloc special flag") Signed-off-by: Changbin Du Cc: Xiaoyi Su

[PATCH] riscv: patch: remove lockdep assertion on lock text_mutex

2021-04-16 Thread Changbin Du
d5b ]--- [ 104.647444] [ cut here ] Signed-off-by: Changbin Du --- arch/riscv/kernel/patch.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/riscv/kernel/patch.c b/arch/riscv/kernel/patch.c index 0b552873a577..6d2ed9c15065 100644 --- a/arch/ri

Re: [PATCH] of/fdt: Check dtb pointer first in unflatten_device_tree

2021-03-25 Thread Changbin Du
On Wed, Mar 24, 2021 at 10:52:30AM -0600, Rob Herring wrote: > On Wed, Mar 24, 2021 at 9:04 AM Changbin Du wrote: > > > > The setup_arch() would invoke unflatten_device_tree() even no > > valid fdt found. So we'd better check it first and return early. > > >

Re: [PATCH] riscv: Do not invoke early_init_dt_verify() twice

2021-03-25 Thread Changbin Du
On Wed, Mar 24, 2021 at 08:51:06PM +0530, Anup Patel wrote: > On Wed, Mar 24, 2021 at 8:33 PM Changbin Du wrote: > > > > In the setup_arch() of riscv, function early_init_dt_verify() has > > been done by parse_dtb(). So no need to call it again. Just directly > > i

[PATCH] of/fdt: Check dtb pointer first in unflatten_device_tree

2021-03-24 Thread Changbin Du
The setup_arch() would invoke unflatten_device_tree() even no valid fdt found. So we'd better check it first and return early. Signed-off-by: Changbin Du --- drivers/of/fdt.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index dcc1dd96911a

[PATCH] riscv: Do not invoke early_init_dt_verify() twice

2021-03-24 Thread Changbin Du
In the setup_arch() of riscv, function early_init_dt_verify() has been done by parse_dtb(). So no need to call it again. Just directly invoke unflatten_device_tree(). Signed-off-by: Changbin Du --- arch/riscv/kernel/setup.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git

[PATCH] efi/fdt: fix panic when no valid fdt found

2021-03-24 Thread Changbin Du
setup_arch() would invoke efi_init()->efi_get_fdt_params(). If no valid fdt found then initial_boot_params will be null. So we should stop further fdt processing here. I encountered this issue on risc-v. Signed-off-by: Changbin Du --- drivers/firmware/efi/fdtparams.c | 3 +++ 1 file changed

Re: [RESEND PATCH v2] perf stat: improve readability of shadow stats

2021-03-18 Thread Changbin Du
On Tue, Mar 16, 2021 at 02:53:41PM +0100, Jiri Olsa wrote: > On Mon, Mar 15, 2021 at 10:30:47PM +0800, Changbin Du wrote: > > SNIP > > > diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c > > index 6ccf21a72f06..3f800e71126f 100644 > > --- a

[RESEND PATCH v2] perf stat: improve readability of shadow stats

2021-03-15 Thread Changbin Du
% of all branches 2.002040043 seconds time elapsed Signed-off-by: Changbin Du v2: o do not change 'sec' to 'cpu-sec'. o use convert_unit_double to implement convert_unit. --- tools/perf/util/stat-shadow.c | 16 +++- tools/perf/util/units.c | 21

[PATCH v2] perf stat: improve readability of shadow stats

2021-03-04 Thread Changbin Du
% of all branches 2.002040043 seconds time elapsed Signed-off-by: Changbin Du v2: o do not change 'sec' to 'cpu-sec'. o use convert_unit_double to implement convert_unit. --- tools/perf/util/stat-shadow.c | 16 +++- tools/perf/util/units.c | 21

Re: [PATCH] perf stat: improve readability of shadow stats

2021-03-04 Thread Changbin Du
On Tue, Mar 02, 2021 at 09:25:24AM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Mar 02, 2021 at 11:08:40AM +0900, Namhyung Kim escreveu: > > On Tue, Mar 2, 2021 at 4:19 AM Jiri Olsa wrote: > > > > > > On Tue, Mar 02, 2021 at 01:24:02AM +0800, Changbin Du wrote: &

Re: [PATCH] perf stat: improve readability of shadow stats

2021-03-04 Thread Changbin Du
On Mon, Mar 01, 2021 at 08:19:20PM +0100, Jiri Olsa wrote: > On Tue, Mar 02, 2021 at 01:24:02AM +0800, Changbin Du wrote: > > This does follow two changes: > > 1) Select appropriate unit between K/M/G. > > 2) Use 'cpu-sec' instead of 'sec' to state this is not the wall-

[PATCH] perf stat: improve readability of shadow stats

2021-03-01 Thread Changbin Du
%) 2,063,251,998 branches # 257.803 M/cpu-sec (83.41%) 86,941,704 branch-misses #4.21% of all branches (83.30%) 2.001743706 seconds time elapsed Signed-off-by: Changbin Du --- tools/perf/util/stat-shadow.c | 13

[PATCH] riscv: uaccess: fix __put_kernel_nofault()

2020-11-01 Thread Changbin Du
nel_nofault and __put_user_nofault") Signed-off-by: Changbin Du Cc: Christoph Hellwig --- arch/riscv/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/uaccess.h b/arch/riscv/include/asm/uaccess.h index c47e6b35c551..824b2c9da75b 100644

Re: [RESEND PATCH] perf: ftrace: Add filter support for option -F/--funcs

2020-09-05 Thread Changbin Du
On Fri, Sep 04, 2020 at 03:59:59PM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Sep 04, 2020 at 01:27:16PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Fri, Sep 04, 2020 at 11:23:57PM +0800, Changbin Du escreveu: > > > Same as 'perf probe -F', this patch adds filter supp

[RESEND PATCH] perf: ftrace: Add filter support for option -F/--funcs

2020-09-04 Thread Changbin Du
_readf vfs_writef ... Suggested-by: Arnaldo Carvalho de Melo Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 3 +- tools/perf/builtin-ftrace.c | 84 ++-- 2 files changed, 80 insertions(+), 7 deletions(-) diff --git a/tools/perf/Documentatio

[PATCH] kcsan: kconfig: Move to menu 'Generic Kernel Debugging Instruments'

2020-09-04 Thread Changbin Du
This moves the KCSAN kconfig items under menu 'Generic Kernel Debugging Instruments' where UBSAN resides. Signed-off-by: Changbin Du --- lib/Kconfig.debug | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index e068c3c7189a

Re: localmodconfig - "intel_rapl_perf config not found!!"

2020-08-26 Thread Changbin Du
browser at http://www.perl.org/, the Perl Home Page. > > Changing email address for Changbin. > Plus I made the quick patch for streamline_config.pl (below) > although I haven't tested it. > > --- > From: Randy Dunlap > > A user reported: > 'Use of uninitialized v

[PATCH] perf: ftrace: Add filter support for option -F/--funcs

2020-08-22 Thread Changbin Du
_readf vfs_writef ... Suggested-by: Arnaldo Carvalho de Melo Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 3 +- tools/perf/builtin-ftrace.c | 84 ++-- 2 files changed, 80 insertions(+), 7 deletions(-) diff --git a/tools/perf/Documentatio

Re: [PATCH v8 02/18] perf ftrace: add option '-F/--funcs' to list available functions

2020-08-20 Thread Changbin Du
On Fri, Aug 14, 2020 at 08:35:35AM -0300, Arnaldo Carvalho de Melo wrote: > Em Sat, Aug 08, 2020 at 10:31:25AM +0800, Changbin Du escreveu: > > This adds an option '-F/--funcs' to list all available functions to trace, > > which is read from tracing file 'available_f

Re: [PATCH v8 08/18] perf ftrace: add support for tracing option 'func_stack_trace'

2020-08-20 Thread Changbin Du
On Fri, Aug 14, 2020 at 09:24:40AM -0300, Arnaldo Carvalho de Melo wrote: > Em Sat, Aug 08, 2020 at 10:31:31AM +0800, Changbin Du escreveu: > > This adds support to display call trace for function tracer. To do this, > > just specify a '--func-opts call-graph' option. >

Re: [PATCH v8 11/18] perf ftrace: add support for tracing option 'irq-info'

2020-08-20 Thread Changbin Du
On Fri, Aug 14, 2020 at 09:28:07AM -0300, Arnaldo Carvalho de Melo wrote: > Em Sat, Aug 08, 2020 at 10:31:34AM +0800, Changbin Du escreveu: > > This adds support to display irq context info for function tracer. To do > > this, just specify a '--func-opts irq-info' option. > >

Re: [PATCH v8 13/18] perf ftrace: add support for trace option tracing_thresh

2020-08-20 Thread Changbin Du
On Fri, Aug 14, 2020 at 09:33:10AM -0300, Arnaldo Carvalho de Melo wrote: > Em Sat, Aug 08, 2020 at 10:31:36AM +0800, Changbin Du escreveu: > > This adds an option '--graph-opts thresh' to setup trace duration > > threshold for funcgraph tracer. > > Applied, please consi

[PATCH v8 18/18] perf ftrace: add change log

2020-08-07 Thread Changbin Du
Add a change log after previous enhancements. Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 9da38dc8b542..167f1f57aba3 100644 --- a/tools/perf/builtin-ftrace.c +++ b

[PATCH v8 15/18] perf ftrace: add option -D/--delay to delay tracing

2020-08-07 Thread Changbin Du
This adds an option '-D/--delay' to allow us to start tracing some times later after workload is launched. Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 4 tools/perf/builtin-ftrace.c | 19 --- 2 files changed, 20 insertions(+), 3

[PATCH v8 17/18] perf: ftrace: Add set_tracing_options() to set all trace options

2020-08-07 Thread Changbin Du
Now the __cmd_ftrace() becomes a bit long. This moves the trace option setting code to a separate function set_tracing_options(). Suggested-by: Namhyung Kim Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 118 +++- 1 file changed, 63 insertions

[PATCH v8 09/18] perf ftrace: add support for trace option sleep-time

2020-08-07 Thread Changbin Du
This adds an option '--graph-opts nosleep-time' which allow us only to measure on-CPU time. This option is function_graph tracer only. Signed-off-by: Changbin Du --- v3: switch to uniform option --graph-opts. v2: option name '--nosleep-time' -> '--graph-nosleep-time'. --- tools/p

[PATCH v8 13/18] perf ftrace: add support for trace option tracing_thresh

2020-08-07 Thread Changbin Du
) # 4140.051 us | } /* do_idle */ Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 1 + tools/perf/builtin-ftrace.c | 26 +++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools/perf

[PATCH v8 14/18] perf: ftrace: allow set graph depth by '--graph-opts'

2020-08-07 Thread Changbin Du
This is to have a consistent view of all graph tracer options. The original option '--graph-depth' is marked as deprecated. Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 5 + tools/perf/builtin-ftrace.c | 5 ++--- 2 files changed, 3 insertions(+), 7

[PATCH v8 11/18] perf ftrace: add support for tracing option 'irq-info'

2020-08-07 Thread Changbin Du
This adds support to display irq context info for function tracer. To do this, just specify a '--func-opts irq-info' option. Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 1 + tools/perf/builtin-ftrace.c | 21 - 2 files changed, 21

[PATCH v8 12/18] perf ftrace: add option 'verbose' to show more info for graph tracer

2020-08-07 Thread Changbin Du
nd_write(); 14160.770888 | 0) <...>-47814 | d... | 0.430 us| fpregs_assert_state_consistent(); 14160.770889 | 0) <...>-47814 | d... | | do_syscall_64() { 14160.770889 | 0) <...>-47814 | | | __x64_sys_close() { S

[PATCH v8 07/18] perf: util: add general function to parse sublevel options

2020-08-07 Thread Changbin Du
This factors out a general function perf_parse_sublevel_options() to parse sublevel options. The 'sublevel' options is something like the '--debug' options which allow more sublevel options. Signed-off-by: Changbin Du --- v2: add util/parse-sublevel-options.c --- tools/perf/util/Build

[PATCH v8 10/18] perf ftrace: add support for trace option funcgraph-irqs

2020-08-07 Thread Changbin Du
This adds an option '--graph-opts noirqs' to filter out functions executed in irq context. Signed-off-by: Changbin Du --- v2: option name '--nofuncgraph-irqs' -> '--graph-noirqs'. --- tools/perf/Documentation/perf-ftrace.txt | 1 + tools/perf/builtin-ftrace.c |

[PATCH v8 08/18] perf ftrace: add support for tracing option 'func_stack_trace'

2020-08-07 Thread Changbin Du
s_read => ksys_read => __x64_sys_read => do_syscall_64 => entry_SYSCALL_64_after_hwframe ... Signed-off-by: Changbin Du --- v3: switch to uniform option --func-opts. v2: option name '-s' -> '--func-call-graph' --- tools/perf/Documentation/perf-ftrace.txt | 4 +++ tools/

[PATCH v8 16/18] perf ftrace: add option --tid to filter by thread id

2020-08-07 Thread Changbin Du
This allows us to trace single thread instead of the whole process. Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 3 +++ tools/perf/builtin-ftrace.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools

[PATCH v8 06/18] perf ftrace: add option '--inherit' to trace children processes

2020-08-07 Thread Changbin Du
This adds an option '--inherit' to allow us trace children processes spawned by our target. Signed-off-by: Changbin Du --- v2: option name '--trace-children' -> '--inherit'. --- tools/perf/Documentation/perf-ftrace.txt | 3 ++ tools/perf/builtin-ftrace.c |

[PATCH v8 04/18] perf ftrace: add option '-m/--buffer-size' to set per-cpu buffer size

2020-08-07 Thread Changbin Du
This adds an option '-m/--buffer-size' to allow us set the size of per-cpu tracing buffer. Signed-off-by: Changbin Du --- v2: support units as a suffix. --- tools/perf/Documentation/perf-ftrace.txt | 5 +++ tools/perf/builtin-ftrace.c | 55 2 files

[PATCH v8 03/18] perf ftrace: factor out function write_tracing_file_int()

2020-08-07 Thread Changbin Du
We will reuse this function later. Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 1ebf71ecc1a8..4b3fcee5725a 100644 --- a/tools/perf

[PATCH v8 05/18] perf ftrace: show trace column header

2020-08-07 Thread Changbin Du
_write <...>-9246 [006] 10726.262767: fpregs_assert_state_consistent <-do_syscall_64 Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index a3a4f

[PATCH v8 01/18] perf ftrace: select function/function_graph tracer automatically

2020-08-07 Thread Changbin Du
This will trace all functions using function graph tracer: $ sudo perf ftrace -G '*' This will trace function vfs_read using function graph tracer: $ sudo perf ftrace -G vfs_read This will trace function vfs_read using function tracer: $ sudo perf ftrace -T vfs_read Signed-off-by: Changbin Du

[PATCH v8 00/18] [PATCH v7 00/18] perf: ftrace enhancement

2020-08-07 Thread Changbin Du
options. Now all funcgraph tracer options are prefixed with '--graph-', while all function tracer options are prefixed with '--func-'. o mark old options deprecated instead of removing them. Acked-by: Namhyung Kim Changbin Du (18): perf ftrace: select function/function_graph tracer

[PATCH v8 02/18] perf ftrace: add option '-F/--funcs' to list available functions

2020-08-07 Thread Changbin Du
try_to_run_init_process match_dev_by_label match_dev_by_uuid rootfs_init_fs_context Signed-off-by: Changbin Du --- v3: fix return value issue. v2: option name '-l/--list-functions' -> '-F/--funcs' --- tools/perf/Documentation/perf-ftrace.txt | 4 +++ tools/perf/builtin-ftrace.c |

Re: [PATCH v7 01/18] perf ftrace: select function/function_graph tracer automatically

2020-08-07 Thread Changbin Du
On Wed, Aug 05, 2020 at 10:05:03PM -0300, Arnaldo Carvalho de Melo wrote: > > > On August 5, 2020 9:14:48 PM GMT-03:00, Changbin Du > wrote: > >On Tue, Aug 04, 2020 at 09:51:15AM -0300, Arnaldo Carvalho de Melo > >wrote: > >> Em Sat, Jul 18, 2020 at 02:48

Re: [PATCH v7 01/18] perf ftrace: select function/function_graph tracer automatically

2020-08-05 Thread Changbin Du
On Tue, Aug 04, 2020 at 09:51:15AM -0300, Arnaldo Carvalho de Melo wrote: > Em Sat, Jul 18, 2020 at 02:48:09PM +0800, Changbin Du escreveu: > > The '-g/-G' options have already implied function_graph tracer should be > > used instead of function tracer. So the extra option

Re: [PATCH v7 00/18] perf: ftrace enhancement

2020-07-31 Thread Changbin Du
Hi Arnaldo, Are we ready to merge this serias now? Thanks. :) On Sat, Jul 18, 2020 at 02:48:08PM +0800, Changbin Du wrote: > The perf has basic kernel ftrace support but lack support of most tracing > options. This serias is target to enhance the perf ftrace functionality so > that we

Re: [PATCH v5 02/17] perf ftrace: add option '-F/--funcs' to list available functions

2020-07-18 Thread Changbin Du
On Fri, Jul 17, 2020 at 11:05:04AM -0400, Steven Rostedt wrote: > On Sat, 11 Jul 2020 20:40:20 +0800 > Changbin Du wrote: > > > This adds an option '-F/--funcs' to list all available functions to trace, > > which is read from tracing file 'available_filter_functions'. &

[PATCH v7 18/18] perf ftrace: add change log

2020-07-18 Thread Changbin Du
Add a change log after previous enhancements. Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 4551d4d4bcc5..9213fb9777c4 100644 --- a/tools/perf/builtin-ftrace.c +++ b

[PATCH v7 17/18] perf: ftrace: Add set_tracing_options() to set all trace options

2020-07-18 Thread Changbin Du
Now the __cmd_ftrace() becomes a bit long. This moves the trace option setting code to a separate function set_tracing_options(). Suggested-by: Namhyung Kim Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 118 +++- 1 file changed, 63 insertions

[PATCH v7 13/18] perf ftrace: add support for trace option tracing_thresh

2020-07-18 Thread Changbin Du
) # 4140.051 us | } /* do_idle */ Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 1 + tools/perf/builtin-ftrace.c | 26 +++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools/perf

[PATCH v7 16/18] perf ftrace: add option --tid to filter by thread id

2020-07-18 Thread Changbin Du
This allows us to trace single thread instead of the whole process. Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 3 +++ tools/perf/builtin-ftrace.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools

[PATCH v7 12/18] perf ftrace: add option 'verbose' to show more info for graph tracer

2020-07-18 Thread Changbin Du
nd_write(); 14160.770888 | 0) <...>-47814 | d... | 0.430 us| fpregs_assert_state_consistent(); 14160.770889 | 0) <...>-47814 | d... | | do_syscall_64() { 14160.770889 | 0) <...>-47814 | | | __x64_sys_close() { S

[PATCH v7 15/18] perf ftrace: add option -D/--delay to delay tracing

2020-07-18 Thread Changbin Du
This adds an option '-D/--delay' to allow us to start tracing some times later after workload is launched. Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 4 tools/perf/builtin-ftrace.c | 19 --- 2 files changed, 20 insertions(+), 3

[PATCH v7 14/18] perf: ftrace: allow set graph depth by '--graph-opts'

2020-07-18 Thread Changbin Du
This is to have a consistent view of all graph tracer options. The original option '--graph-depth' is marked as deprecated. Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 5 + tools/perf/builtin-ftrace.c | 5 ++--- 2 files changed, 3 insertions(+), 7

[PATCH v7 06/18] perf ftrace: add option '--inherit' to trace children processes

2020-07-18 Thread Changbin Du
This adds an option '--inherit' to allow us trace children processes spawned by our target. Signed-off-by: Changbin Du --- v2: option name '--trace-children' -> '--inherit'. --- tools/perf/Documentation/perf-ftrace.txt | 3 ++ tools/perf/builtin-ftrace.c |

[PATCH v7 07/18] perf: util: add general function to parse sublevel options

2020-07-18 Thread Changbin Du
This factors out a general function perf_parse_sublevel_options() to parse sublevel options. The 'sublevel' options is something like the '--debug' options which allow more sublevel options. Signed-off-by: Changbin Du --- v2: add util/parse-sublevel-options.c --- tools/perf/util/Build

[PATCH v7 08/18] perf ftrace: add support for tracing option 'func_stack_trace'

2020-07-18 Thread Changbin Du
s_read => ksys_read => __x64_sys_read => do_syscall_64 => entry_SYSCALL_64_after_hwframe ... Signed-off-by: Changbin Du --- v3: switch to uniform option --func-opts. v2: option name '-s' -> '--func-call-graph' --- tools/perf/Documentation/perf-ftrace.txt | 4 +++ tools/

[PATCH v7 11/18] perf ftrace: add support for tracing option 'irq-info'

2020-07-18 Thread Changbin Du
This adds support to display irq context info for function tracer. To do this, just specify a '--func-opts irq-info' option. Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 1 + tools/perf/builtin-ftrace.c | 21 - 2 files changed, 21

[PATCH v7 09/18] perf ftrace: add support for trace option sleep-time

2020-07-18 Thread Changbin Du
This adds an option '--graph-opts nosleep-time' which allow us only to measure on-CPU time. This option is function_graph tracer only. Signed-off-by: Changbin Du --- v3: switch to uniform option --graph-opts. v2: option name '--nosleep-time' -> '--graph-nosleep-time'. --- tools/p

[PATCH v7 10/18] perf ftrace: add support for trace option funcgraph-irqs

2020-07-18 Thread Changbin Du
This adds an option '--graph-opts noirqs' to filter out functions executed in irq context. Signed-off-by: Changbin Du --- v2: option name '--nofuncgraph-irqs' -> '--graph-noirqs'. --- tools/perf/Documentation/perf-ftrace.txt | 1 + tools/perf/builtin-ftrace.c |

[PATCH v7 03/18] perf ftrace: factor out function write_tracing_file_int()

2020-07-18 Thread Changbin Du
We will reuse this function later. Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 3c0e60fdfe0f..9abf97c29cb6 100644 --- a/tools/perf

[PATCH v7 04/18] perf ftrace: add option '-m/--buffer-size' to set per-cpu buffer size

2020-07-18 Thread Changbin Du
This adds an option '-m/--buffer-size' to allow us set the size of per-cpu tracing buffer. Signed-off-by: Changbin Du --- v2: support units as a suffix. --- tools/perf/Documentation/perf-ftrace.txt | 5 +++ tools/perf/builtin-ftrace.c | 56 +++- 2 files

[PATCH v7 02/18] perf ftrace: add option '-F/--funcs' to list available functions

2020-07-18 Thread Changbin Du
try_to_run_init_process match_dev_by_label match_dev_by_uuid rootfs_init_fs_context Signed-off-by: Changbin Du --- v3: fix return value issue. v2: option name '-l/--list-functions' -> '-F/--funcs' --- tools/perf/Documentation/perf-ftrace.txt | 4 +++ tools/perf/builtin-ftrace.c |

[PATCH v7 05/18] perf ftrace: show trace column header

2020-07-18 Thread Changbin Du
_write <...>-9246 [006] 10726.262767: fpregs_assert_state_consistent <-do_syscall_64 Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 3ea3a

[PATCH v7 01/18] perf ftrace: select function/function_graph tracer automatically

2020-07-18 Thread Changbin Du
: $ sudo perf ftrace -G '*' This will trace function vfs_read using function graph tracer: $ sudo perf ftrace -G vfs_read Signed-off-by: Changbin Du --- v3: remove default '*' for -G/-T. --- tools/perf/Documentation/perf-config.txt | 5 - tools/perf/Documentation/perf-ftrace.txt | 2

[PATCH v7 00/18] perf: ftrace enhancement

2020-07-18 Thread Changbin Du
are prefixed with '--graph-', while all function tracer options are prefixed with '--func-'. o mark old options deprecated instead of removing them. Changbin Du (18): perf ftrace: select function/function_graph tracer automatically perf ftrace: add option '-F/--funcs' to list available

Re: [PATCH v5 03/17] perf ftrace: add option -t/--tid to filter by thread id

2020-07-17 Thread Changbin Du
On Fri, Jul 17, 2020 at 01:01:24PM -0400, Steven Rostedt wrote: > On Fri, 17 Jul 2020 21:26:50 +0800 > Changbin Du wrote: > > > On Thu, Jul 16, 2020 at 12:36:30PM -0300, Arnaldo Carvalho de Melo wrote: > > > Em Sat, Jul 11, 2020 at 08:40:21PM +0800, Changbin Du escreveu:

[PATCH v6 12/17] perf ftrace: add option 'verbose' to show more info for graph tracer

2020-07-17 Thread Changbin Du
nd_write(); 14160.770888 | 0) <...>-47814 | d... | 0.430 us| fpregs_assert_state_consistent(); 14160.770889 | 0) <...>-47814 | d... | | do_syscall_64() { 14160.770889 | 0) <...>-47814 | | | __x64_sys_close() { S

[PATCH v6 13/17] perf ftrace: add support for trace option tracing_thresh

2020-07-17 Thread Changbin Du
) # 4140.051 us | } /* do_idle */ Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 1 + tools/perf/builtin-ftrace.c | 26 +++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools/perf

[PATCH v6 14/17] perf: ftrace: allow set graph depth by '--graph-opts'

2020-07-17 Thread Changbin Du
This is to have a consistent view of all graph tracer options. The original option '--graph-depth' is marked as deprecated. Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 5 + tools/perf/builtin-ftrace.c | 5 ++--- 2 files changed, 3 insertions(+), 7

[PATCH v6 16/17] perf: ftrace: Add set_tracing_options() to set all trace options

2020-07-17 Thread Changbin Du
Now the __cmd_ftrace() becomes a bit long. This moves the trace option setting code to a separate function set_tracing_options(). Suggested-by: Namhyung Kim Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 118 +++- 1 file changed, 63 insertions

[PATCH v6 15/17] perf ftrace: add option -D/--delay to delay tracing

2020-07-17 Thread Changbin Du
This adds an option '-D/--delay' to allow us to start tracing some times later after workload is launched. Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 4 tools/perf/builtin-ftrace.c | 19 --- 2 files changed, 20 insertions(+), 3

[PATCH v6 17/17] perf ftrace: add change log

2020-07-17 Thread Changbin Du
Add a change log after previous enhancements. Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index edf307f7d716..326fd03396d5 100644 --- a/tools/perf/builtin-ftrace.c +++ b

[PATCH v6 10/17] perf ftrace: add support for trace option funcgraph-irqs

2020-07-17 Thread Changbin Du
This adds an option '--graph-opts noirqs' to filter out functions executed in irq context. Signed-off-by: Changbin Du --- v2: option name '--nofuncgraph-irqs' -> '--graph-noirqs'. --- tools/perf/Documentation/perf-ftrace.txt | 1 + tools/perf/builtin-ftrace.c |

[PATCH v6 09/17] perf ftrace: add support for trace option sleep-time

2020-07-17 Thread Changbin Du
This adds an option '--graph-opts nosleep-time' which allow us only to measure on-CPU time. This option is function_graph tracer only. Signed-off-by: Changbin Du --- v3: switch to uniform option --graph-opts. v2: option name '--nosleep-time' -> '--graph-nosleep-time'. --- tools/p

[PATCH v6 06/17] perf ftrace: add option '--inherit' to trace children processes

2020-07-17 Thread Changbin Du
This adds an option '--inherit' to allow us trace children processes spawned by our target. Signed-off-by: Changbin Du --- v2: option name '--trace-children' -> '--inherit'. --- tools/perf/Documentation/perf-ftrace.txt | 3 ++ tools/perf/builtin-ftrace.c |

[PATCH v6 11/17] perf ftrace: add support for tracing option 'irq-info'

2020-07-17 Thread Changbin Du
This adds support to display irq context info for function tracer. To do this, just specify a '--func-opts irq-info' option. Signed-off-by: Changbin Du --- tools/perf/Documentation/perf-ftrace.txt | 1 + tools/perf/builtin-ftrace.c | 21 - 2 files changed, 21

[PATCH v6 05/17] perf ftrace: show trace column header

2020-07-17 Thread Changbin Du
_write <...>-9246 [006] 10726.262767: fpregs_assert_state_consistent <-do_syscall_64 Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 3ea3a

[PATCH v6 07/17] perf: util: add general function to parse sublevel options

2020-07-17 Thread Changbin Du
This factors out a general function perf_parse_sublevel_options() to parse sublevel options. The 'sublevel' options is something like the '--debug' options which allow more sublevel options. Signed-off-by: Changbin Du --- v2: add util/parse-sublevel-options.c --- tools/perf/util/Build

[PATCH v6 08/17] perf ftrace: add support for tracing option 'func_stack_trace'

2020-07-17 Thread Changbin Du
s_read => ksys_read => __x64_sys_read => do_syscall_64 => entry_SYSCALL_64_after_hwframe ... Signed-off-by: Changbin Du --- v3: switch to uniform option --func-opts. v2: option name '-s' -> '--func-call-graph' --- tools/perf/Documentation/perf-ftrace.txt | 4 +++ tools/

[PATCH v6 03/17] perf ftrace: factor out function write_tracing_file_int()

2020-07-17 Thread Changbin Du
We will reuse this function later. Signed-off-by: Changbin Du --- tools/perf/builtin-ftrace.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 3c0e60fdfe0f..9abf97c29cb6 100644 --- a/tools/perf

[PATCH v6 04/17] perf ftrace: add option '-m/--buffer-size' to set per-cpu buffer size

2020-07-17 Thread Changbin Du
This adds an option '-m/--buffer-size' to allow us set the size of per-cpu tracing buffer. Signed-off-by: Changbin Du --- v2: support units as a suffix. --- tools/perf/Documentation/perf-ftrace.txt | 5 +++ tools/perf/builtin-ftrace.c | 56 +++- 2 files

[PATCH v6 00/17] perf: ftrace enhancement

2020-07-17 Thread Changbin Du
-'. o mark old options deprecated instead of removing them. Changbin Du (17): perf ftrace: select function/function_graph tracer automatically perf ftrace: add option '-F/--funcs' to list available functions perf ftrace: factor out function write_tracing_file_int() perf ftrace: add option

[PATCH v6 02/17] perf ftrace: add option '-F/--funcs' to list available functions

2020-07-17 Thread Changbin Du
try_to_run_init_process match_dev_by_label match_dev_by_uuid rootfs_init_fs_context Signed-off-by: Changbin Du --- v3: fix return value issue. v2: option name '-l/--list-functions' -> '-F/--funcs' --- tools/perf/Documentation/perf-ftrace.txt | 4 +++ tools/perf/builtin-ftrace.c |

[PATCH v6 01/17] perf ftrace: select function/function_graph tracer automatically

2020-07-17 Thread Changbin Du
: $ sudo perf ftrace -G '*' This will trace function vfs_read using function graph tracer: $ sudo perf ftrace -G vfs_read Signed-off-by: Changbin Du --- v3: remove default '*' for -G/-T. --- tools/perf/Documentation/perf-config.txt | 5 - tools/perf/Documentation/perf-ftrace.txt | 2

[PATCH v6 01/17] perf ftrace: select function/function_graph tracer automatically

2020-07-17 Thread Changbin Du
: $ sudo perf ftrace -G '*' This will trace function vfs_read using function graph tracer: $ sudo perf ftrace -G vfs_read Signed-off-by: Changbin Du --- v3: remove default '*' for -G/-T. --- tools/perf/Documentation/perf-config.txt | 5 - tools/perf/Documentation/perf-ftrace.txt | 2

[PATCH v6 00/17] perf: ftrace enhancement

2020-07-17 Thread Changbin Du
-'. o mark old options deprecated instead of removing them. Changbin Du (17): perf ftrace: select function/function_graph tracer automatically perf ftrace: add option '-F/--funcs' to list available functions perf ftrace: factor out function write_tracing_file_int() perf ftrace: add option

Re: [PATCH v5 07/17] perf ftrace: add option '--inherit' to trace children processes

2020-07-17 Thread Changbin Du
On Mon, Jul 13, 2020 at 10:59:56AM +0900, Namhyung Kim wrote: > On Sat, Jul 11, 2020 at 9:42 PM Changbin Du wrote: > > > > This adds an option '--inherit' to allow us trace children > > processes spawned by our target. > > > > Signed-off-by: Changbin Du > &g

Re: [PATCH v5 13/17] perf ftrace: add option 'verbose' to show more info for graph tracer

2020-07-17 Thread Changbin Du
On Mon, Jul 13, 2020 at 11:07:56AM +0900, Namhyung Kim wrote: > On Sat, Jul 11, 2020 at 9:43 PM Changbin Du wrote: > > > > Sometimes we want ftrace display more and longer information about > > the trace. > > > > $ sudo perf ftrace -G > > 2) 0.979 us

Re: [PATCH v5 02/17] perf ftrace: add option '-F/--funcs' to list available functions

2020-07-17 Thread Changbin Du
On Mon, Jul 13, 2020 at 10:49:40AM +0900, Namhyung Kim wrote: > Hello, > > On Sat, Jul 11, 2020 at 9:42 PM Changbin Du wrote: > > > > This adds an option '-F/--funcs' to list all available functions to trace, > > which is read from tracing file 'available_filter_functi

Re: [PATCH v5 03/17] perf ftrace: add option -t/--tid to filter by thread id

2020-07-17 Thread Changbin Du
On Thu, Jul 16, 2020 at 12:36:30PM -0300, Arnaldo Carvalho de Melo wrote: > Em Sat, Jul 11, 2020 at 08:40:21PM +0800, Changbin Du escreveu: > > This allows us to trace single thread instead of the whole process. > > > > Signed-off-by: Changbin Du > > --- > &g

  1   2   3   4   5   6   7   8   9   >