From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id F3E4A10E3A3 for ; Tue, 26 Sep 2023 11:11:00 +0000 (UTC) Message-ID: <238ee381-c443-e43b-5b04-90c5f062d8fd@linux.intel.com> Date: Tue, 26 Sep 2023 12:10:56 +0100 MIME-Version: 1.0 Content-Language: en-US To: Marcin Bernatowicz , igt-dev@lists.freedesktop.org References: <20230926084451.1732748-1-marcin.bernatowicz@linux.intel.com> <20230926084451.1732748-9-marcin.bernatowicz@linux.intel.com> From: Tvrtko Ursulin In-Reply-To: <20230926084451.1732748-9-marcin.bernatowicz@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [igt-dev] [PATCH i-g-t 08/14] benchmarks/gem_wsim: reposition repeat_start variable List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: chris.p.wilson@linux.intel.com Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: 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 > --- > 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 Regards, Tvrtko