lkml.org 
[lkml]   [2022]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 09/12] perf test: Add 'brstack' test workload
Hi James,

On Wed, Nov 16, 2022 at 3:39 AM James Clark <james.clark@arm.com> wrote:
>
>
>
> On 10/11/2022 18:19, Namhyung Kim wrote:
> [...]
> > +
> > +#define BENCH_RUNS 999999
> > +
> > +static volatile int cnt;
> > +
> > +static void brstack_bar(void) {
> > +} /* return */
> > +
> > +static void brstack_foo(void) {
> > + brstack_bar(); /* call */
> > +} /* return */
> > +
> > +static void brstack_bench(void) {
> > + void (*brstack_foo_ind)(void) = brstack_foo;
> > +
> > + if ((cnt++) % 3) /* branch (cond) */
> > + brstack_foo(); /* call */
> > + brstack_bar(); /* call */
> > + brstack_foo_ind(); /* call (ind) */
> > +}
> > +
> > +static int brstack(int argc, const char **argv)
> > +{
> > + if (argc > 0)
> > + cnt = atoi(argv[0]);
> > +
> > + while (1) {
> > + if ((cnt++) > BENCH_RUNS)
> > + break;
>
> Hi Namhyung,
>
> I'm reading this as you can specify the number of loops as an argument.
>
> In that case should it be more like this?
>
> int num_loops = argc>0 ? atoi(argv[0]) : BENCH_RUNS;
>
> if ((cnt++) > num_loops)
> break;

Yep, that's more intuitive. Will change!

Thanks,
Namhyung

\
 
 \ /
  Last update: 2022-11-17 00:08    [W:0.328 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site