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:   Thu, 28 Oct 2021 06:58:49 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Kalesh Singh <kaleshsingh@...gle.com>
Cc:     surenb@...gle.com, hridya@...gle.com, namhyung@...nel.org,
        kernel-team@...roid.com, rostedt@...dmis.org, mhiramat@...nel.org,
        Ingo Molnar <mingo@...hat.com>, Shuah Khan <shuah@...nel.org>,
        linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH 2/3] tracing/kselftests: Remove triggers with references
 before their definitions

Hi Kalesh,

On Wed, 27 Oct 2021 13:59:09 -0700
Kalesh Singh <kaleshsingh@...gle.com> wrote:

> If an event trigger references a variable defined in another trigger, it
> has to be removed before the trigger that defines the variable is
> removed.
> 
> Signed-off-by: Kalesh Singh <kaleshsingh@...gle.com>
> ---
>  tools/testing/selftests/ftrace/test.d/functions | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
> index 000fd05e84b1..bd9e85f4d626 100644
> --- a/tools/testing/selftests/ftrace/test.d/functions
> +++ b/tools/testing/selftests/ftrace/test.d/functions
> @@ -22,6 +22,15 @@ reset_trigger_file() {
>  	file=`echo $line | cut -f1 -d:`
>  	echo "!$cmd" >> $file
>      done
> +
> +    # remove triggers with references next
> +    grep -H '\$' $@ |
> +    while read line; do
> +        cmd=`echo $line | cut -f2- -d: | cut -f1 -d"["`
> +	file=`echo $line | cut -f1 -d:`
> +	echo "!$cmd" >> $file
> +    done
> +

Why don't you use 'tac'? I love that idea :)
Did you find any issue?

I think the function which cleaning up the tracing file should use
the 'tac' rollback method, because it is natural, simple and robust.
Then the first loop for removing action triggers is not needed anymore.

Thank you,

>      grep -Hv ^# $@ |
>      while read line; do
>          cmd=`echo $line | cut -f2- -d: | cut -f1 -d"["`
> -- 
> 2.33.0.1079.g6e70778dc9-goog
> 


-- 
Masami Hiramatsu <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ