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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 21 Jun 2021 09:21:31 +0800
From:   Tiezhu Yang <yangtiezhu@...ngson.cn>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Ingo Molnar <mingo@...hat.com>, Jonathan Corbet <corbet@....net>,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
        Xuefeng Li <lixuefeng@...ngson.cn>
Subject: Re: [RFC PATCH 1/2] ftrace: Introduce cmdline argument
 ftrace_disabled

On 06/19/2021 11:22 PM, Steven Rostedt wrote:
> On Sat, 19 Jun 2021 14:29:19 +0800
> Tiezhu Yang <yangtiezhu@...ngson.cn> wrote:
>
>> If set CONFIG_FUNCTION_TRACER=y, we can use the following command to
>> disable ftrace after boot up:
>> echo 0 > /proc/sys/kernel/ftrace_enabled
> I'd love to just remove that. It's original purpose was to stop function
> tracing when the latency tracers were active. That's now done via a tracefs
> option. The "ftrace_enabled" really has no use anymore.
>
>> ftrace_disabled is much stronger than ftrace_enabled, introduce a new
>> cmdline argument ftrace_disabled for user to control whether to disable
>> ftrace when boot up.
> "ftrace_disabled" is triggered when an anomaly is detected, and for the
> safety of the system, ftrace shuts down. It was never meant to be a user
> triggered event.

Thanks for your explanation.

>
> You have no rationale for this change. What's the purpose of this?

The "System Benchmarks Index Score" of UnixBench under FUNCTION_TRACER
is lower than !FUNCTION_TRACER, I want to use this new cmdline argument
ftrace_disabled to test it, this is the original intention.

I see the following help info of "config FUNCTION_TRACER":

[If it's runtime disabled (the bootup default), then the overhead of the
instructions is very small and not measurable even in micro-benchmarks.]

I am not quite understand the above description, could you tell me how to
avoid the runtime performance overhead under FUNCTION_TRACER?

Thanks,
Tiezhu

>
> -- Steve
>
>
>> Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
>> ---
>>   kernel/trace/ftrace.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
>> index 72ef4dc..a015699 100644
>> --- a/kernel/trace/ftrace.c
>> +++ b/kernel/trace/ftrace.c
>> @@ -5517,6 +5517,14 @@ static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata;
>>   /* Used by function selftest to not test if filter is set */
>>   bool ftrace_filter_param __initdata;
>>   
>> +static int __init set_ftrace_disabled(char *str)
>> +{
>> +	pr_info("Set ftrace_disabled to disable ftrace\n");
>> +	ftrace_disabled = 1;
>> +	return 1;
>> +}
>> +__setup("ftrace_disabled", set_ftrace_disabled);
>> +
>>   static int __init set_ftrace_notrace(char *str)
>>   {
>>   	ftrace_filter_param = true;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ