Re: [PATCH v1] tools/rtla: Consolidate common parameters into shared structure

From: Tomas Glozar
Date: Fri Jul 25 2025 - 08:03:08 EST


út 1. 7. 2025 v 8:04 odesílatel Costa Shulyupin <costa.shul@xxxxxxxxxx> napsal:
>
> timerlat_params and osnoise_params structures contain 17 identical
> fields.
>
> Introduce a common_params structure and move those fields into it to
> eliminate the code duplication and improve maintainability.
>
> Signed-off-by: Costa Shulyupin <costa.shul@xxxxxxxxxx>
> ---

Thank you for the patch.

> +struct common_params {
> + /* trace configuration */
> + char *cpus;
> + cpu_set_t monitored_cpus;
> + struct trace_events *events;
> + int buffer_size;
> + char *trace_output;
> +
> + /* Timing parameters */
> + int warmup;
> + unsigned long long runtime;
> + long long stop_us;
> + long long stop_total_us;
> + int sleep_time;
> + int duration;
> +
> + /* Scheduling parameters */
> + int set_sched;
> + struct sched_attr sched_param;
> + int cgroup;
> + char *cgroup_name;
> + int hk_cpus;
> + cpu_set_t hk_cpu_set;
> +};

Some of these could be cleaned up further. E.g. "runtime" is actually
only used by osnoise, even though it is declared in timerlat, too, and
"period" is also used by timerlat, but it's called
"timerlat_period_us" there.

Nevertheless, that is directly not related to this patch, and tests
pass. We can fix that later.

Reviewed-by: Tomas Glozar <tglozar@xxxxxxxxxx>


Tomas