lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 16 Nov 2022 15:06:49 -0800
From:   Namhyung Kim <namhyung@...nel.org>
To:     James Clark <james.clark@....com>
Cc:     Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Ian Rogers <irogers@...gle.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        linux-perf-users@...r.kernel.org, Leo Yan <leo.yan@...aro.org>,
        German Gomez <german.gomez@....com>,
        Zhengjun Xing <zhengjun.xing@...ux.intel.com>,
        Athira Jajeev <atrajeev@...ux.vnet.ibm.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>
Subject: Re: [PATCH 09/12] perf test: Add 'brstack' test workload

Hi James,

On Wed, Nov 16, 2022 at 3:39 AM James Clark <james.clark@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ