lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 11 Sep 2021 09:59:37 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Yinan Liu <yinan@...ux.alibaba.com>
Cc:     mark-pk.tsai@...iatek.com, peterz@...radead.org, mingo@...hat.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] scripts: ftrace - move the sort-processing in
 ftrace_init to compile time

On Sat, 11 Sep 2021 21:50:42 +0800
Yinan Liu <yinan@...ux.alibaba.com> wrote:

> When ftrace is enabled, ftrace_init will consume a period of
> time, usually around 15~20 ms. Approximately 40% of the time is
> consumed by sort-processing. Moving the sort-processing to the
> compile time can speed up the kernel boot process.
> 

Nice. I like the idea of sorting at compile time.

> performance test:
>         env:    Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz
>         method: before and after patching, compare the
>                 total time of ftrace_init(), and verify
>                 the functionality of ftrace.
> 
>         avg_time of ftrace_init:
>                 with patch: 8.352 ms
>                 without patch: 15.763 ms
> 
> Signed-off-by: Yinan Liu <yinan@...ux.alibaba.com>
> ---
>  kernel/trace/ftrace.c   |   5 ++-
>  scripts/link-vmlinux.sh |   6 +--
>  scripts/sorttable.c     |   2 +
>  scripts/sorttable.h     | 109 +++++++++++++++++++++++++++++++++++++++++++++++-
>  4 files changed, 115 insertions(+), 7 deletions(-)
> 
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 7efbc8aaf7f6..c236da868990 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -6189,8 +6189,9 @@ static int ftrace_process_locs(struct module *mod,
>  	if (!count)
>  		return 0;
>  
> -	sort(start, count, sizeof(*start),
> -	     ftrace_cmp_ips, NULL);
> +	if (mod)

Why can't we enforce modules to be sorted too?

> +		sort(start, count, sizeof(*start),
> +		     ftrace_cmp_ips, NULL);


-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ