diff mbox series

[3/6] rtla/osnoise: Set OSNOISE_WORKLOAD to true

Message ID 20250320092500.101385-4-tglozar@redhat.com (mailing list archive)
State Accepted
Commit a8122a63c903c0e2dd8959295eb2abfc644b36e1
Headers show
Series rtla: Always set all tracer options | expand

Commit Message

Tomas Glozar March 20, 2025, 9:24 a.m. UTC
If running rtla osnoise with NO_OSNOISE_WORKLOAD, it reports no samples:

$ echo NO_OSNOISE_WORKLOAD > /sys/kernel/tracing/osnoise/options
$ rtla osnoise hist -d 10s
Index
over: 0
count: 0
min: 0
avg: 0
max: 0

This situation can also happen when running rtla-osnoise after an
improperly exited rtla-timerlat run.

Set OSNOISE_WORKLOAD in rtla-osnoise, too, similarly to what we
already did for timerlat in commit 217f0b1e990e ("rtla/timerlat_top: Set
OSNOISE_WORKLOAD for kernel threads") and commit d8d866171a41
("rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads").

Note that there is no user workload mode for rtla-osnoise yet, so
OSNOISE_WORKLOAD is always set to true.

Fixes: 1eceb2fc2ca5 ("rtla/osnoise: Add osnoise top mode")
Fixes: 829a6c0b5698 ("rtla/osnoise: Add the hist mode")
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
---
 tools/tracing/rtla/src/osnoise.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

John Kacur March 20, 2025, 7:40 p.m. UTC | #1
On Thu, 20 Mar 2025, Tomas Glozar wrote:

> If running rtla osnoise with NO_OSNOISE_WORKLOAD, it reports no samples:
> 
> $ echo NO_OSNOISE_WORKLOAD > /sys/kernel/tracing/osnoise/options
> $ rtla osnoise hist -d 10s
> Index
> over: 0
> count: 0
> min: 0
> avg: 0
> max: 0
> 
> This situation can also happen when running rtla-osnoise after an
> improperly exited rtla-timerlat run.
> 
> Set OSNOISE_WORKLOAD in rtla-osnoise, too, similarly to what we
> already did for timerlat in commit 217f0b1e990e ("rtla/timerlat_top: Set
> OSNOISE_WORKLOAD for kernel threads") and commit d8d866171a41
> ("rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads").
> 
> Note that there is no user workload mode for rtla-osnoise yet, so
> OSNOISE_WORKLOAD is always set to true.
> 
> Fixes: 1eceb2fc2ca5 ("rtla/osnoise: Add osnoise top mode")
> Fixes: 829a6c0b5698 ("rtla/osnoise: Add the hist mode")
> Signed-off-by: Tomas Glozar <tglozar@redhat.com>
> ---
>  tools/tracing/rtla/src/osnoise.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tools/tracing/rtla/src/osnoise.c b/tools/tracing/rtla/src/osnoise.c
> index 1735a36466c4..a71618d876e9 100644
> --- a/tools/tracing/rtla/src/osnoise.c
> +++ b/tools/tracing/rtla/src/osnoise.c
> @@ -1187,6 +1187,12 @@ osnoise_apply_config(struct osnoise_tool *tool, struct osnoise_params *params)
>  		auto_house_keeping(&params->monitored_cpus);
>  	}
>  
> +	retval = osnoise_set_workload(tool->context, true);
> +	if (retval < -1) {
> +		err_msg("Failed to set OSNOISE_WORKLOAD option\n");
> +		goto out_err;
> +	}
> +
>  	return 0;
>  
>  out_err:
> -- 
> 2.48.1
> 
> 
> 
Reviewed-by: John Kacur <jkacur@redhat.com>
diff mbox series

Patch

diff --git a/tools/tracing/rtla/src/osnoise.c b/tools/tracing/rtla/src/osnoise.c
index 1735a36466c4..a71618d876e9 100644
--- a/tools/tracing/rtla/src/osnoise.c
+++ b/tools/tracing/rtla/src/osnoise.c
@@ -1187,6 +1187,12 @@  osnoise_apply_config(struct osnoise_tool *tool, struct osnoise_params *params)
 		auto_house_keeping(&params->monitored_cpus);
 	}
 
+	retval = osnoise_set_workload(tool->context, true);
+	if (retval < -1) {
+		err_msg("Failed to set OSNOISE_WORKLOAD option\n");
+		goto out_err;
+	}
+
 	return 0;
 
 out_err: