linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtla/osnoise: set the default threshold to 1us
@ 2024-06-10 13:23 Luis Claudio R. Goncalves
  2024-06-21  8:00 ` Daniel Bristot de Oliveira
  0 siblings, 1 reply; 2+ messages in thread
From: Luis Claudio R. Goncalves @ 2024-06-10 13:23 UTC (permalink / raw)
  To: Steven Rostedt, Daniel Bristot de Oliveira, Masami Hiramatsu,
	Mathieu Desnoyers, Jonathan Corbet, linux-kernel,
	linux-trace-kernel, linux-doc

Change the default threshold for osnoise to 1us, so that any noise
equal or above this value is recorded. Let the user set a higher
threshold if necessary.

Suggested-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Reviewed-by: Clark Williams <williams@redhat.com>
Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
---
 Documentation/trace/osnoise-tracer.rst | 2 +-
 kernel/trace/trace_osnoise.c           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/trace/osnoise-tracer.rst b/Documentation/trace/osnoise-tracer.rst
index 140ef2533d26a..a520adbd34765 100644
--- a/Documentation/trace/osnoise-tracer.rst
+++ b/Documentation/trace/osnoise-tracer.rst
@@ -108,7 +108,7 @@ The tracer has a set of options inside the osnoise directory, they are:
    option.
  - tracing_threshold: the minimum delta between two time() reads to be
    considered as noise, in us. When set to 0, the default value will
-   be used, which is currently 5 us.
+   be used, which is currently 1 us.
  - osnoise/options: a set of on/off options that can be enabled by
    writing the option name to the file or disabled by writing the option
    name preceded with the 'NO\_' prefix. For example, writing
diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index a8e28f9b9271c..66a871553d4a1 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -1444,9 +1444,9 @@ static int run_osnoise(void)
 	save_osn_sample_stats(osn_var, &s);
 
 	/*
-	 * if threshold is 0, use the default value of 5 us.
+	 * if threshold is 0, use the default value of 1 us.
 	 */
-	threshold = tracing_thresh ? : 5000;
+	threshold = tracing_thresh ? : 1000;
 
 	/*
 	 * Apply PREEMPT and IRQ disabled options.
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtla/osnoise: set the default threshold to 1us
  2024-06-10 13:23 [PATCH] rtla/osnoise: set the default threshold to 1us Luis Claudio R. Goncalves
@ 2024-06-21  8:00 ` Daniel Bristot de Oliveira
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Bristot de Oliveira @ 2024-06-21  8:00 UTC (permalink / raw)
  To: Luis Claudio R. Goncalves, Steven Rostedt
  Cc: Mathieu Desnoyers, Jonathan Corbet, linux-kernel,
	linux-trace-kernel, linux-doc, Masami Hiramatsu

Hi Luis,

This is not rtla/osnoise but tracing/osnoise, so the Subject would be:

[PATCH] tracing/osnoise: Set the default threshold to 1 us

On 6/10/24 15:23, Luis Claudio R. Goncalves wrote:
> Change the default threshold for osnoise to 1us, so that any noise
> equal or above this value is recorded. Let the user set a higher
> threshold if necessary.

The reason why I place fear instead of one was "fear" of having the loop
taking more then one us, creating false noise notifications because of
execution time.

But it actually never happened, even on low speed arm boxes... Also,
all users I know are setting it to 1 on rtla... so I think it is safe to
move the value to 1.

Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>

> Suggested-by: Daniel Bristot de Oliveira <bristot@kernel.org>
> Reviewed-by: Clark Williams <williams@redhat.com>
> Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
> ---
>  Documentation/trace/osnoise-tracer.rst | 2 +-
>  kernel/trace/trace_osnoise.c           | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/trace/osnoise-tracer.rst b/Documentation/trace/osnoise-tracer.rst
> index 140ef2533d26a..a520adbd34765 100644
> --- a/Documentation/trace/osnoise-tracer.rst
> +++ b/Documentation/trace/osnoise-tracer.rst
> @@ -108,7 +108,7 @@ The tracer has a set of options inside the osnoise directory, they are:
>     option.
>   - tracing_threshold: the minimum delta between two time() reads to be
>     considered as noise, in us. When set to 0, the default value will
> -   be used, which is currently 5 us.
> +   be used, which is currently 1 us.
>   - osnoise/options: a set of on/off options that can be enabled by
>     writing the option name to the file or disabled by writing the option
>     name preceded with the 'NO\_' prefix. For example, writing
> diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
> index a8e28f9b9271c..66a871553d4a1 100644
> --- a/kernel/trace/trace_osnoise.c
> +++ b/kernel/trace/trace_osnoise.c
> @@ -1444,9 +1444,9 @@ static int run_osnoise(void)
>  	save_osn_sample_stats(osn_var, &s);
>  
>  	/*
> -	 * if threshold is 0, use the default value of 5 us.
> +	 * if threshold is 0, use the default value of 1 us.
>  	 */
> -	threshold = tracing_thresh ? : 5000;
> +	threshold = tracing_thresh ? : 1000;
>  
>  	/*
>  	 * Apply PREEMPT and IRQ disabled options.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-21  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-10 13:23 [PATCH] rtla/osnoise: set the default threshold to 1us Luis Claudio R. Goncalves
2024-06-21  8:00 ` Daniel Bristot de Oliveira

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).