2018-06-19 23:52:43

by Kim Phillips

[permalink] [raw]
Subject: [PATCH 2/2] perf test shell: make perf inet_pton test more portable

Debian based systems such as Ubuntu have dash as their default shell.
Even if the normal or root user's shell is bash, certain scripts still
call /bin/sh, which points to dash, so we fix this perf test by
rewriting it in a more portable way.

BEFORE:

$ sudo ./perf test -v 64
64: probe libc's inet_pton & backtrace it with ping :
--- start ---
test child forked, pid 31942
./tests/shell/record+probe_libc_inet_pton.sh: 18: ./tests/shell/record+probe_libc_inet_pton.sh: expected[0]=ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\): not found
./tests/shell/record+probe_libc_inet_pton.sh: 19: ./tests/shell/record+probe_libc_inet_pton.sh: expected[1]=.*inet_pton\+0x[[:xdigit:]]+[[:space:]]\(/lib/x86_64-linux-gnu/libc-2.27.so|inlined\)$: not found
./tests/shell/record+probe_libc_inet_pton.sh: 29: ./tests/shell/record+probe_libc_inet_pton.sh: expected[2]=getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\(/lib/x86_64-linux-gnu/libc-2.27.so\)$: not found
./tests/shell/record+probe_libc_inet_pton.sh: 30: ./tests/shell/record+probe_libc_inet_pton.sh: expected[3]=.*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$: not found
ping 31963 [004] 83577.670613: probe_libc:inet_pton: (7fe15f87f4b0)
./tests/shell/record+probe_libc_inet_pton.sh: 39: ./tests/shell/record+probe_libc_inet_pton.sh: Bad substitution
./tests/shell/record+probe_libc_inet_pton.sh: 41: ./tests/shell/record+probe_libc_inet_pton.sh: Bad substitution
test child finished with -2
---- end ----
probe libc's inet_pton & backtrace it with ping: Skip

AFTER:

64: probe libc's inet_pton & backtrace it with ping :
--- start ---
test child forked, pid 32277
ping 32295 [001] 83679.690020: probe_libc:inet_pton: (7ff244f504b0)
7ff244f504b0 __GI___inet_pton+0x0 (/lib/x86_64-linux-gnu/libc-2.27.so)
7ff244f14ce4 getaddrinfo+0x124 (/lib/x86_64-linux-gnu/libc-2.27.so)
556ac036b57d _init+0xb75 (/bin/ping)
test child finished with 0
---- end ----
probe libc's inet_pton & backtrace it with ping: Ok

Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Thomas Richter <[email protected]>
Cc: Michael Petlan <[email protected]>
Cc: "Hendrik Br?ckner" <[email protected]>
Cc: Sandipan Das <[email protected]>
Signed-off-by: Kim Phillips <[email protected]>
---
Fixed using fake array technique described here:

https://www.linuxquestions.org/questions/programming-9/basic-bash-how-to-use-eval-to-evaluate-variable-names-made-of-arbitrary-strings-775622/

Note that bashisms can also be found with 'checkbashisms':

$ checkbashisms record+probe_libc_inet_pton.sh
script record+probe_libc_inet_pton.sh does not appear to have a #! interpreter line;
you may get strange results
possible bashism in record+probe_libc_inet_pton.sh line 18 (bash arrays, H[0]):
expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
possible bashism in record+probe_libc_inet_pton.sh line 19 (bash arrays, H[0]):
expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
possible bashism in record+probe_libc_inet_pton.sh line 23 (bash arrays, H[0]):
expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
possible bashism in record+probe_libc_inet_pton.sh line 24 (bash arrays, H[0]):
expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
possible bashism in record+probe_libc_inet_pton.sh line 25 (bash arrays, H[0]):
expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
possible bashism in record+probe_libc_inet_pton.sh line 29 (bash arrays, H[0]):
expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
possible bashism in record+probe_libc_inet_pton.sh line 30 (bash arrays, H[0]):
expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
possible bashism in record+probe_libc_inet_pton.sh line 39 (bash arrays, ${name[0|*|@]}):
echo "$line" | egrep -q "${expected[$idx]}"
possible bashism in record+probe_libc_inet_pton.sh line 41 (bash arrays, ${name[0|*|@]}):
printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${expected[$idx]}" "$line"
possible bashism in record+probe_libc_inet_pton.sh line 44 (let ...):
let idx+=1
possible bashism in record+probe_libc_inet_pton.sh line 45 (bash arrays, ${name[0|*|@]}):
[ -z "${expected[$idx]}" ] && break

.../shell/record+probe_libc_inet_pton.sh | 23 ++++++++++---------
1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
index 263057039693..41124fa12913 100755
--- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
+++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
@@ -15,19 +15,20 @@ nm -Dg $libc 2>/dev/null | fgrep -q inet_pton || exit 254

trace_libc_inet_pton_backtrace() {
idx=0
- expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
- expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
+ expected='expected'
+ eval ${expected}0="'ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)'"
+ eval ${expected}1="'.*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$'"
case "$(uname -m)" in
s390x)
eventattr='call-graph=dwarf,max-stack=4'
- expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
- expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
- expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
+ eval ${expected}2="'gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$'"
+ eval ${expected}3="'(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$'"
+ eval ${expected}4="'main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$'"
;;
*)
eventattr='max-stack=3'
- expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
- expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
+ eval ${expected}2="'getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$'"
+ eval ${expected}3="'.*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$'"
;;
esac

@@ -36,13 +37,13 @@ trace_libc_inet_pton_backtrace() {
perf record -e probe_libc:inet_pton/$eventattr/ -o $file ping -6 -c 1 ::1 > /dev/null 2>&1
perf script -i $file | while read line ; do
echo $line
- echo "$line" | egrep -q "${expected[$idx]}"
+ echo "$line" | egrep -q "$(echo $(eval echo \$$expected${idx}))"
if [ $? -ne 0 ] ; then
- printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${expected[$idx]}" "$line"
+ printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "$(echo $(eval echo \$$expected${idx}))" "$line"
exit 1
fi
- let idx+=1
- [ -z "${expected[$idx]}" ] && break
+ idx=$((idx+1))
+ [ -z "$(echo $(eval echo \$$expected${idx}))" ] && break
done

# If any statements are executed from this point onwards,
--
2.17.1



2018-06-20 09:17:24

by Thomas Richter

[permalink] [raw]
Subject: Re: [PATCH 2/2] perf test shell: make perf inet_pton test more portable

On 06/20/2018 01:49 AM, Kim Phillips wrote:
> Debian based systems such as Ubuntu have dash as their default shell.
> Even if the normal or root user's shell is bash, certain scripts still
> call /bin/sh, which points to dash, so we fix this perf test by
> rewriting it in a more portable way.
>
> BEFORE:
>
> $ sudo ./perf test -v 64
> 64: probe libc's inet_pton & backtrace it with ping :
> --- start ---
> test child forked, pid 31942
> ./tests/shell/record+probe_libc_inet_pton.sh: 18: ./tests/shell/record+probe_libc_inet_pton.sh: expected[0]=ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\): not found
> ./tests/shell/record+probe_libc_inet_pton.sh: 19: ./tests/shell/record+probe_libc_inet_pton.sh: expected[1]=.*inet_pton\+0x[[:xdigit:]]+[[:space:]]\(/lib/x86_64-linux-gnu/libc-2.27.so|inlined\)$: not found
> ./tests/shell/record+probe_libc_inet_pton.sh: 29: ./tests/shell/record+probe_libc_inet_pton.sh: expected[2]=getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\(/lib/x86_64-linux-gnu/libc-2.27.so\)$: not found
> ./tests/shell/record+probe_libc_inet_pton.sh: 30: ./tests/shell/record+probe_libc_inet_pton.sh: expected[3]=.*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$: not found
> ping 31963 [004] 83577.670613: probe_libc:inet_pton: (7fe15f87f4b0)
> ./tests/shell/record+probe_libc_inet_pton.sh: 39: ./tests/shell/record+probe_libc_inet_pton.sh: Bad substitution
> ./tests/shell/record+probe_libc_inet_pton.sh: 41: ./tests/shell/record+probe_libc_inet_pton.sh: Bad substitution
> test child finished with -2
> ---- end ----
> probe libc's inet_pton & backtrace it with ping: Skip
>
> AFTER:
>
> 64: probe libc's inet_pton & backtrace it with ping :
> --- start ---
> test child forked, pid 32277
> ping 32295 [001] 83679.690020: probe_libc:inet_pton: (7ff244f504b0)
> 7ff244f504b0 __GI___inet_pton+0x0 (/lib/x86_64-linux-gnu/libc-2.27.so)
> 7ff244f14ce4 getaddrinfo+0x124 (/lib/x86_64-linux-gnu/libc-2.27.so)
> 556ac036b57d _init+0xb75 (/bin/ping)
> test child finished with 0
> ---- end ----
> probe libc's inet_pton & backtrace it with ping: Ok
>
> Cc: Arnaldo Carvalho de Melo <[email protected]>
> Cc: Peter Zijlstra <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: Alexander Shishkin <[email protected]>
> Cc: Jiri Olsa <[email protected]>
> Cc: Namhyung Kim <[email protected]>
> Cc: Thomas Richter <[email protected]>
> Cc: Michael Petlan <[email protected]>
> Cc: "Hendrik Brückner" <[email protected]>
> Cc: Sandipan Das <[email protected]>
> Signed-off-by: Kim Phillips <[email protected]>
> ---
> Fixed using fake array technique described here:
>
> https://www.linuxquestions.org/questions/programming-9/basic-bash-how-to-use-eval-to-evaluate-variable-names-made-of-arbitrary-strings-775622/
>
> Note that bashisms can also be found with 'checkbashisms':
>
> $ checkbashisms record+probe_libc_inet_pton.sh
> script record+probe_libc_inet_pton.sh does not appear to have a #! interpreter line;
> you may get strange results
> possible bashism in record+probe_libc_inet_pton.sh line 18 (bash arrays, H[0]):
> expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
> possible bashism in record+probe_libc_inet_pton.sh line 19 (bash arrays, H[0]):
> expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> possible bashism in record+probe_libc_inet_pton.sh line 23 (bash arrays, H[0]):
> expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> possible bashism in record+probe_libc_inet_pton.sh line 24 (bash arrays, H[0]):
> expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> possible bashism in record+probe_libc_inet_pton.sh line 25 (bash arrays, H[0]):
> expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> possible bashism in record+probe_libc_inet_pton.sh line 29 (bash arrays, H[0]):
> expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
> possible bashism in record+probe_libc_inet_pton.sh line 30 (bash arrays, H[0]):
> expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> possible bashism in record+probe_libc_inet_pton.sh line 39 (bash arrays, ${name[0|*|@]}):
> echo "$line" | egrep -q "${expected[$idx]}"
> possible bashism in record+probe_libc_inet_pton.sh line 41 (bash arrays, ${name[0|*|@]}):
> printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${expected[$idx]}" "$line"
> possible bashism in record+probe_libc_inet_pton.sh line 44 (let ...):
> let idx+=1
> possible bashism in record+probe_libc_inet_pton.sh line 45 (bash arrays, ${name[0|*|@]}):
> [ -z "${expected[$idx]}" ] && break
>
> .../shell/record+probe_libc_inet_pton.sh | 23 ++++++++++---------
> 1 file changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> index 263057039693..41124fa12913 100755
> --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> @@ -15,19 +15,20 @@ nm -Dg $libc 2>/dev/null | fgrep -q inet_pton || exit 254
>
> trace_libc_inet_pton_backtrace() {
> idx=0
> - expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
> - expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> + expected='expected'
> + eval ${expected}0="'ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)'"
> + eval ${expected}1="'.*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$'"
> case "$(uname -m)" in
> s390x)
> eventattr='call-graph=dwarf,max-stack=4'
> - expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> - expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> - expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> + eval ${expected}2="'gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$'"
> + eval ${expected}3="'(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$'"
> + eval ${expected}4="'main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$'"
> ;;
> *)
> eventattr='max-stack=3'
> - expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
> - expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> + eval ${expected}2="'getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$'"
> + eval ${expected}3="'.*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$'"
> ;;
> esac
>
> @@ -36,13 +37,13 @@ trace_libc_inet_pton_backtrace() {
> perf record -e probe_libc:inet_pton/$eventattr/ -o $file ping -6 -c 1 ::1 > /dev/null 2>&1
> perf script -i $file | while read line ; do
> echo $line
> - echo "$line" | egrep -q "${expected[$idx]}"
> + echo "$line" | egrep -q "$(echo $(eval echo \$$expected${idx}))"
> if [ $? -ne 0 ] ; then
> - printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${expected[$idx]}" "$line"
> + printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "$(echo $(eval echo \$$expected${idx}))" "$line"
> exit 1
> fi
> - let idx+=1
> - [ -z "${expected[$idx]}" ] && break
> + idx=$((idx+1))
> + [ -z "$(echo $(eval echo \$$expected${idx}))" ] && break
> done
>
> # If any statements are executed from this point onwards,
>

I tried it on my s390 and it works nicely.

Tested-by: Thomas Richter <[email protected]>

--
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294


2018-06-20 13:47:50

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH 2/2] perf test shell: make perf inet_pton test more portable

Em Tue, Jun 19, 2018 at 06:49:52PM -0500, Kim Phillips escreveu:
> Debian based systems such as Ubuntu have dash as their default shell.
> Even if the normal or root user's shell is bash, certain scripts still
> call /bin/sh, which points to dash, so we fix this perf test by
> rewriting it in a more portable way.

Isn't it better to just make /bin/bash a requirement for these tests?

I think the alternative is cryptic :-\

Thanks,

- Arnaldo

> BEFORE:
>
> $ sudo ./perf test -v 64
> 64: probe libc's inet_pton & backtrace it with ping :
> --- start ---
> test child forked, pid 31942
> ./tests/shell/record+probe_libc_inet_pton.sh: 18: ./tests/shell/record+probe_libc_inet_pton.sh: expected[0]=ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\): not found
> ./tests/shell/record+probe_libc_inet_pton.sh: 19: ./tests/shell/record+probe_libc_inet_pton.sh: expected[1]=.*inet_pton\+0x[[:xdigit:]]+[[:space:]]\(/lib/x86_64-linux-gnu/libc-2.27.so|inlined\)$: not found
> ./tests/shell/record+probe_libc_inet_pton.sh: 29: ./tests/shell/record+probe_libc_inet_pton.sh: expected[2]=getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\(/lib/x86_64-linux-gnu/libc-2.27.so\)$: not found
> ./tests/shell/record+probe_libc_inet_pton.sh: 30: ./tests/shell/record+probe_libc_inet_pton.sh: expected[3]=.*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$: not found
> ping 31963 [004] 83577.670613: probe_libc:inet_pton: (7fe15f87f4b0)
> ./tests/shell/record+probe_libc_inet_pton.sh: 39: ./tests/shell/record+probe_libc_inet_pton.sh: Bad substitution
> ./tests/shell/record+probe_libc_inet_pton.sh: 41: ./tests/shell/record+probe_libc_inet_pton.sh: Bad substitution
> test child finished with -2
> ---- end ----
> probe libc's inet_pton & backtrace it with ping: Skip
>
> AFTER:
>
> 64: probe libc's inet_pton & backtrace it with ping :
> --- start ---
> test child forked, pid 32277
> ping 32295 [001] 83679.690020: probe_libc:inet_pton: (7ff244f504b0)
> 7ff244f504b0 __GI___inet_pton+0x0 (/lib/x86_64-linux-gnu/libc-2.27.so)
> 7ff244f14ce4 getaddrinfo+0x124 (/lib/x86_64-linux-gnu/libc-2.27.so)
> 556ac036b57d _init+0xb75 (/bin/ping)
> test child finished with 0
> ---- end ----
> probe libc's inet_pton & backtrace it with ping: Ok
>
> Cc: Arnaldo Carvalho de Melo <[email protected]>
> Cc: Peter Zijlstra <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: Alexander Shishkin <[email protected]>
> Cc: Jiri Olsa <[email protected]>
> Cc: Namhyung Kim <[email protected]>
> Cc: Thomas Richter <[email protected]>
> Cc: Michael Petlan <[email protected]>
> Cc: "Hendrik Br?ckner" <[email protected]>
> Cc: Sandipan Das <[email protected]>
> Signed-off-by: Kim Phillips <[email protected]>
> ---
> Fixed using fake array technique described here:
>
> https://www.linuxquestions.org/questions/programming-9/basic-bash-how-to-use-eval-to-evaluate-variable-names-made-of-arbitrary-strings-775622/
>
> Note that bashisms can also be found with 'checkbashisms':
>
> $ checkbashisms record+probe_libc_inet_pton.sh
> script record+probe_libc_inet_pton.sh does not appear to have a #! interpreter line;
> you may get strange results
> possible bashism in record+probe_libc_inet_pton.sh line 18 (bash arrays, H[0]):
> expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
> possible bashism in record+probe_libc_inet_pton.sh line 19 (bash arrays, H[0]):
> expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> possible bashism in record+probe_libc_inet_pton.sh line 23 (bash arrays, H[0]):
> expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> possible bashism in record+probe_libc_inet_pton.sh line 24 (bash arrays, H[0]):
> expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> possible bashism in record+probe_libc_inet_pton.sh line 25 (bash arrays, H[0]):
> expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> possible bashism in record+probe_libc_inet_pton.sh line 29 (bash arrays, H[0]):
> expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
> possible bashism in record+probe_libc_inet_pton.sh line 30 (bash arrays, H[0]):
> expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> possible bashism in record+probe_libc_inet_pton.sh line 39 (bash arrays, ${name[0|*|@]}):
> echo "$line" | egrep -q "${expected[$idx]}"
> possible bashism in record+probe_libc_inet_pton.sh line 41 (bash arrays, ${name[0|*|@]}):
> printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${expected[$idx]}" "$line"
> possible bashism in record+probe_libc_inet_pton.sh line 44 (let ...):
> let idx+=1
> possible bashism in record+probe_libc_inet_pton.sh line 45 (bash arrays, ${name[0|*|@]}):
> [ -z "${expected[$idx]}" ] && break
>
> .../shell/record+probe_libc_inet_pton.sh | 23 ++++++++++---------
> 1 file changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> index 263057039693..41124fa12913 100755
> --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> @@ -15,19 +15,20 @@ nm -Dg $libc 2>/dev/null | fgrep -q inet_pton || exit 254
>
> trace_libc_inet_pton_backtrace() {
> idx=0
> - expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
> - expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> + expected='expected'
> + eval ${expected}0="'ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)'"
> + eval ${expected}1="'.*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$'"
> case "$(uname -m)" in
> s390x)
> eventattr='call-graph=dwarf,max-stack=4'
> - expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> - expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> - expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> + eval ${expected}2="'gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$'"
> + eval ${expected}3="'(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$'"
> + eval ${expected}4="'main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$'"
> ;;
> *)
> eventattr='max-stack=3'
> - expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
> - expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> + eval ${expected}2="'getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$'"
> + eval ${expected}3="'.*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$'"
> ;;
> esac
>
> @@ -36,13 +37,13 @@ trace_libc_inet_pton_backtrace() {
> perf record -e probe_libc:inet_pton/$eventattr/ -o $file ping -6 -c 1 ::1 > /dev/null 2>&1
> perf script -i $file | while read line ; do
> echo $line
> - echo "$line" | egrep -q "${expected[$idx]}"
> + echo "$line" | egrep -q "$(echo $(eval echo \$$expected${idx}))"
> if [ $? -ne 0 ] ; then
> - printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${expected[$idx]}" "$line"
> + printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "$(echo $(eval echo \$$expected${idx}))" "$line"
> exit 1
> fi
> - let idx+=1
> - [ -z "${expected[$idx]}" ] && break
> + idx=$((idx+1))
> + [ -z "$(echo $(eval echo \$$expected${idx}))" ] && break
> done
>
> # If any statements are executed from this point onwards,
> --
> 2.17.1

2018-06-21 00:46:45

by Kim Phillips

[permalink] [raw]
Subject: Re: [PATCH 2/2] perf test shell: make perf inet_pton test more portable

On Wed, 20 Jun 2018 10:46:22 -0300
Arnaldo Carvalho de Melo <[email protected]> wrote:

> Em Tue, Jun 19, 2018 at 06:49:52PM -0500, Kim Phillips escreveu:
> > Debian based systems such as Ubuntu have dash as their default shell.
> > Even if the normal or root user's shell is bash, certain scripts still
> > call /bin/sh, which points to dash, so we fix this perf test by
> > rewriting it in a more portable way.
>
> Isn't it better to just make /bin/bash a requirement for these tests?

Perf is more bug-prone in distributions other than its main developers'
distributions, and when its own built-in tests start depending on those
same (primary) distributions' preferences, tests start to get skipped
on the secondary ones, which start to get subsequently ignored and
become acceptable to testers, which is a whole pattern I'd like to
avoid if at all possible. I'd eventually like to see the real perf run
on Android, for example, and adding bash to Android is nontrivial,
AFAICT.

> I think the alternative is cryptic :-\

I think that's because of the fake array stuff, which technically isn't
needed by design. How about something like the following?

diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
index 263057039693..d5cceaeba42d 100755
--- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
+++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
@@ -14,20 +14,21 @@ libc=$(grep -w libc /proc/self/maps | head -1 | sed -r 's/.*[[:space:]](\/.*)/\1
nm -Dg $libc 2>/dev/null | fgrep -q inet_pton || exit 254

trace_libc_inet_pton_backtrace() {
+ newline='\n'
idx=0
- expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
- expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
+ expected="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
+ expected="${expected}${newline}.*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
case "$(uname -m)" in
s390x)
eventattr='call-graph=dwarf,max-stack=4'
- expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
- expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
- expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
+ expected="${expected}${newline}gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
+ expected="${expected}${newline}(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
+ expected="${expected}${newline}main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
;;
*)
eventattr='max-stack=3'
- expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
- expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
+ expected="${expected}${newline}getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
+ expected="${expected}${newline}.*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
;;
esac

@@ -35,14 +36,16 @@ trace_libc_inet_pton_backtrace() {

perf record -e probe_libc:inet_pton/$eventattr/ -o $file ping -6 -c 1 ::1 > /dev/null 2>&1
perf script -i $file | while read line ; do
+ [ -z "${line}" ] && break
echo $line
- echo "$line" | egrep -q "${expected[$idx]}"
+ idx=$((idx + 1))
+ first="$(echo ${expected} | head -$idx | tail -1)"
+ [ -z "${first}" ] && break
+ echo "$line" | egrep -q "$first"
if [ $? -ne 0 ] ; then
- printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${expected[$idx]}" "$line"
+ printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${first}" "$line"
exit 1
fi
- let idx+=1
- [ -z "${expected[$idx]}" ] && break
done

# If any statements are executed from this point onwards,

Thanks,

Kim

2018-06-21 14:20:30

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH 2/2] perf test shell: make perf inet_pton test more portable

Em Wed, Jun 20, 2018 at 07:45:46PM -0500, Kim Phillips escreveu:
> On Wed, 20 Jun 2018 10:46:22 -0300
> Arnaldo Carvalho de Melo <[email protected]> wrote:
>
> > Em Tue, Jun 19, 2018 at 06:49:52PM -0500, Kim Phillips escreveu:
> > > Debian based systems such as Ubuntu have dash as their default shell.
> > > Even if the normal or root user's shell is bash, certain scripts still
> > > call /bin/sh, which points to dash, so we fix this perf test by
> > > rewriting it in a more portable way.
> >
> > Isn't it better to just make /bin/bash a requirement for these tests?
>
> Perf is more bug-prone in distributions other than its main developers'
> distributions, and when its own built-in tests start depending on those
> same (primary) distributions' preferences, tests start to get skipped
> on the secondary ones, which start to get subsequently ignored and

That is a valid concern, I test build it on many, many distros, running
'perf test' in all of them was always in the backlog, I guess this is
the time for me to try and have it running on them all, running
privileged containers so that all the tests can run there, perhaps some
will need to be tweaked to skip when running on a container environment,
hopefully not.

For reference, before pushing upstream all these environments are test
built, many with all the devel libraries to exercise building with all
the features present in the codebase, both with and without libelf, with
gcc and when available, with clang as well:

1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0
2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822
3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0
4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0
5 alpine:edge : Ok gcc (Alpine 6.4.0) 6.4.0
6 amazonlinux:1 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
7 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
8 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
9 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
10 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55)
11 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
12 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
13 debian:7 : Ok gcc (Debian 4.7.2-5) 4.7.2
14 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u1) 4.9.2
15 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
16 debian:experimental : Ok gcc (Debian 7.3.0-15) 7.3.0
17 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 7.3.0-15) 7.3.0
18 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 7.3.0-19) 7.3.0
19 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 7.3.0-18) 7.3.0
20 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 7.3.0-20) 7.3.0
21 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
22 fedora:21 : Ok gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
23 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
24 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
25 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
26 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710
27 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
28 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2)
29 fedora:27 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
30 fedora:28 : Ok gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20)
31 fedora:rawhide : Ok gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20)
32 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 6.4.0-r1 p1.3) 6.4.0
33 mageia:5 : Ok gcc (GCC) 4.9.2
34 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0
35 opensuse:42.1 : Ok gcc (SUSE Linux) 4.8.5
36 opensuse:42.2 : Ok gcc (SUSE Linux) 4.8.5
37 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5
38 opensuse:tumbleweed : Ok gcc (SUSE Linux) 7.3.1 20180323 [gcc-7-branch revision 258812]
39 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18.0.7)
40 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28.0.1)
41 ubuntu:12.04.5 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
42 ubuntu:14.04.4 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
43 ubuntu:14.04.4-x-linaro-arm64 : Ok aarch64-linux-gnu-gcc (Linaro GCC 5.4-2017.05) 5.4.1 20170404
44 ubuntu:15.04 : Ok gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
45 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
46 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
47 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
48 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
49 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
50 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
51 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
52 ubuntu:16.10 : Ok gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
53 ubuntu:17.04 : Ok gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
54 ubuntu:17.10 : Ok gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0
55 ubuntu:18.04 : Ok gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0

So I'll try running it on the non-cross-builds (x-something) containers,
because so far I'm just running these on x86_64 as the host machine.

> become acceptable to testers, which is a whole pattern I'd like to
> avoid if at all possible. I'd eventually like to see the real perf run

Agreed.

> on Android, for example, and adding bash to Android is nontrivial,
> AFAICT.

Fair enough.

> > I think the alternative is cryptic :-\
>
> I think that's because of the fake array stuff, which technically isn't
> needed by design. How about something like the following?

Thanks for trying to address my concern, looking...

> diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> index 263057039693..d5cceaeba42d 100755
> --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> @@ -14,20 +14,21 @@ libc=$(grep -w libc /proc/self/maps | head -1 | sed -r 's/.*[[:space:]](\/.*)/\1
> nm -Dg $libc 2>/dev/null | fgrep -q inet_pton || exit 254
>
> trace_libc_inet_pton_backtrace() {
> + newline='\n'
> idx=0
> - expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
> - expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> + expected="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
> + expected="${expected}${newline}.*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> case "$(uname -m)" in
> s390x)
> eventattr='call-graph=dwarf,max-stack=4'
> - expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> - expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> - expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> + expected="${expected}${newline}gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> + expected="${expected}${newline}(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> + expected="${expected}${newline}main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> ;;
> *)
> eventattr='max-stack=3'
> - expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
> - expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> + expected="${expected}${newline}getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
> + expected="${expected}${newline}.*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> ;;
> esac
>
> @@ -35,14 +36,16 @@ trace_libc_inet_pton_backtrace() {
>
> perf record -e probe_libc:inet_pton/$eventattr/ -o $file ping -6 -c 1 ::1 > /dev/null 2>&1
> perf script -i $file | while read line ; do
> + [ -z "${line}" ] && break
> echo $line
> - echo "$line" | egrep -q "${expected[$idx]}"
> + idx=$((idx + 1))
> + first="$(echo ${expected} | head -$idx | tail -1)"
> + [ -z "${first}" ] && break
> + echo "$line" | egrep -q "$first"
> if [ $? -ne 0 ] ; then
> - printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${expected[$idx]}" "$line"
> + printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${first}" "$line"
> exit 1
> fi
> - let idx+=1
> - [ -z "${expected[$idx]}" ] && break
> done
>
> # If any statements are executed from this point onwards,
>
> Thanks,
>
> Kim

2018-06-21 15:19:45

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH 2/2] perf test shell: make perf inet_pton test more portable

Em Thu, Jun 21, 2018 at 11:19:15AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Jun 20, 2018 at 07:45:46PM -0500, Kim Phillips escreveu:
> > On Wed, 20 Jun 2018 10:46:22 -0300
> > Arnaldo Carvalho de Melo <[email protected]> wrote:
> >
> > > Em Tue, Jun 19, 2018 at 06:49:52PM -0500, Kim Phillips escreveu:
> > > > Debian based systems such as Ubuntu have dash as their default shell.
> > > > Even if the normal or root user's shell is bash, certain scripts still
> > > > call /bin/sh, which points to dash, so we fix this perf test by
> > > > rewriting it in a more portable way.
> > >
> > > Isn't it better to just make /bin/bash a requirement for these tests?
> >
> > Perf is more bug-prone in distributions other than its main developers'
> > distributions, and when its own built-in tests start depending on those
> > same (primary) distributions' preferences, tests start to get skipped
> > on the secondary ones, which start to get subsequently ignored and
>
> That is a valid concern, I test build it on many, many distros, running
> 'perf test' in all of them was always in the backlog, I guess this is
> the time for me to try and have it running on them all, running
> privileged containers so that all the tests can run there, perhaps some
> will need to be tweaked to skip when running on a container environment,
> hopefully not.
>
> For reference, before pushing upstream all these environments are test
> built, many with all the devel libraries to exercise building with all
> the features present in the codebase, both with and without libelf, with
> gcc and when available, with clang as well:
>
> 1 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0
> 2 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822
> 3 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0
> 4 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0
> 5 alpine:edge : Ok gcc (Alpine 6.4.0) 6.4.0
> 6 amazonlinux:1 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
> 7 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
> 8 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
> 9 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
> 10 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55)
> 11 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
> 12 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
> 13 debian:7 : Ok gcc (Debian 4.7.2-5) 4.7.2
> 14 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u1) 4.9.2
> 15 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
> 16 debian:experimental : Ok gcc (Debian 7.3.0-15) 7.3.0
> 17 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 7.3.0-15) 7.3.0
> 18 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 7.3.0-19) 7.3.0
> 19 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 7.3.0-18) 7.3.0
> 20 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 7.3.0-20) 7.3.0
> 21 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
> 22 fedora:21 : Ok gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
> 23 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
> 24 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
> 25 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
> 26 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710
> 27 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
> 28 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2)
> 29 fedora:27 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
> 30 fedora:28 : Ok gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20)
> 31 fedora:rawhide : Ok gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20)
> 32 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 6.4.0-r1 p1.3) 6.4.0
> 33 mageia:5 : Ok gcc (GCC) 4.9.2
> 34 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0
> 35 opensuse:42.1 : Ok gcc (SUSE Linux) 4.8.5
> 36 opensuse:42.2 : Ok gcc (SUSE Linux) 4.8.5
> 37 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5
> 38 opensuse:tumbleweed : Ok gcc (SUSE Linux) 7.3.1 20180323 [gcc-7-branch revision 258812]
> 39 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18.0.7)
> 40 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28.0.1)
> 41 ubuntu:12.04.5 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
> 42 ubuntu:14.04.4 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
> 43 ubuntu:14.04.4-x-linaro-arm64 : Ok aarch64-linux-gnu-gcc (Linaro GCC 5.4-2017.05) 5.4.1 20170404
> 44 ubuntu:15.04 : Ok gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
> 45 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
> 46 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
> 47 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
> 48 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
> 49 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
> 50 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
> 51 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
> 52 ubuntu:16.10 : Ok gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
> 53 ubuntu:17.04 : Ok gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
> 54 ubuntu:17.10 : Ok gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0
> 55 ubuntu:18.04 : Ok gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
>
> So I'll try running it on the non-cross-builds (x-something) containers,
> because so far I'm just running these on x86_64 as the host machine.
>
> > become acceptable to testers, which is a whole pattern I'd like to
> > avoid if at all possible. I'd eventually like to see the real perf run
>
> Agreed.
>
> > on Android, for example, and adding bash to Android is nontrivial,
> > AFAICT.
>
> Fair enough.
>
> > > I think the alternative is cryptic :-\
> >
> > I think that's because of the fake array stuff, which technically isn't
> > needed by design. How about something like the following?
>
> Thanks for trying to address my concern, looking...
>
> > diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> > index 263057039693..d5cceaeba42d 100755
> > --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> > +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> > @@ -14,20 +14,21 @@ libc=$(grep -w libc /proc/self/maps | head -1 | sed -r 's/.*[[:space:]](\/.*)/\1
> > nm -Dg $libc 2>/dev/null | fgrep -q inet_pton || exit 254
> >
> > trace_libc_inet_pton_backtrace() {
> > + newline='\n'
> > idx=0
> > - expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
> > - expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> > + expected="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
> > + expected="${expected}${newline}.*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"

Ok, seems to be the common ground, unfortunately expected+="${newline}..."
is not present in dash :-\

[root@jouet ~]# a="AA "
[root@jouet ~]# a+="BB "
[root@jouet ~]# echo $a
AA BB
[root@jouet ~]# dash
# a="AA "
# a+="BB "
dash: 2: a+=BB : not found
# let a+="BB "
dash: 3: let: not found
# a="AA "
# a="${a} BB "
# echo $a
AA BB
#

Would be good if we had some utility that given a two files, one with
regexps, could tell if, line by line, those expressions matched, better,
one that is present in all these OSes...

- Arnaldo

> > case "$(uname -m)" in
> > s390x)
> > eventattr='call-graph=dwarf,max-stack=4'
> > - expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> > - expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> > - expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> > + expected="${expected}${newline}gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> > + expected="${expected}${newline}(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> > + expected="${expected}${newline}main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> > ;;
> > *)
> > eventattr='max-stack=3'
> > - expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
> > - expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> > + expected="${expected}${newline}getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
> > + expected="${expected}${newline}.*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> > ;;
> > esac
> >
> > @@ -35,14 +36,16 @@ trace_libc_inet_pton_backtrace() {
> >
> > perf record -e probe_libc:inet_pton/$eventattr/ -o $file ping -6 -c 1 ::1 > /dev/null 2>&1
> > perf script -i $file | while read line ; do
> > + [ -z "${line}" ] && break
> > echo $line
> > - echo "$line" | egrep -q "${expected[$idx]}"
> > + idx=$((idx + 1))
> > + first="$(echo ${expected} | head -$idx | tail -1)"
> > + [ -z "${first}" ] && break
> > + echo "$line" | egrep -q "$first"
> > if [ $? -ne 0 ] ; then
> > - printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${expected[$idx]}" "$line"
> > + printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${first}" "$line"
> > exit 1
> > fi
> > - let idx+=1
> > - [ -z "${expected[$idx]}" ] && break
> > done
> >
> > # If any statements are executed from this point onwards,
> >
> > Thanks,
> >
> > Kim

2018-06-21 20:34:10

by Kim Phillips

[permalink] [raw]
Subject: Re: [PATCH 2/2] perf test shell: make perf inet_pton test more portable

On Thu, 21 Jun 2018 12:18:00 -0300
Arnaldo Carvalho de Melo <[email protected]> wrote:

> Would be good if we had some utility that given a two files, one with
> regexps, could tell if, line by line, those expressions matched, better,
> one that is present in all these OSes...

I didn't find any, but given the two-file notion might be acceptable,
hopefully you might find the following more readable/acceptable?:

diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
index 263057039693..94e513e62b34 100755
--- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
+++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
@@ -14,35 +14,40 @@ libc=$(grep -w libc /proc/self/maps | head -1 | sed -r 's/.*[[:space:]](\/.*)/\1
nm -Dg $libc 2>/dev/null | fgrep -q inet_pton || exit 254

trace_libc_inet_pton_backtrace() {
- idx=0
- expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
- expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
+
+ expected=`mktemp -u /tmp/expected.XXX`
+
+ echo "ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)" > $expected
+ echo ".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
case "$(uname -m)" in
s390x)
eventattr='call-graph=dwarf,max-stack=4'
- expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
- expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
- expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
+ echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
+ echo "(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
+ echo "main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" >> $expected
;;
*)
eventattr='max-stack=3'
- expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
- expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
+ echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected
+ echo ".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" >> $expected
;;
esac

- file=`mktemp -u /tmp/perf.data.XXX`
+ perf_data=`mktemp -u /tmp/perf.data.XXX`
+ perf_script=`mktemp -u /tmp/perf.script.XXX`
+ perf record -e probe_libc:inet_pton/$eventattr/ -o $perf_data ping -6 -c 1 ::1 > /dev/null 2>&1
+ perf script -i $perf_data > $perf_script

- perf record -e probe_libc:inet_pton/$eventattr/ -o $file ping -6 -c 1 ::1 > /dev/null 2>&1
- perf script -i $file | while read line ; do
+ exec 3<$perf_script
+ exec 4<$expected
+ while read line <&3 && read -r pattern <&4; do
+ [ -z "$pattern" ] && break
echo $line
- echo "$line" | egrep -q "${expected[$idx]}"
+ echo "$line" | egrep -q "$pattern"
if [ $? -ne 0 ] ; then
- printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${expected[$idx]}" "$line"
+ printf "FAIL: expected backtrace entry \"%s\" got \"%s\"\n" "$pattern" "$line"
exit 1
fi
- let idx+=1
- [ -z "${expected[$idx]}" ] && break
done

# If any statements are executed from this point onwards,
@@ -58,6 +63,6 @@ skip_if_no_perf_probe && \
perf probe -q $libc inet_pton && \
trace_libc_inet_pton_backtrace
err=$?
-rm -f ${file}
+rm -f ${perf_data} ${perf_script} ${expected}
perf probe -q -d probe_libc:inet_pton
exit $err

Thanks,

Kim

2018-06-28 21:00:14

by Michael Petlan

[permalink] [raw]
Subject: Re: [PATCH 2/2] perf test shell: make perf inet_pton test more portable

On Thu, 21 Jun 2018, Arnaldo Carvalho de Melo wrote:
> Em Thu, Jun 21, 2018 at 11:19:15AM -0300, Arnaldo Carvalho de Melo escreveu:
>> Em Wed, Jun 20, 2018 at 07:45:46PM -0500, Kim Phillips escreveu:
>>> On Wed, 20 Jun 2018 10:46:22 -0300
>>> Arnaldo Carvalho de Melo <[email protected]> wrote:
[...]
>
> Would be good if we had some utility that given a two files, one with
> regexps, could tell if, line by line, those expressions matched, better,
> one that is present in all these OSes...
>
I have struggled with this too [1], [2]. I use perl, not sure if it is
all-distro-compliant, probably not, but anyway...

To have:
- regexps generic enough (e.g. to parse "casual perf-script output line")
- regexps adjustable to concrete needs
- regexps to be understandable as much as possible
---> I have $RE_SOMETHING, e.g. RE_LINE_REPORT_CONTENT, such as in [2],
and some primitives which I make the more concrete regexps from, such
as $RE_EVENT_ANY, $RE_PATH, etc. going into e.g.:
REGEXP_STAT_LINE="^\s+$RE_NUMBER\s+$RE_EVENT_ANY\s*"

- various utilities:
- all output lines matched some regexp in the file
- all regexps in the file were matched by something in the output
- at least one of the patterns found in output
- none of the patterns found in the output
- ...
---> I had to write these and few more scripts to handle the parsing
of perf output, as in [1], however it still is not ideal...

[1] https://github.com/rfmvh/perftool-testsuite/tree/master/common
[2] https://github.com/rfmvh/perftool-testsuite/blob/master/common/patterns.sh

Cheers,
Michael

P.S. Could anyone try whether my suite would work on the dash (or any other
"non-fedora" environment)? I haven't had problems with this so far, but
of course I haven't tried many...

> - Arnaldo
>
[...]

2018-06-29 17:30:18

by Kim Phillips

[permalink] [raw]
Subject: Re: [PATCH 2/2] perf test shell: make perf inet_pton test more portable

On Fri, 29 Jun 2018 12:21:55 -0300
Arnaldo Carvalho de Melo <[email protected]> wrote:

> Em Thu, Jun 21, 2018 at 03:32:50PM -0500, Kim Phillips escreveu:
> > On Thu, 21 Jun 2018 12:18:00 -0300
> > Arnaldo Carvalho de Melo <[email protected]> wrote:
> >
> > > Would be good if we had some utility that given a two files, one with
> > > regexps, could tell if, line by line, those expressions matched, better,
> > > one that is present in all these OSes...
> >
> > I didn't find any, but given the two-file notion might be acceptable,
> > hopefully you might find the following more readable/acceptable?:
>
> Looks better, you build the expected lines in a separate file, then read
> both it and the output, then do the matching, cleaner. And I assume it
> works with dash, right?

Yes, of course :)

I'll re-send via a new v2 series as 1/2 wasn't git-am friendly, and
I've uncovered another minor bashism.

Kim

2018-06-29 17:32:53

by Kim Phillips

[permalink] [raw]
Subject: Re: [PATCH 2/2] perf test shell: make perf inet_pton test more portable

On Thu, 28 Jun 2018 22:36:36 +0200
Michael Petlan <[email protected]> wrote:

> On Thu, 21 Jun 2018, Arnaldo Carvalho de Melo wrote:
> > Em Thu, Jun 21, 2018 at 11:19:15AM -0300, Arnaldo Carvalho de Melo escreveu:
> >> Em Wed, Jun 20, 2018 at 07:45:46PM -0500, Kim Phillips escreveu:
> >>> On Wed, 20 Jun 2018 10:46:22 -0300
> >>> Arnaldo Carvalho de Melo <[email protected]> wrote:
> [...]
> >
> > Would be good if we had some utility that given a two files, one with
> > regexps, could tell if, line by line, those expressions matched, better,
> > one that is present in all these OSes...
> >
> I have struggled with this too [1], [2]. I use perl, not sure if it is
> all-distro-compliant, probably not, but anyway...

Yeah, not so much on embedded distros.

> To have:
> - regexps generic enough (e.g. to parse "casual perf-script output line")
> - regexps adjustable to concrete needs
> - regexps to be understandable as much as possible
> ---> I have $RE_SOMETHING, e.g. RE_LINE_REPORT_CONTENT, such as in [2],
> and some primitives which I make the more concrete regexps from, such
> as $RE_EVENT_ANY, $RE_PATH, etc. going into e.g.:
> REGEXP_STAT_LINE="^\s+$RE_NUMBER\s+$RE_EVENT_ANY\s*"
>
> - various utilities:
> - all output lines matched some regexp in the file
> - all regexps in the file were matched by something in the output
> - at least one of the patterns found in output
> - none of the patterns found in the output
> - ...
> ---> I had to write these and few more scripts to handle the parsing
> of perf output, as in [1], however it still is not ideal...

I'm going to resend the clearer-to-read POSIX compliant rewrite of the
script for now.

> P.S. Could anyone try whether my suite would work on the dash (or any other
> "non-fedora" environment)? I haven't had problems with this so far, but
> of course I haven't tried many...

See below for the results of cloning and running 'make' on an x86_64
box running Ubuntu 18.04 with today's acme's perf/urgent branch perf
installed.

Any plans to incorporate any of these tests into mainline perf?

Cheers,

Kim

gcc -g -O0 -o run_all run_all.c
./run_all -v
-- [ PASS ] -- perf_report :: setup :: prepare the perf.data file
## [ PASS ] ## perf_report :: setup SUMMARY
-- [ SKIP ] -- perf_report :: test_basic :: help message :: testcase skipped
-- [ FAIL ] -- perf_report :: test_basic :: basic execution (output regexp parsing)
-- [ FAIL ] -- perf_report :: test_basic :: number of samples (output regexp parsing)
-- [ PASS ] -- perf_report :: test_basic :: header
-- [ FAIL ] -- perf_report :: test_basic :: show CPU utilization (output regexp parsing)
-- [ FAIL ] -- perf_report :: test_basic :: pid (output regexp parsing)
-- [ FAIL ] -- perf_report :: test_basic :: non-existing symbol (output regexp parsing)
-- [ FAIL ] -- perf_report :: test_basic :: symbol filter (output regexp parsing)
## [ FAIL ] ## perf_report :: test_basic SUMMARY :: 6 failures found
## [ PASS ] ## perf_report :: cleanup SUMMARY
-- [ PASS ] -- perf_probe :: setup :: building examples
## [ PASS ] ## perf_probe :: setup SUMMARY
-- [ FAIL ] -- perf_probe :: test_adding_blacklisted :: adding blacklisted function perf_event_nmi_handler (output regexp parsing)
-- [ PASS ] -- perf_probe :: test_adding_blacklisted :: listing blacklisted probe (should NOT be listed)
## [ FAIL ] ## perf_probe :: test_adding_blacklisted SUMMARY :: 1 failures found
-- [ PASS ] -- perf_probe :: test_probe_syntax :: custom named probe :: add
-- [ PASS ] -- perf_probe :: test_probe_syntax :: custom named probe :: list
-- [ FAIL ] -- perf_probe :: test_probe_syntax :: custom named probe :: use (output regexp parsing)
-- [ PASS ] -- perf_probe :: test_probe_syntax :: various syntax forms :: vfs_read@fs/read_write.c
-- [ PASS ] -- perf_probe :: test_probe_syntax :: various syntax forms :: vfs_read:11@fs/read_write.c
-- [ PASS ] -- perf_probe :: test_probe_syntax :: various syntax forms :: vfs_read@fs/read_write.c:11
-- [ PASS ] -- perf_probe :: test_probe_syntax :: various syntax forms :: vfs_read%return
-- [ PASS ] -- perf_probe :: test_probe_syntax :: various syntax forms :: test.c:29
-- [ PASS ] -- perf_probe :: test_probe_syntax :: various syntax forms :: func%return $retval
## [ FAIL ] ## perf_probe :: test_probe_syntax SUMMARY :: 1 failures found
-- [ PASS ] -- perf_probe :: test_sdt :: adding SDT tracepoints as probes
-- [ PASS ] -- perf_probe :: test_sdt :: listing added probes
-- [ PASS ] -- perf_probe :: test_sdt :: using probes :: perf stat (N = 13)
-- [ PASS ] -- perf_probe :: test_sdt :: using probes :: perf stat (N = 128)
-- [ PASS ] -- perf_probe :: test_sdt :: using probes :: perf stat (N = 241)
-- [ PASS ] -- perf_probe :: test_sdt :: using probes :: perf record (N = 37)
-- [ PASS ] -- perf_probe :: test_sdt :: using probes :: perf report (N = 37)
-- [ PASS ] -- perf_probe :: test_sdt :: using probes :: perf script (N = 37)
-- [ PASS ] -- perf_probe :: test_sdt :: using probes :: perf record (N = 97)
-- [ PASS ] -- perf_probe :: test_sdt :: using probes :: perf report (N = 97)
-- [ PASS ] -- perf_probe :: test_sdt :: using probes :: perf script (N = 97)
-- [ PASS ] -- perf_probe :: test_sdt :: using probes :: perf record (N = 237)
-- [ PASS ] -- perf_probe :: test_sdt :: using probes :: perf report (N = 237)
-- [ PASS ] -- perf_probe :: test_sdt :: using probes :: perf script (N = 237)
## [ PASS ] ## perf_probe :: test_sdt SUMMARY
-- [ PASS ] -- perf_probe :: test_line_semantics :: acceptable descriptions :: func
-- [ PASS ] -- perf_probe :: test_line_semantics :: acceptable descriptions :: func:10
-- [ PASS ] -- perf_probe :: test_line_semantics :: acceptable descriptions :: func:0-10
-- [ PASS ] -- perf_probe :: test_line_semantics :: acceptable descriptions :: func:2+10
-- [ PASS ] -- perf_probe :: test_line_semantics :: acceptable descriptions :: [email protected]
-- [ PASS ] -- perf_probe :: test_line_semantics :: acceptable descriptions :: [email protected]:1
-- [ PASS ] -- perf_probe :: test_line_semantics :: acceptable descriptions :: source.c:1
-- [ PASS ] -- perf_probe :: test_line_semantics :: acceptable descriptions :: source.c:1+1
-- [ PASS ] -- perf_probe :: test_line_semantics :: acceptable descriptions :: source.c:1-10
-- [ PASS ] -- perf_probe :: test_line_semantics :: unacceptable descriptions :: func:foo
-- [ PASS ] -- perf_probe :: test_line_semantics :: unacceptable descriptions :: func:1-foo
-- [ PASS ] -- perf_probe :: test_line_semantics :: unacceptable descriptions :: func:1+foo
-- [ PASS ] -- perf_probe :: test_line_semantics :: unacceptable descriptions :: func;lazy\*pattern
## [ PASS ] ## perf_probe :: test_line_semantics SUMMARY
-- [ PASS ] -- perf_probe :: test_advanced :: function argument probing :: add
-- [ PASS ] -- perf_probe :: test_advanced :: function argument probing :: record
-- [ PASS ] -- perf_probe :: test_advanced :: function argument probing :: script
-- [ PASS ] -- perf_probe :: test_advanced :: function retval probing :: add
-- [ PASS ] -- perf_probe :: test_advanced :: function retval probing :: record
-- [ PASS ] -- perf_probe :: test_advanced :: function retval probing :: script
-- [ PASS ] -- perf_probe :: test_advanced :: function string argument probing :: add
-- [ PASS ] -- perf_probe :: test_advanced :: function string argument probing :: record
-- [ PASS ] -- perf_probe :: test_advanced :: function string argument probing :: script
-- [ PASS ] -- perf_probe :: test_advanced :: function string argument kprobing :: add
-- [ PASS ] -- perf_probe :: test_advanced :: function string argument kprobing :: record
-- [ PASS ] -- perf_probe :: test_advanced :: function string argument kprobing :: script
## [ PASS ] ## perf_probe :: test_advanced SUMMARY
-- [ PASS ] -- perf_probe :: test_adding_kernel :: adding probe vfs_read ::
-- [ PASS ] -- perf_probe :: test_adding_kernel :: adding probe vfs_read :: -a
-- [ PASS ] -- perf_probe :: test_adding_kernel :: adding probe vfs_read :: --add
-- [ PASS ] -- perf_probe :: test_adding_kernel :: listing added probe :: perf list
-- [ PASS ] -- perf_probe :: test_adding_kernel :: listing added probe :: perf probe -l
-- [ FAIL ] -- perf_probe :: test_adding_kernel :: using added probe (output regexp parsing)
-- [ PASS ] -- perf_probe :: test_adding_kernel :: deleting added probe
-- [ PASS ] -- perf_probe :: test_adding_kernel :: listing removed probe (should NOT be listed)
-- [ PASS ] -- perf_probe :: test_adding_kernel :: dry run :: adding probe
-- [ PASS ] -- perf_probe :: test_adding_kernel :: force-adding probes :: first probe adding
-- [ PASS ] -- perf_probe :: test_adding_kernel :: force-adding probes :: second probe adding (without force)
-- [ PASS ] -- perf_probe :: test_adding_kernel :: force-adding probes :: second probe adding (with force)
-- [ PASS ] -- perf_probe :: test_adding_kernel :: using doubled probe
-- [ PASS ] -- perf_probe :: test_adding_kernel :: removing multiple probes
-- [ PASS ] -- perf_probe :: test_adding_kernel :: wildcard adding support
-- [ PASS ] -- perf_probe :: test_adding_kernel :: out-of-text functions
-- [ PASS ] -- perf_probe :: test_adding_kernel :: non-existing variable
-- [ FAIL ] -- perf_probe :: test_adding_kernel :: function with retval :: add (command exitcode + output regexp parsing)
-- [ FAIL ] -- perf_probe :: test_adding_kernel :: function with retval :: record (command exitcode + output regexp parsing)
-- [ FAIL ] -- perf_probe :: test_adding_kernel :: function argument probing :: script (output regexp parsing)
## [ FAIL ] ## perf_probe :: test_adding_kernel SUMMARY :: 4 failures found
-- [ PASS ] -- perf_probe :: test_invalid_options :: missing argument for -a
-- [ PASS ] -- perf_probe :: test_invalid_options :: missing argument for -d
-- [ PASS ] -- perf_probe :: test_invalid_options :: missing argument for -L
-- [ PASS ] -- perf_probe :: test_invalid_options :: missing argument for -V
-- [ PASS ] -- perf_probe :: test_invalid_options :: unnecessary argument for -F
-- [ PASS ] -- perf_probe :: test_invalid_options :: unnecessary argument for -l
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -a xxx -d xxx
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -a xxx -L foo
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -a xxx -V foo
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -a xxx -l
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -a xxx -F
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -d xxx -L foo
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -d xxx -V foo
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -d xxx -l
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -d xxx -F
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -L foo -V bar
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -L foo -l
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -L foo -F
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -V foo -l
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -V foo -F
-- [ PASS ] -- perf_probe :: test_invalid_options :: mutually exclusive options :: -l -F
## [ PASS ] ## perf_probe :: test_invalid_options SUMMARY
-- [ PASS ] -- perf_probe :: test_listing :: kernel functions list ( to kallsyms)
-- [ PASS ] -- perf_probe :: test_listing :: userspace functions list
-- [ PASS ] -- perf_probe :: test_listing :: kernel variables list
-- [ PASS ] -- perf_probe :: test_listing :: userspace variables list
-- [ FAIL ] -- perf_probe :: test_listing :: kernel lines list (command exitcode + output regexp parsing)
-- [ FAIL ] -- perf_probe :: test_listing :: kernel source lines list (command exitcode + output regexp parsing)
-- [ PASS ] -- perf_probe :: test_listing :: userspace lines list
-- [ PASS ] -- perf_probe :: test_listing :: userspace source lines list
## [ FAIL ] ## perf_probe :: test_listing SUMMARY :: 2 failures found
-- [ SKIP ] -- perf_probe :: test_basic :: help message :: testcase skipped
-- [ PASS ] -- perf_probe :: test_basic :: usage message
-- [ PASS ] -- perf_probe :: test_basic :: quiet switch
## [ PASS ] ## perf_probe :: test_basic SUMMARY
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -O0 :: add
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -O0 :: record
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -O0 :: script
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -O1 :: add
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -O1 :: record
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -O1 :: script
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -O2 :: add
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -O2 :: record
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -O2 :: script
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -O3 :: add
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -O3 :: record
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -O3 :: script
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -Ofast :: add
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -Ofast :: record
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -Ofast :: script
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -Og :: add
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -Og :: record
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -Og :: script
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -Os :: add
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -Os :: record
-- [ PASS ] -- perf_probe :: test_optimization_levels :: function argument with -Os :: script
## [ PASS ] ## perf_probe :: test_optimization_levels SUMMARY
-- [ PASS ] -- perf_probe :: test_exact_counts :: adding userspace probes
-- [ PASS ] -- perf_probe :: test_exact_counts :: listing added probes
-- [ PASS ] -- perf_probe :: test_exact_counts :: using probes :: perf stat
-- [ PASS ] -- perf_probe :: test_exact_counts :: using probes :: perf record
-- [ PASS ] -- perf_probe :: test_exact_counts :: using probes :: perf report
## [ PASS ] ## perf_probe :: test_exact_counts SUMMARY
## [ PASS ] ## perf_probe :: cleanup SUMMARY
## [ PASS ] ## perf_list :: setup SUMMARY
## [ SKIP ] ## perf_list :: test_powerpc_hv_24x7 :: testcase skipped
-- [ SKIP ] -- perf_list :: test_basic :: help message :: testcase skipped
-- [ FAIL ] -- perf_list :: test_basic :: basic execution (output regexp parsing)
-- [ PASS ] -- perf_list :: test_basic :: list kmem:\*
-- [ PASS ] -- perf_list :: test_basic :: list cache
-- [ PASS ] -- perf_list :: test_basic :: list xfs:\*
-- [ PASS ] -- perf_list :: test_basic :: list syscalls:\*
-- [ PASS ] -- perf_list :: test_basic :: list hw
-- [ PASS ] -- perf_list :: test_basic :: list tracepoint
-- [ PASS ] -- perf_list :: test_basic :: list pmu
-- [ PASS ] -- perf_list :: test_basic :: list sw
-- [ PASS ] -- perf_list :: test_basic :: non-sense argument
## [ FAIL ] ## perf_list :: test_basic SUMMARY :: 1 failures found
## [ PASS ] ## perf_list :: cleanup SUMMARY
-- [ PASS ] -- perf_archive :: setup :: prepare the perf.data file
## [ PASS ] ## perf_archive :: setup SUMMARY
-- [ SKIP ] -- perf_archive :: test_basic :: help message :: testcase skipped
-- [ FAIL ] -- perf_archive :: test_basic :: report (output regexp parsing)
-- [ FAIL ] -- perf_archive :: test_basic :: script (output regexp parsing)
-- [ PASS ] -- perf_archive :: test_basic :: archive creation
-- [ FAIL ] -- perf_archive :: test_basic :: archive sanity (contents) (output regexp parsing)
## [ FAIL ] ## perf_archive :: test_basic SUMMARY :: 3 failures found
## [ PASS ] ## perf_archive :: cleanup SUMMARY
-- [ PASS ] -- perf_diff :: setup :: building the example code
-- [ PASS ] -- perf_diff :: setup :: record data #1
-- [ PASS ] -- perf_diff :: setup :: record data #2
## [ PASS ] ## perf_diff :: setup SUMMARY
-- [ SKIP ] -- perf_diff :: test_basic :: help message :: testcase skipped
-- [ PASS ] -- perf_diff :: test_basic :: basic execution - diff
## [ PASS ] ## perf_diff :: test_basic SUMMARY
## [ PASS ] ## perf_diff :: cleanup SUMMARY
-- [ PASS ] -- perf_mem :: setup :: building the example code
## [ PASS ] ## perf_mem :: setup SUMMARY
-- [ SKIP ] -- perf_mem :: test_basic :: help message :: testcase skipped
-- [ PASS ] -- perf_mem :: test_basic :: loads record
-- [ PASS ] -- perf_mem :: test_basic :: loads event check
-- [ PASS ] -- perf_mem :: test_basic :: loads report
-- [ PASS ] -- perf_mem :: test_basic :: stores record
-- [ PASS ] -- perf_mem :: test_basic :: stores event check
-- [ PASS ] -- perf_mem :: test_basic :: stores report
-- [ PASS ] -- perf_mem :: test_basic :: loads&stores record
-- [ PASS ] -- perf_mem :: test_basic :: loads&stores event check
-- [ PASS ] -- perf_mem :: test_basic :: loads&stores report
## [ PASS ] ## perf_mem :: test_basic SUMMARY
## [ PASS ] ## perf_mem :: cleanup SUMMARY
-- [ PASS ] -- perf_annotate :: setup :: building the example code
-- [ PASS ] -- perf_annotate :: setup :: record data
## [ PASS ] ## perf_annotate :: setup SUMMARY
-- [ SKIP ] -- perf_annotate :: test_basic :: help message :: testcase skipped
-- [ PASS ] -- perf_annotate :: test_basic :: basic execution - annotate
-- [ PASS ] -- perf_annotate :: test_basic :: dso filter
-- [ PASS ] -- perf_annotate :: test_basic :: no-source
-- [ PASS ] -- perf_annotate :: test_basic :: full-paths
-- [ FAIL ] -- perf_annotate :: test_basic :: print-line (output regexp parsing)
-- [ PASS ] -- perf_annotate :: test_basic :: redirected input
-- [ PASS ] -- perf_annotate :: test_basic :: execution without data
## [ FAIL ] ## perf_annotate :: test_basic SUMMARY :: 1 failures found
## [ PASS ] ## perf_annotate :: cleanup SUMMARY
-- [ PASS ] -- perf_stat :: test_intel_uncore :: event uncore_cbox_0/clockticks/
-- [ SKIP ] -- perf_stat :: test_intel_uncore :: event uncore_cbox_1/clockticks/ :: testcase skipped
-- [ SKIP ] -- perf_stat :: test_intel_uncore :: event uncore_cbox_2/clockticks/ :: testcase skipped
-- [ SKIP ] -- perf_stat :: test_intel_uncore :: event uncore_cbox_3/clockticks/ :: testcase skipped
-- [ PASS ] -- perf_stat :: test_intel_uncore :: event uncore_imc/data_reads/
-- [ PASS ] -- perf_stat :: test_intel_uncore :: event uncore_imc/data_writes/
## [ PASS ] ## perf_stat :: test_intel_uncore SUMMARY
-- [ PASS ] -- perf_stat :: test_sw :: event alignment-faults
-- [ PASS ] -- perf_stat :: test_sw :: event bpf-output
-- [ PASS ] -- perf_stat :: test_sw :: event context-switches
-- [ PASS ] -- perf_stat :: test_sw :: event cpu-clock
-- [ PASS ] -- perf_stat :: test_sw :: event cpu-migrations
-- [ PASS ] -- perf_stat :: test_sw :: event dummy
-- [ PASS ] -- perf_stat :: test_sw :: event emulation-faults
-- [ PASS ] -- perf_stat :: test_sw :: event major-faults
-- [ PASS ] -- perf_stat :: test_sw :: event minor-faults
-- [ PASS ] -- perf_stat :: test_sw :: event page-faults
-- [ PASS ] -- perf_stat :: test_sw :: event task-clock
-- [ PASS ] -- perf_stat :: test_sw :: k+u=ku check :: event alignment-faults
-- [ PASS ] -- perf_stat :: test_sw :: k+u=ku check :: event bpf-output
-- [ PASS ] -- perf_stat :: test_sw :: k+u=ku check :: event context-switches
-- [ PASS ] -- perf_stat :: test_sw :: k+u=ku check :: event cpu-migrations
-- [ PASS ] -- perf_stat :: test_sw :: k+u=ku check :: event dummy
-- [ PASS ] -- perf_stat :: test_sw :: k+u=ku check :: event emulation-faults
-- [ PASS ] -- perf_stat :: test_sw :: k+u=ku check :: event major-faults
-- [ PASS ] -- perf_stat :: test_sw :: k+u=ku check :: event minor-faults
-- [ PASS ] -- perf_stat :: test_sw :: k+u=ku check :: event page-faults
## [ PASS ] ## perf_stat :: test_sw SUMMARY
## [ SKIP ] ## perf_stat :: test_tracepoints_definition :: testcase skipped
-- [ PASS ] -- perf_stat :: test_hw_breakpoints :: kspace address execution mem:0xffffffff94074e70:x
-- [ PASS ] -- perf_stat :: test_hw_breakpoints :: kspace address readwrite mem:0xffffffff952fc248:rw
## [ PASS ] ## perf_stat :: test_hw_breakpoints SUMMARY
-- [ PASS ] -- perf_stat :: test_hwcache :: event L1-dcache-load-misses
-- [ PASS ] -- perf_stat :: test_hwcache :: event L1-dcache-loads
-- [ PASS ] -- perf_stat :: test_hwcache :: event L1-dcache-stores
-- [ PASS ] -- perf_stat :: test_hwcache :: event L1-icache-load-misses
-- [ PASS ] -- perf_stat :: test_hwcache :: event LLC-load-misses
-- [ PASS ] -- perf_stat :: test_hwcache :: event LLC-loads
-- [ PASS ] -- perf_stat :: test_hwcache :: event LLC-store-misses
-- [ PASS ] -- perf_stat :: test_hwcache :: event LLC-stores
-- [ PASS ] -- perf_stat :: test_hwcache :: event branch-load-misses
-- [ PASS ] -- perf_stat :: test_hwcache :: event branch-loads
-- [ PASS ] -- perf_stat :: test_hwcache :: event dTLB-load-misses
-- [ PASS ] -- perf_stat :: test_hwcache :: event dTLB-loads
-- [ PASS ] -- perf_stat :: test_hwcache :: event dTLB-store-misses
-- [ PASS ] -- perf_stat :: test_hwcache :: event dTLB-stores
-- [ PASS ] -- perf_stat :: test_hwcache :: event iTLB-load-misses
-- [ PASS ] -- perf_stat :: test_hwcache :: event iTLB-loads
-- [ PASS ] -- perf_stat :: test_hwcache :: event node-load-misses
-- [ PASS ] -- perf_stat :: test_hwcache :: event node-loads
-- [ PASS ] -- perf_stat :: test_hwcache :: event node-store-misses
-- [ PASS ] -- perf_stat :: test_hwcache :: event node-stores
## [ PASS ] ## perf_stat :: test_hwcache SUMMARY
-- [ PASS ] -- perf_stat :: test_record_report :: record
-- [ PASS ] -- perf_stat :: test_record_report :: report
-- [ FAIL ] -- perf_stat :: test_record_report :: diff (output regexp parsing)
## [ FAIL ] ## perf_stat :: test_record_report SUMMARY :: 1 failures found
## [ SKIP ] ## perf_stat :: test_powerpc_hv_24x7 :: testcase skipped
-- [ PASS ] -- perf_stat :: test_hw :: event branch-instructions
-- [ PASS ] -- perf_stat :: test_hw :: event branch-misses
-- [ PASS ] -- perf_stat :: test_hw :: event bus-cycles
-- [ PASS ] -- perf_stat :: test_hw :: event cache-misses
-- [ PASS ] -- perf_stat :: test_hw :: event cache-references
-- [ PASS ] -- perf_stat :: test_hw :: event cpu-cycles
-- [ PASS ] -- perf_stat :: test_hw :: event instructions
-- [ PASS ] -- perf_stat :: test_hw :: event ref-cycles
-- [ PASS ] -- perf_stat :: test_hw :: k+u=ku check :: event branch-instructions
-- [ PASS ] -- perf_stat :: test_hw :: k+u=ku check :: event branch-misses
-- [ PASS ] -- perf_stat :: test_hw :: k+u=ku check :: event bus-cycles
-- [ PASS ] -- perf_stat :: test_hw :: k+u=ku check :: event cache-misses
-- [ PASS ] -- perf_stat :: test_hw :: k+u=ku check :: event cache-references
-- [ PASS ] -- perf_stat :: test_hw :: k+u=ku check :: event cpu-cycles
-- [ PASS ] -- perf_stat :: test_hw :: k+u=ku check :: event instructions
## [ PASS ] ## perf_stat :: test_hw SUMMARY
-- [ PASS ] -- perf_stat :: test_intel_rapl :: event power/energy-cores/
-- [ PASS ] -- perf_stat :: test_intel_rapl :: event power/energy-gpu/
-- [ PASS ] -- perf_stat :: test_intel_rapl :: event power/energy-pkg/
-- [ PASS ] -- perf_stat :: test_intel_rapl :: event power/energy-psys/
-- [ PASS ] -- perf_stat :: test_intel_rapl :: event power/energy-ram/
## [ PASS ] ## perf_stat :: test_intel_rapl SUMMARY
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event branch-instructions full
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event branch-instructions half
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event branch-instructions values OK
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event cpu-cycles full
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event cpu-cycles half
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event cpu-cycles values OK
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event instructions full
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event instructions half
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event instructions values OK
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event cpu-clock full
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event cpu-clock half
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event cpu-clock values OK
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event branch-instructions full
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event branch-instructions half
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event branch-instructions values OK
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event cpu-cycles full
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event cpu-cycles half
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event cpu-cycles values OK
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event instructions full
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event instructions half
-- [ PASS ] -- perf_stat :: test_advanced_options :: delay event instructions values OK
## [ PASS ] ## perf_stat :: test_advanced_options SUMMARY
-- [ SKIP ] -- perf_stat :: test_basic :: help message :: testcase skipped
-- [ PASS ] -- perf_stat :: test_basic :: basic execution
-- [ FAIL ] -- perf_stat :: test_basic :: some options (output regexp parsing)
-- [ PASS ] -- perf_stat :: test_basic :: CSV output
## [ FAIL ] ## perf_stat :: test_basic SUMMARY :: 1 failures found
## [ PASS ] ## perf_stat :: cleanup SUMMARY
-- [ PASS ] -- perf_trace :: setup :: building the example code
## [ PASS ] ## perf_trace :: setup SUMMARY
-- [ PASS ] -- perf_trace :: test_record :: basic execution - record
## [ PASS ] ## perf_trace :: test_record SUMMARY
-- [ FAIL ] -- perf_trace :: test_overhead :: systemwide (output regexp parsing)
## [ FAIL ] ## perf_trace :: test_overhead SUMMARY :: 1 failures found
-- [ SKIP ] -- perf_trace :: test_basic :: help message :: testcase skipped
-- [ PASS ] -- perf_trace :: test_basic :: basic execution
-- [ PASS ] -- perf_trace :: test_basic :: duration threshold
-- [ PASS ] -- perf_trace :: test_basic :: systemwide
-- [ PASS ] -- perf_trace :: test_basic :: full timestamp
-- [ PASS ] -- perf_trace :: test_basic :: summary
-- [ PASS ] -- perf_trace :: test_basic :: attach process
## [ PASS ] ## perf_trace :: test_basic SUMMARY
## [ PASS ] ## perf_trace :: cleanup SUMMARY
-- [ PASS ] -- perf_c2c :: setup :: building the example code
## [ PASS ] ## perf_c2c :: setup SUMMARY
-- [ SKIP ] -- perf_c2c :: test_basic :: help message :: testcase skipped
-- [ PASS ] -- perf_c2c :: test_basic :: ldlat-loads record
-- [ PASS ] -- perf_c2c :: test_basic :: ldlat-loads event check
-- [ PASS ] -- perf_c2c :: test_basic :: ldlat-loads report
-- [ PASS ] -- perf_c2c :: test_basic :: ldlat-stores record
-- [ PASS ] -- perf_c2c :: test_basic :: ldlat-stores event check
-- [ PASS ] -- perf_c2c :: test_basic :: ldlat-stores report
-- [ PASS ] -- perf_c2c :: test_basic :: ldlat-loads&ldlat-stores record
-- [ PASS ] -- perf_c2c :: test_basic :: ldlat-loads&ldlat-stores event check
-- [ PASS ] -- perf_c2c :: test_basic :: ldlat-loads&ldlat-stores report
-- [ PASS ] -- perf_c2c :: test_basic :: ldlat-loads&ldlat-stores verification
## [ PASS ] ## perf_c2c :: test_basic SUMMARY
## [ PASS ] ## perf_c2c :: cleanup SUMMARY
-- [ PASS ] -- perf_record :: setup :: building the example code
## [ PASS ] ## perf_record :: setup SUMMARY
## [ SKIP ] ## perf_record :: test_overhead :: testcase skipped
-- [ SKIP ] -- perf_record :: test_evlist :: help message :: testcase skipped
-- [ PASS ] -- perf_record :: test_evlist :: sample frequency check :: record with 100
-- [ PASS ] -- perf_record :: test_evlist :: sample frequency check :: evlist 100
-- [ PASS ] -- perf_record :: test_evlist :: sample frequency check :: record with 200
-- [ PASS ] -- perf_record :: test_evlist :: sample frequency check :: evlist 200
-- [ PASS ] -- perf_record :: test_evlist :: sample frequency check :: record with 1000
-- [ PASS ] -- perf_record :: test_evlist :: sample frequency check :: evlist 1000
-- [ PASS ] -- perf_record :: test_evlist :: various events :: record branch-instructions
-- [ PASS ] -- perf_record :: test_evlist :: various events :: evlist branch-instructions
-- [ PASS ] -- perf_record :: test_evlist :: various events :: record branch-misses
-- [ PASS ] -- perf_record :: test_evlist :: various events :: evlist branch-misses
-- [ PASS ] -- perf_record :: test_evlist :: various events :: record bus-cycles
-- [ PASS ] -- perf_record :: test_evlist :: various events :: evlist bus-cycles
-- [ PASS ] -- perf_record :: test_evlist :: various events :: record cache-misses
-- [ PASS ] -- perf_record :: test_evlist :: various events :: evlist cache-misses
-- [ PASS ] -- perf_record :: test_evlist :: various events :: record cache-references
-- [ PASS ] -- perf_record :: test_evlist :: various events :: evlist cache-references
-- [ PASS ] -- perf_record :: test_evlist :: various events :: record cpu-cycles
-- [ PASS ] -- perf_record :: test_evlist :: various events :: evlist cpu-cycles
-- [ PASS ] -- perf_record :: test_evlist :: various events :: record instructions
-- [ PASS ] -- perf_record :: test_evlist :: various events :: evlist instructions
-- [ PASS ] -- perf_record :: test_evlist :: various events :: record ref-cycles
-- [ PASS ] -- perf_record :: test_evlist :: various events :: evlist ref-cycles
## [ PASS ] ## perf_record :: test_evlist SUMMARY
-- [ PASS ] -- perf_record :: test_intr_regs :: list
-- [ PASS ] -- perf_record :: test_intr_regs :: basic sampling (AX) :: record
-- [ PASS ] -- perf_record :: test_intr_regs :: basic sampling (AX) :: report
-- [ PASS ] -- perf_record :: test_intr_regs :: basic sampling (AX) :: report values count
-- [ PASS ] -- perf_record :: test_intr_regs :: using all registers :: record
-- [ PASS ] -- perf_record :: test_intr_regs :: using all registers :: report values count
## [ PASS ] ## perf_record :: test_intr_regs SUMMARY
-- [ SKIP ] -- perf_record :: test_basic :: help message :: testcase skipped
-- [ PASS ] -- perf_record :: test_basic :: basic record
-- [ PASS ] -- perf_record :: test_basic :: hwcache + tracepoint :: record
-- [ PASS ] -- perf_record :: test_basic :: hwcache + tracepoint :: evlist
## [ PASS ] ## perf_record :: test_basic SUMMARY
## [ PASS ] ## perf_record :: cleanup SUMMARY
-- [ PASS ] -- perf_buildid :: setup :: creating perf.data and buildid-cache
## [ PASS ] ## perf_buildid :: setup SUMMARY
-- [ SKIP ] -- perf_buildid :: test_buildid-list :: help message :: testcase skipped
-- [ PASS ] -- perf_buildid :: test_buildid-list :: buildids check
-- [ PASS ] -- perf_buildid :: test_buildid-list :: kernel buildid
## [ PASS ] ## perf_buildid :: test_buildid-list SUMMARY
## [ PASS ] ## perf_buildid :: cleanup SUMMARY
======== base_report ========

======== base_probe ========

======== base_list ========

======== base_archive ========

======== base_diff ========

======== base_mem ========

======== base_annotate ========

======== base_stat ========

======== base_trace ========

======== base_c2c ========

======== base_record ========

======== base_buildid ========

Makefile:25: recipe for target 'check' failed
make: *** [check] Error 1

2018-06-29 18:27:09

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH 2/2] perf test shell: make perf inet_pton test more portable

Em Thu, Jun 21, 2018 at 03:32:50PM -0500, Kim Phillips escreveu:
> On Thu, 21 Jun 2018 12:18:00 -0300
> Arnaldo Carvalho de Melo <[email protected]> wrote:
>
> > Would be good if we had some utility that given a two files, one with
> > regexps, could tell if, line by line, those expressions matched, better,
> > one that is present in all these OSes...
>
> I didn't find any, but given the two-file notion might be acceptable,
> hopefully you might find the following more readable/acceptable?:

Looks better, you build the expected lines in a separate file, then read
both it and the output, then do the matching, cleaner. And I assume it
works with dash, right?

- Arnaldo

> diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> index 263057039693..94e513e62b34 100755
> --- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> +++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
> @@ -14,35 +14,40 @@ libc=$(grep -w libc /proc/self/maps | head -1 | sed -r 's/.*[[:space:]](\/.*)/\1
> nm -Dg $libc 2>/dev/null | fgrep -q inet_pton || exit 254
>
> trace_libc_inet_pton_backtrace() {
> - idx=0
> - expected[0]="ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)"
> - expected[1]=".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> +
> + expected=`mktemp -u /tmp/expected.XXX`
> +
> + echo "ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)" > $expected
> + echo ".*inet_pton\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
> case "$(uname -m)" in
> s390x)
> eventattr='call-graph=dwarf,max-stack=4'
> - expected[2]="gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> - expected[3]="(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$"
> - expected[4]="main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> + echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
> + echo "(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
> + echo "main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" >> $expected
> ;;
> *)
> eventattr='max-stack=3'
> - expected[2]="getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$"
> - expected[3]=".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
> + echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected
> + echo ".*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" >> $expected
> ;;
> esac
>
> - file=`mktemp -u /tmp/perf.data.XXX`
> + perf_data=`mktemp -u /tmp/perf.data.XXX`
> + perf_script=`mktemp -u /tmp/perf.script.XXX`
> + perf record -e probe_libc:inet_pton/$eventattr/ -o $perf_data ping -6 -c 1 ::1 > /dev/null 2>&1
> + perf script -i $perf_data > $perf_script
>
> - perf record -e probe_libc:inet_pton/$eventattr/ -o $file ping -6 -c 1 ::1 > /dev/null 2>&1
> - perf script -i $file | while read line ; do
> + exec 3<$perf_script
> + exec 4<$expected
> + while read line <&3 && read -r pattern <&4; do
> + [ -z "$pattern" ] && break
> echo $line
> - echo "$line" | egrep -q "${expected[$idx]}"
> + echo "$line" | egrep -q "$pattern"
> if [ $? -ne 0 ] ; then
> - printf "FAIL: expected backtrace entry %d \"%s\" got \"%s\"\n" $idx "${expected[$idx]}" "$line"
> + printf "FAIL: expected backtrace entry \"%s\" got \"%s\"\n" "$pattern" "$line"
> exit 1
> fi
> - let idx+=1
> - [ -z "${expected[$idx]}" ] && break
> done
>
> # If any statements are executed from this point onwards,
> @@ -58,6 +63,6 @@ skip_if_no_perf_probe && \
> perf probe -q $libc inet_pton && \
> trace_libc_inet_pton_backtrace
> err=$?
> -rm -f ${file}
> +rm -f ${perf_data} ${perf_script} ${expected}
> perf probe -q -d probe_libc:inet_pton
> exit $err
>
> Thanks,
>
> Kim