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] [thread-next>] [day] [month] [year] [list]
Message-ID: <YnqedF9WI//2oXw2@kernel.org>
Date:   Tue, 10 May 2022 14:18:44 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Adrian Hunter <adrian.hunter@...el.com>
Cc:     Jiri Olsa <jolsa@...hat.com>, Ian Rogers <irogers@...gle.com>,
        Alexey Bayduraev <alexey.v.bayduraev@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Leo Yan <leo.yan@...aro.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 01/23] perf intel-pt: Add a test for system-wide side
 band

Em Fri, May 06, 2022 at 03:25:39PM +0300, Adrian Hunter escreveu:
> Add a test for system-wide side band even when tracing selected CPUs.
> 
> Tested-by: Ian Rogers <irogers@...gle.com>
> Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>


[root@...co ~]# uname -a
Linux quaco 5.16.13-200.fc35.x86_64 #1 SMP PREEMPT Tue Mar 8 22:50:58 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@...co ~]# grep -m1 -i "model name" /proc/cpuinfo 
model name	: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
[root@...co ~]# perf test -v Misc
 97: Miscellaneous Intel PT testing                                  :
--- start ---
test child forked, pid 769475
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 1.352 MB /tmp/tmp.Ty4Rqnz4vz ]
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 1.352 MB /tmp/tmp.Ty4Rqnz4vz ]
Linux
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 1.446 MB /tmp/tmp.TnEqenwzZv ]
Failed to record MMAP events on CPU 1 when tracing CPU 0
test child finished with -1
---- end ----
Miscellaneous Intel PT testing: FAILED!
[root@...co ~]# 

Do I need some more recent machine or kernel?

- Arnaldo

> ---
>  tools/perf/tests/shell/test_intel_pt.sh | 71 +++++++++++++++++++++++++
>  1 file changed, 71 insertions(+)
>  create mode 100755 tools/perf/tests/shell/test_intel_pt.sh
> 
> diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/shell/test_intel_pt.sh
> new file mode 100755
> index 000000000000..a3298643884d
> --- /dev/null
> +++ b/tools/perf/tests/shell/test_intel_pt.sh
> @@ -0,0 +1,71 @@
> +#!/bin/sh
> +# Miscellaneous Intel PT testing
> +# SPDX-License-Identifier: GPL-2.0
> +
> +set -e
> +
> +# Skip if no Intel PT
> +perf list | grep -q 'intel_pt//' || exit 2
> +
> +skip_cnt=0
> +ok_cnt=0
> +err_cnt=0
> +
> +tmpfile=`mktemp`
> +perfdatafile=`mktemp`
> +
> +can_cpu_wide()
> +{
> +	perf record -o ${tmpfile} -B -N --no-bpf-event -e dummy:u -C $1 true 2>&1 >/dev/null || return 2
> +	return 0
> +}
> +
> +test_system_wide_side_band()
> +{
> +	# Need CPU 0 and CPU 1
> +	can_cpu_wide 0 || return $?
> +	can_cpu_wide 1 || return $?
> +
> +	# Record on CPU 0 a task running on CPU 1
> +	perf record -B -N --no-bpf-event -o ${perfdatafile} -e intel_pt//u -C 0 -- taskset --cpu-list 1 uname
> +
> +	# Should get MMAP events from CPU 1 because they can be needed to decode
> +	mmap_cnt=`perf script -i ${perfdatafile} --no-itrace --show-mmap-events -C 1 2>/dev/null | grep MMAP | wc -l`
> +
> +	if [ ${mmap_cnt} -gt 0 ] ; then
> +		return 0
> +	fi
> +
> +	echo "Failed to record MMAP events on CPU 1 when tracing CPU 0"
> +	return 1
> +}
> +
> +count_result()
> +{
> +	if [ $1 -eq 2 ] ; then
> +		skip_cnt=`expr ${skip_cnt} \+ 1`
> +		return
> +	fi
> +	if [ $1 -eq 0 ] ; then
> +		ok_cnt=`expr ${ok_cnt} \+ 1`
> +		return
> +	fi
> +	err_cnt=`expr ${err_cnt} \+ 1`
> +}
> +
> +test_system_wide_side_band
> +
> +count_result $?
> +
> +rm -f ${tmpfile}
> +rm -f ${perfdatafile}
> +
> +if [ ${err_cnt} -gt 0 ] ; then
> +	exit 1
> +fi
> +
> +if [ ${ok_cnt} -gt 0 ] ; then
> +	exit 0
> +fi
> +
> +exit 2
> -- 
> 2.25.1

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ