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: <ZGIjRWdxDkBBpMdA@kernel.org>
Date:   Mon, 15 May 2023 09:19:17 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Ian Rogers <irogers@...gle.com>
Cc:     Kan Liang <kan.liang@...ux.intel.com>,
        Ahmad Yasin <ahmad.yasin@...el.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Stephane Eranian <eranian@...gle.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Perry Taylor <perry.taylor@...el.com>,
        Samantha Alt <samantha.alt@...el.com>,
        Caleb Biggers <caleb.biggers@...el.com>,
        Weilin Wang <weilin.wang@...el.com>,
        Edward Baker <edward.baker@...el.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Florian Fischer <florian.fischer@...q.space>,
        Rob Herring <robh@...nel.org>,
        Zhengjun Xing <zhengjun.xing@...ux.intel.com>,
        John Garry <john.g.garry@...cle.com>,
        Kajol Jain <kjain@...ux.ibm.com>,
        Sumanth Korikkar <sumanthk@...ux.ibm.com>,
        Thomas Richter <tmricht@...ux.ibm.com>,
        Tiezhu Yang <yangtiezhu@...ngson.cn>,
        Ravi Bangoria <ravi.bangoria@....com>,
        Leo Yan <leo.yan@...aro.org>,
        Yang Jihong <yangjihong1@...wei.com>,
        James Clark <james.clark@....com>,
        Suzuki Poulouse <suzuki.poulose@....com>,
        Kang Minchul <tegongkang@...il.com>,
        Athira Rajeev <atrajeev@...ux.vnet.ibm.com>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] perf test: Add cputype testing to perf stat

Em Fri, May 12, 2023 at 11:34:47PM -0700, Ian Rogers escreveu:
> Check a bogus PMU fails and that a known PMU succeeds. Limit to PMUs
> known cpu, cpu_atom and armv8_pmuv3_0 ones.

Thanks, applied.

- Arnaldo

 
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
>  tools/perf/tests/shell/stat.sh | 44 ++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/tools/perf/tests/shell/stat.sh b/tools/perf/tests/shell/stat.sh
> index b154fbb15d54..3f1e67795490 100755
> --- a/tools/perf/tests/shell/stat.sh
> +++ b/tools/perf/tests/shell/stat.sh
> @@ -103,10 +103,54 @@ test_topdown_weak_groups() {
>    echo "Topdown weak groups test [Success]"
>  }
>  
> +test_cputype() {
> +  # Test --cputype argument.
> +  echo "cputype test"
> +
> +  # Bogus PMU should fail.
> +  if perf stat --cputype="123" -e instructions true > /dev/null 2>&1
> +  then
> +    echo "cputype test [Bogus PMU didn't fail]"
> +    err=1
> +    return
> +  fi
> +
> +  # Find a known PMU for cputype.
> +  pmu=""
> +  for i in cpu cpu_atom armv8_pmuv3_0
> +  do
> +    if test -d "/sys/devices/$i"
> +    then
> +      pmu="$i"
> +      break
> +    fi
> +    if perf stat -e "$i/instructions/" true > /dev/null 2>&1
> +    then
> +      pmu="$i"
> +      break
> +    fi
> +  done
> +  if test "x$pmu" = "x"
> +  then
> +    echo "cputype test [Skipped known PMU not found]"
> +    return
> +  fi
> +
> +  # Test running with cputype produces output.
> +  if ! perf stat --cputype="$pmu" -e instructions true 2>&1 | grep -E -q "instructions"
> +  then
> +    echo "cputype test [Failed count missed with given filter]"
> +    err=1
> +    return
> +  fi
> +  echo "cputype test [Success]"
> +}
> +
>  test_default_stat
>  test_stat_record_report
>  test_stat_record_script
>  test_stat_repeat_weak_groups
>  test_topdown_groups
>  test_topdown_weak_groups
> +test_cputype
>  exit $err
> -- 
> 2.40.1.606.ga4b1b128d6-goog
> 

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ