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]
Message-ID: <CAM9d7chGXx8_py96rvt1dKP31u+D7LjzD81_K4foojb5=6Uk-w@mail.gmail.com>
Date:   Tue, 13 Sep 2022 10:28:53 -0700
From:   Namhyung Kim <namhyung@...nel.org>
To:     Adrian Hunter <adrian.hunter@...el.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>, Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Ian Rogers <irogers@...gle.com>,
        linux-perf-users <linux-perf-users@...r.kernel.org>
Subject: Re: [PATCH 5/6] perf test: Add target workload test in perf record tests

Hi Adrian,

On Tue, Sep 13, 2022 at 4:03 AM Adrian Hunter <adrian.hunter@...el.com> wrote:
>
> On 7/09/22 09:46, Namhyung Kim wrote:
> > Add a subtest which profiles the given workload on the command line.
> > As it's a minimal requirement, test should run ok so it doesn't skip
> > the test even if it failed to run the perf record.
> >
> > Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> > ---
> >  tools/perf/tests/shell/record.sh | 31 +++++++++++++++++++++++++++++++
> >  1 file changed, 31 insertions(+)
> >
> > diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
> > index bd4ef60948bd..ff66e58f3a26 100755
> > --- a/tools/perf/tests/shell/record.sh
> > +++ b/tools/perf/tests/shell/record.sh
> > @@ -167,11 +167,42 @@ test_system_wide() {
> >    echo "Basic --system-wide mode test [Success]"
> >  }
> >
> > +test_workload() {
> > +  echo "Basic target workload test"
> > +  if ! perf record ${testopt} -o ${perfdata} ${testprog} 2> /dev/null
> > +  then
> > +    echo "Workload record [Failed record]"
> > +    err=1
> > +    return
> > +  fi
> > +  if ! perf report -i ${perfdata} -q | egrep -q ${testsym}
> > +  then
> > +    echo "Workload record [Failed missing output]"
> > +    err=1
> > +    return
> > +  fi
> > +  if ! perf record -e cpu-clock,cs --threads=package ${testopt} \
> > +    -o ${perfdata} ${testprog} 2> /dev/null
> > +  then
> > +    echo "Workload record [Failed recording with threads]"
> > +    err=1
> > +    return
> > +  fi
> > +  if ! perf report -i ${perfdata} -q | egrep -q ${testsym}
> > +  then
> > +    echo "Workload record [Failed missing output]"
>
> When testing, this was happening always until changing the delay
> from 3 to 1 ms.  It might be a bit racy to work consistently on
> different machines.
>
> Another approach is to wait for threads to appear in /proc/N/task
> like wait_for_threads() here:
>
>         https://lore.kernel.org/linux-perf-users/20220912083412.7058-12-adrian.hunter@intel.com/T/#u

Looks good.  Maybe we can move it to tests/shell/lib ?

Thanks,
Namhyung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ