[igt-dev] [PATCH i-g-t 08/14] benchmarks/gem_wsim: reposition repeat_start variable

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Tue Sep 26 11:10:56 UTC 2023


On 26/09/2023 09:44, Marcin Bernatowicz wrote:
> No need for repeat_start in struct workload.
> It's now a variable in run_workload function scope.
> 
> Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz at linux.intel.com>
> ---
>   benchmarks/gem_wsim.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
> index daa20fb8a..2e6eb6388 100644
> --- a/benchmarks/gem_wsim.c
> +++ b/benchmarks/gem_wsim.c
> @@ -209,8 +209,6 @@ struct workload {
>   	uint32_t bb_prng;
>   	uint32_t bo_prng;
>   
> -	struct timespec repeat_start;
> -
>   	unsigned int nr_ctxs;
>   	struct ctx *ctx_list;
>   
> @@ -2283,7 +2281,7 @@ static void sync_deps(struct workload *wrk, struct w_step *w)
>   static void *run_workload(void *data)
>   {
>   	struct workload *wrk = (struct workload *)data;
> -	struct timespec t_start, t_end;
> +	struct timespec t_start, t_end, repeat_start;
>   	struct w_step *w;
>   	int throttle = -1;
>   	int qd_throttle = -1;
> @@ -2297,7 +2295,7 @@ static void *run_workload(void *data)
>   	     count++) {
>   		unsigned int cur_seqno = wrk->sync_seqno;
>   
> -		clock_gettime(CLOCK_MONOTONIC, &wrk->repeat_start);
> +		clock_gettime(CLOCK_MONOTONIC, &repeat_start);
>   
>   		for (i = 0, w = wrk->steps; wrk->run && (i < wrk->nr_steps);
>   		     i++, w++) {
> @@ -2311,7 +2309,7 @@ static void *run_workload(void *data)
>   				int elapsed;
>   
>   				clock_gettime(CLOCK_MONOTONIC, &now);
> -				elapsed = elapsed_us(&wrk->repeat_start, &now);
> +				elapsed = elapsed_us(&repeat_start, &now);
>   				do_sleep = w->period - elapsed;
>   				time_tot += elapsed;
>   				if (elapsed < time_min)

Looks like an innocent cleanup indeed.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Regards,

Tvrtko


More information about the igt-dev mailing list