Skip to contentSkip to conversation

'perf stat --bpf-counters test' failures

PATCH In review Arnaldo Carvalho de Melo 5 participants 9 messages Nov 19, 2021 – Nov 22, 2021 perf events

lore
Share & tools
lore

Arnaldo Carvalho de Melo

author maintainer
#0 lore raw

After I updated to fedora 35 I started seeing the errors below, it may well not be related to that, maybe something on libbpf, haven't investigated, have you seen this?

⬢[acme@toolbox perf]$ perf -vv
perf version 5.16.rc1.gfa2b5229b222

                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
               libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
                   aio: [ on  ]  # HAVE_AIO_SUPPORT
                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
               libpfm4: [ OFF ]  # HAVE_LIBPFM

⬢[acme@toolbox perf]$

This is with what I have now in my perf/urgent branch, the csets there aren't related:

⬢[acme@toolbox perf]$ git log --oneline torvalds/master..
b194c9cd09dd98af (HEAD -> perf/urgent, quaco/perf/urgent, acme/tmp.perf/urgent, acme/perf/urgent) perf evsel: Fix memory leaks relating to unit d9fc706108c15f8b perf report: Fix memory leaks around perf_tip()
0ca1f534a776cc7d perf hist: Fix memory leak of a perf_hpp_fmt
8b8dcc3720d57d88 tools headers UAPI: Sync MIPS syscall table file changed by new futex_waitv syscall
e8c04ea0fef5731d tools build: Fix removal of feature-sync-compare-and-swap feature detection
9e1a8d9f683260d5 perf inject: Fix ARM SPE handling
92723ea0f11d9249 perf bench: Fix two memory leaks detected with ASan
cb5a63feae2d963c perf test sample-parsing: Fix branch_stack entry endianness check
162b944598344fd7 tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources
db4b284029099224 perf sort: Fix the 'p_stage_cyc' sort key behavior
4d03c75363eeca86 perf sort: Fix the 'ins_lat' sort key behavior
784e8adda4cdb3e2 perf sort: Fix the 'weight' sort key behavior
70f9c9b2df1dd12c perf tools: Set COMPAT_NEED_REALLOCARRAY for CONFIG_AUXTRACE=1
ccb05590c4325ce5 perf tests wp: Remove unused functions on s390
346e91998cba46b6 tools headers UAPI: Sync linux/kvm.h with the kernel sources
b075c1d81e7d0e96 tools headers cpufeatures: Sync with the kernel sources
⬢[acme@toolbox perf]$

- Arnaldo

[acme@quaco perf]$ uname -a
Linux quaco 5.14.17-301.fc35.x86_64 #1 SMP Mon Nov 8 13:57:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
92: Check Arm CoreSight trace data recording and synthesized samples: Skip
93: Check Arm SPE trace data recording and synthesized samples : Skip
94: Check open filename arg using perf trace + vfs_getname : Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRRRRRRR Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRR Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRRRR Ok
[root@quaco ~]# uname -a
Linux quaco 5.14.17-301.fc35.x86_64 #1 SMP Mon Nov 8 13:57:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux [root@quaco ~]# set -o vi
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30079
RRRRRRRRRRRRRRRRRThe difference between 31599305 and 36265639 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30170
RRRRRRRRRRRRRRRRRRRRRRRRThe difference between 33311934 and 36973889 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30257
RRRRRRRRRRRRRRRRRThe difference between 31420157 and 36680527 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30341
RRRRRRRRRRRRRRRRRRRThe difference between 32451720 and 36750342 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30433
RRRRRRRRRRRRRRRRRRtest child finished with 0
---- end ----
perf stat --bpf-counters test: Ok
[root@quaco ~]#

#1 lore raw
Quoted 4 lines · Arnaldo Carvalho de Melo

After I updated to fedora 35 I started seeing the errors below, it may well not be related to that, maybe something on libbpf, haven't investigated, have you seen this?

yep, it seems the perf bench is broken so the counts won't correlated if I revert this one:
92723ea0f11d perf bench: Fix two memory leaks detected with ASan

it works for me again.. it seems to break -t option

Sohaib, could you please check on that?

[root@dell-r440-01 perf]# ./perf bench sched messaging -g 1 -l 100 -t # Running 'sched/messaging' benchmark:
RRRperf: CLIENT: ready write: Bad file descriptor
Rperf: SENDER: write: Bad file descriptor

thanks,
jirka

Quoted 115 lines

⬢[acme@toolbox perf]$ perf -vv
perf version 5.16.rc1.gfa2b5229b222

                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
               libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
                   aio: [ on  ]  # HAVE_AIO_SUPPORT
                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
               libpfm4: [ OFF ]  # HAVE_LIBPFM

⬢[acme@toolbox perf]$

This is with what I have now in my perf/urgent branch, the csets there aren't related:

⬢[acme@toolbox perf]$ git log --oneline torvalds/master..
b194c9cd09dd98af (HEAD -> perf/urgent, quaco/perf/urgent, acme/tmp.perf/urgent, acme/perf/urgent) perf evsel: Fix memory leaks relating to unit d9fc706108c15f8b perf report: Fix memory leaks around perf_tip()
0ca1f534a776cc7d perf hist: Fix memory leak of a perf_hpp_fmt
8b8dcc3720d57d88 tools headers UAPI: Sync MIPS syscall table file changed by new futex_waitv syscall
e8c04ea0fef5731d tools build: Fix removal of feature-sync-compare-and-swap feature detection
9e1a8d9f683260d5 perf inject: Fix ARM SPE handling
92723ea0f11d9249 perf bench: Fix two memory leaks detected with ASan
cb5a63feae2d963c perf test sample-parsing: Fix branch_stack entry endianness check
162b944598344fd7 tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources
db4b284029099224 perf sort: Fix the 'p_stage_cyc' sort key behavior
4d03c75363eeca86 perf sort: Fix the 'ins_lat' sort key behavior
784e8adda4cdb3e2 perf sort: Fix the 'weight' sort key behavior
70f9c9b2df1dd12c perf tools: Set COMPAT_NEED_REALLOCARRAY for CONFIG_AUXTRACE=1
ccb05590c4325ce5 perf tests wp: Remove unused functions on s390
346e91998cba46b6 tools headers UAPI: Sync linux/kvm.h with the kernel sources
b075c1d81e7d0e96 tools headers cpufeatures: Sync with the kernel sources
⬢[acme@toolbox perf]$

- Arnaldo

[acme@quaco perf]$ uname -a
Linux quaco 5.14.17-301.fc35.x86_64 #1 SMP Mon Nov 8 13:57:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
92: Check Arm CoreSight trace data recording and synthesized samples: Skip
93: Check Arm SPE trace data recording and synthesized samples : Skip
94: Check open filename arg using perf trace + vfs_getname : Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRRRRRRR Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRR Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRRRR Ok
[root@quaco ~]# uname -a
Linux quaco 5.14.17-301.fc35.x86_64 #1 SMP Mon Nov 8 13:57:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux [root@quaco ~]# set -o vi
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30079
RRRRRRRRRRRRRRRRRThe difference between 31599305 and 36265639 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30170
RRRRRRRRRRRRRRRRRRRRRRRRThe difference between 33311934 and 36973889 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30257
RRRRRRRRRRRRRRRRRThe difference between 31420157 and 36680527 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30341
RRRRRRRRRRRRRRRRRRRThe difference between 32451720 and 36750342 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30433
RRRRRRRRRRRRRRRRRRtest child finished with 0
---- end ----
perf stat --bpf-counters test: Ok
[root@quaco ~]#

maintainer
#2 lore raw

Hello,

Quoted 7 lines · Jiri Olsa
Quoted 4 lines · Arnaldo Carvalho de Melo

After I updated to fedora 35 I started seeing the errors below, it may well not be related to that, maybe something on libbpf, haven't investigated, have you seen this?

Quoted 5 lines

yep, it seems the perf bench is broken so the counts won't correlated if I revert this one:
92723ea0f11d perf bench: Fix two memory leaks detected with ASan

it works for me again.. it seems to break -t option

Right, it should free the ctx after the thread finishes the work.

Thanks,
Namhyung

Quoted 7 lines

Sohaib, could you please check on that?

[root@dell-r440-01 perf]# ./perf bench sched messaging -g 1 -l 100 -t # Running 'sched/messaging' benchmark:
RRRperf: CLIENT: ready write: Bad file descriptor
Rperf: SENDER: write: Bad file descriptor

#3 lore raw
In reply to Jiri Olsa

Hello, Jiri

Quoted 10 lines · Jiri Olsa
Quoted 4 lines · Arnaldo Carvalho de Melo

After I updated to fedora 35 I started seeing the errors below, it may well not be related to that, maybe something on libbpf, haven't investigated, have you seen this?

yep, it seems the perf bench is broken so the counts won't correlated if I revert this one:
92723ea0f11d perf bench: Fix two memory leaks detected with ASan

Quoted 9 lines

it works for me again.. it seems to break -t option

Sohaib, could you please check on that?

[root@dell-r440-01 perf]# ./perf bench sched messaging -g 1 -l 100 -t # Running 'sched/messaging' benchmark:
RRRperf: CLIENT: ready write: Bad file descriptor
Rperf: SENDER: write: Bad file descriptor

It seems that this patch fixes this:

$ perf bench sched all
and break:
$ perf bench sched messaging -g 1 -l 100 -t

I'll try to fix this now, apologies

Thanks,
- Sohaib

Quoted 119 lines

thanks,
jirka

Quoted 115 lines

⬢[acme@toolbox perf]$ perf -vv
perf version 5.16.rc1.gfa2b5229b222

                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
               libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
                   aio: [ on  ]  # HAVE_AIO_SUPPORT
                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
               libpfm4: [ OFF ]  # HAVE_LIBPFM

⬢[acme@toolbox perf]$

This is with what I have now in my perf/urgent branch, the csets there aren't related:

⬢[acme@toolbox perf]$ git log --oneline torvalds/master..
b194c9cd09dd98af (HEAD -> perf/urgent, quaco/perf/urgent, acme/tmp.perf/urgent, acme/perf/urgent) perf evsel: Fix memory leaks relating to unit d9fc706108c15f8b perf report: Fix memory leaks around perf_tip()
0ca1f534a776cc7d perf hist: Fix memory leak of a perf_hpp_fmt
8b8dcc3720d57d88 tools headers UAPI: Sync MIPS syscall table file changed by new futex_waitv syscall
e8c04ea0fef5731d tools build: Fix removal of feature-sync-compare-and-swap feature detection
9e1a8d9f683260d5 perf inject: Fix ARM SPE handling
92723ea0f11d9249 perf bench: Fix two memory leaks detected with ASan
cb5a63feae2d963c perf test sample-parsing: Fix branch_stack entry endianness check
162b944598344fd7 tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources
db4b284029099224 perf sort: Fix the 'p_stage_cyc' sort key behavior
4d03c75363eeca86 perf sort: Fix the 'ins_lat' sort key behavior
784e8adda4cdb3e2 perf sort: Fix the 'weight' sort key behavior
70f9c9b2df1dd12c perf tools: Set COMPAT_NEED_REALLOCARRAY for CONFIG_AUXTRACE=1
ccb05590c4325ce5 perf tests wp: Remove unused functions on s390
346e91998cba46b6 tools headers UAPI: Sync linux/kvm.h with the kernel sources
b075c1d81e7d0e96 tools headers cpufeatures: Sync with the kernel sources
⬢[acme@toolbox perf]$

- Arnaldo

[acme@quaco perf]$ uname -a
Linux quaco 5.14.17-301.fc35.x86_64 #1 SMP Mon Nov 8 13:57:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
92: Check Arm CoreSight trace data recording and synthesized samples: Skip
93: Check Arm SPE trace data recording and synthesized samples : Skip
94: Check open filename arg using perf trace + vfs_getname : Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRRRRRRR Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRR Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRRRR Ok
[root@quaco ~]# uname -a
Linux quaco 5.14.17-301.fc35.x86_64 #1 SMP Mon Nov 8 13:57:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux [root@quaco ~]# set -o vi
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30079
RRRRRRRRRRRRRRRRRThe difference between 31599305 and 36265639 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30170
RRRRRRRRRRRRRRRRRRRRRRRRThe difference between 33311934 and 36973889 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30257
RRRRRRRRRRRRRRRRRThe difference between 31420157 and 36680527 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30341
RRRRRRRRRRRRRRRRRRRThe difference between 32451720 and 36750342 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30433
RRRRRRRRRRRRRRRRRRtest child finished with 0
---- end ----
perf stat --bpf-counters test: Ok
[root@quaco ~]#

#4 lore raw

PATCH 1/1 Fixup: perf bench: Fix two memory leaks detected with ASan

In reply to Jiri Olsa
Fixes 92723ea0f11d ("perf bench: Fix two memory leaks detected with

ASan")

This patch fixes the previous patch which frees the ctx before the thread finishes the work. This break -t option.

This patch stores all overwritten pointers in a global vars then free them at the end of the program.

Tests:

$ perf bench sched messaging -g 1 -l 100 -t
$ perf bench sched messaging -g 1 -l 100
$ perf bench sched all
---
 tools/perf/bench/sched-messaging.c | 39 +++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 11 deletions(-)
tools/perf/bench/sched-messaging.c +28 -11
index 488f6e6ba1a5..f60dc9c36f4e 100644
@@ -30,11 +30,15 @@
 #include <linux/time64.h>
 
 #define DATASIZE 100
+#define GROUPS_NUM 10
+#define FD_NUM 20
 
 static bool use_pipes = false;
 static unsigned int nr_loops = 100;
 static bool thread_mode = false;
-static unsigned int num_groups = 10;
+static unsigned int num_groups = GROUPS_NUM;
+static unsigned int num_fds = FD_NUM;
+static unsigned int total_counter; /* num_groups * num_fds */
 
 struct sender_context {
 	unsigned int num_fds;
@@ -50,6 +54,9 @@ struct receiver_context {
 	int wakefd;
 };
 
+struct receiver_context *ctx_arr[FD_NUM*GROUPS_NUM];
+struct sender_context *snd_ctx_arr[FD_NUM*GROUPS_NUM];
+
 static void fdpair(int fds[2])
 {
 	if (use_pipes) {
@@ -190,29 +197,30 @@ static void reap_worker(pthread_t id)
 
 /* One group of senders and receivers */
 static unsigned int group(pthread_t *pth,
-		unsigned int num_fds,
+		unsigned int num_fd,
 		int ready_out,
 		int wakefd)
 {
 	unsigned int i;
 	struct sender_context *snd_ctx = malloc(sizeof(struct sender_context)
-			+ num_fds * sizeof(int));
+			+ num_fd * sizeof(int));
 
 	if (!snd_ctx)
 		err(EXIT_FAILURE, "malloc()");
 
-	for (i = 0; i < num_fds; i++) {
+	for (i = 0; i < num_fd; i++) {
 		int fds[2];
 		struct receiver_context *ctx = malloc(sizeof(*ctx));
 
 		if (!ctx)
 			err(EXIT_FAILURE, "malloc()");
 
+		total_counter++;
 
 		/* Create the pipe between client and server */
 		fdpair(fds);
 
-		ctx->num_packets = num_fds * nr_loops;
+		ctx->num_packets = num_fd * nr_loops;
 		ctx->in_fds[0] = fds[0];
 		ctx->in_fds[1] = fds[1];
 		ctx->ready_out = ready_out;
@@ -223,24 +231,28 @@ static unsigned int group(pthread_t *pth,
 		snd_ctx->out_fds[i] = fds[1];
 		if (!thread_mode)
 			close(fds[0]);
+
+		ctx_arr[total_counter] = ctx;
 	}
 
 	/* Now we have all the fds, fork the senders */
-	for (i = 0; i < num_fds; i++) {
+	for (i = 0; i < num_fd; i++) {
 		snd_ctx->ready_out = ready_out;
 		snd_ctx->wakefd = wakefd;
-		snd_ctx->num_fds = num_fds;
+		snd_ctx->num_fds = num_fd;
 
-		pth[num_fds+i] = create_worker(snd_ctx, (void *)sender);
+		pth[num_fd+i] = create_worker(snd_ctx, (void *)sender);
 	}
 
 	/* Close the fds we have left */
 	if (!thread_mode)
-		for (i = 0; i < num_fds; i++)
+		for (i = 0; i < num_fd; i++)
 			close(snd_ctx->out_fds[i]);
 
+	snd_ctx_arr[total_counter] = snd_ctx;
+
 	/* Return number of children to reap */
-	return num_fds * 2;
+	return num_fd * 2;
 }
 
 static const struct option options[] = {
@@ -262,7 +274,6 @@ int bench_sched_messaging(int argc, const char **argv)
 {
 	unsigned int i, total_children;
 	struct timeval start, stop, diff;
-	unsigned int num_fds = 20;
 	int readyfds[2], wakefds[2];
 	char dummy;
 	pthread_t *pth_tab;
@@ -287,6 +298,7 @@ int bench_sched_messaging(int argc, const char **argv)
 		if (read(readyfds[0], &dummy, 1) != 1)
 			err(EXIT_FAILURE, "Reading for readyfds");
 
+
 	gettimeofday(&start, NULL);
 
 	/* Kick them off */
@@ -323,6 +335,11 @@ int bench_sched_messaging(int argc, const char **argv)
 		break;
 	}
 
+	/* Free malloc's */
+	for (i = 0; i < FD_NUM * GROUPS_NUM; i++) {
+		free(ctx_arr[i]);
+		free(snd_ctx_arr[i]);
+	}
 	free(pth_tab);
 
 	return 0;

--
2.25.1

#5 lore raw

Re: [PATCH] Fixup: perf bench: Fix two memory leaks detected with ASan

Hello Sohaib,

Quoted 2 lines · Sohaib Mohamed
Fixes 92723ea0f11d ("perf bench: Fix two memory leaks detected with

ASan")

Fixes and other tags are usually at the end, but before the S-o-b's, Tested-by's and such.

Quoted 5 lines

This patch fixes the previous patch which frees the ctx before the thread finishes the work. This break -t option.

This patch stores all overwritten pointers in a global vars then free them at the end of the program.

Clean up is complicated a bit, because the worker may either be forked off (so each main and worker has its own allocation) or threaded (with same allocation for both).

I wouldn't bother to fix small leaks in a short running application to be honest, but still some review below:

Quoted 17 lines

Tests:

$ perf bench sched messaging -g 1 -l 100 -t
$ perf bench sched messaging -g 1 -l 100
$ perf bench sched all
---
 tools/perf/bench/sched-messaging.c | 39 +++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 11 deletions(-)
tools/perf/bench/sched-messaging.c +0 -0
index 488f6e6ba1a5..f60dc9c36f4e 100644
@@ -30,11 +30,15 @@
 #include <linux/time64.h>

tools/perf/bench/sched-messaging.c line 39

Quoted 10 lines
tools/perf/bench/sched-messaging.c +3 -1
 
 #define DATASIZE 100
+#define GROUPS_NUM 10
+#define FD_NUM 20
 
 static bool use_pipes = false;
 static unsigned int nr_loops = 100;
 static bool thread_mode = false;
-static unsigned int num_groups = 10;
+static unsigned int num_groups = GROUPS_NUM;

Why is this a variable? Looks like it's never changed

tools/perf/bench/sched-messaging.c line 40

Quoted 1 line
tools/perf/bench/sched-messaging.c +1 -0
+static unsigned int num_fds = FD_NUM;

Same here

Quoted 15 lines
tools/perf/bench/sched-messaging.c +4 -0
+static unsigned int total_counter; /* num_groups * num_fds */
 
 struct sender_context {
 	unsigned int num_fds;
@@ -50,6 +54,9 @@ struct receiver_context {
 	int wakefd;
 };
 
+struct receiver_context *ctx_arr[FD_NUM*GROUPS_NUM];
+struct sender_context *snd_ctx_arr[FD_NUM*GROUPS_NUM];
+
 static void fdpair(int fds[2])
 {
 	if (use_pipes) {

tools/perf/bench/sched-messaging.c static void reap_worker(pthread_t id) · line 200

Quoted 5 lines
tools/perf/bench/sched-messaging.c +1 -1
@@ -190,29 +197,30 @@ static void reap_worker(pthread_t id)
 
 /* One group of senders and receivers */
 static unsigned int group(pthread_t *pth,
-		unsigned int num_fds,
+		unsigned int num_fd,

Especially fixes should be as short as possible. Renaming this variable could've been avoided.

Quoted 30 lines
tools/perf/bench/sched-messaging.c +4 -3
 		int ready_out,
 		int wakefd)
 {
 	unsigned int i;
 	struct sender_context *snd_ctx = malloc(sizeof(struct sender_context)
-			+ num_fds * sizeof(int));
+			+ num_fd * sizeof(int));
 
 	if (!snd_ctx)
 		err(EXIT_FAILURE, "malloc()");
 
-	for (i = 0; i < num_fds; i++) {
+	for (i = 0; i < num_fd; i++) {
 		int fds[2];
 		struct receiver_context *ctx = malloc(sizeof(*ctx));
 
 		if (!ctx)
 			err(EXIT_FAILURE, "malloc()");
 
+		total_counter++;
 
 		/* Create the pipe between client and server */
 		fdpair(fds);
 
-		ctx->num_packets = num_fds * nr_loops;
+		ctx->num_packets = num_fd * nr_loops;
 		ctx->in_fds[0] = fds[0];
 		ctx->in_fds[1] = fds[1];
 		ctx->ready_out = ready_out;

tools/perf/bench/sched-messaging.c static unsigned int group(pthread_t *pth, · line 235

Quoted 5 lines
tools/perf/bench/sched-messaging.c +2 -0
@@ -223,24 +231,28 @@ static unsigned int group(pthread_t *pth,
 		snd_ctx->out_fds[i] = fds[1];
 		if (!thread_mode)
 			close(fds[0]);
+
+		ctx_arr[total_counter] = ctx;

You could've done the total_counter++ here, which makes the relation easier to follow.

Quoted 11 lines
tools/perf/bench/sched-messaging.c +2 -3
 	}
 
 	/* Now we have all the fds, fork the senders */
-	for (i = 0; i < num_fds; i++) {
+	for (i = 0; i < num_fd; i++) {
 		snd_ctx->ready_out = ready_out;
 		snd_ctx->wakefd = wakefd;
-		snd_ctx->num_fds = num_fds;
+		snd_ctx->num_fds = num_fd;
 
-		pth[num_fds+i] = create_worker(snd_ctx, (void *)sender);

tools/perf/bench/sched-messaging.c static unsigned int group(pthread_t *pth, · line 252

Quoted 10 lines
tools/perf/bench/sched-messaging.c +3 -1
+		pth[num_fd+i] = create_worker(snd_ctx, (void *)sender);
 	}
 
 	/* Close the fds we have left */
 	if (!thread_mode)
-		for (i = 0; i < num_fds; i++)
+		for (i = 0; i < num_fd; i++)
 			close(snd_ctx->out_fds[i]);
 
+	snd_ctx_arr[total_counter] = snd_ctx;

You are storing at snd_ctx_arr[num_fd] each time, so you will leak all context, except for the last one.

Quoted 16 lines
tools/perf/bench/sched-messaging.c +2 -2
+
 	/* Return number of children to reap */
-	return num_fds * 2;
+	return num_fd * 2;
 }
 
 static const struct option options[] = {
@@ -262,7 +274,6 @@ int bench_sched_messaging(int argc, const char **argv)
 {
 	unsigned int i, total_children;
 	struct timeval start, stop, diff;
-	unsigned int num_fds = 20;
 	int readyfds[2], wakefds[2];
 	char dummy;
 	pthread_t *pth_tab;

tools/perf/bench/sched-messaging.c int bench_sched_messaging(int argc, const char **argv) · line 301

Quoted 4 lines
tools/perf/bench/sched-messaging.c +1 -0
@@ -287,6 +298,7 @@ int bench_sched_messaging(int argc, const char **argv)
 		if (read(readyfds[0], &dummy, 1) != 1)
 			err(EXIT_FAILURE, "Reading for readyfds");
 
+

Unneeded space.

tools/perf/bench/sched-messaging.c int bench_sched_messaging(int argc, const char **argv) · line 338

Quoted 8 lines
tools/perf/bench/sched-messaging.c +1 -0
 	gettimeofday(&start, NULL);
 
 	/* Kick them off */
@@ -323,6 +335,11 @@ int bench_sched_messaging(int argc, const char **argv)
 		break;
 	}
 
+	/* Free malloc's */

Unneeded comment.

tools/perf/bench/sched-messaging.c int bench_sched_messaging(int argc, const char **argv) · line 342

Quoted 4 lines
tools/perf/bench/sched-messaging.c +4 -0
+	for (i = 0; i < FD_NUM * GROUPS_NUM; i++) {
+		free(ctx_arr[i]);
+		free(snd_ctx_arr[i]);
+	}

At least in the threaded case, file descriptors are leaked and there's more memory associated with them than with the context structs you are freeing here.

If you are serious about fixing leaks, I think both should be fixed together, so I am in favor of just reverting the other patch for now.

Cheers,
Ahmad

Quoted 6 lines
tools/perf/bench/sched-messaging.c +0 -1
 	free(pth_tab);
 
 	return 0;
--

2.25.1

Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#6 lore raw

Re: [PATCH] Fixup: perf bench: Fix two memory leaks detected with ASan

Quoted 4 lines · Ahmad Fatoum

tools/perf/bench/sched-messaging.c static unsigned int group(pthread_t *pth, · line 252

Quoted 1 line
tools/perf/bench/sched-messaging.c +1 -0
+	snd_ctx_arr[total_counter] = snd_ctx;

You are storing at snd_ctx_arr[num_fd] each time, so you will leak all context, except for the last one.

Oh, it's more subtle than that. total_counter is of course incremented every time in the previous loop, so you will have num_fd times NULL (from static initialization) then a pointer to an allocation and so on. That works by the looks of it, but looks quite strange.

Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
author maintainer
#7 lore raw
In reply to Jiri Olsa

Em Fri, Nov 19, 2021 at 03:08:44PM +0100, Jiri Olsa escreveu:

Quoted 10 lines · Arnaldo Carvalho de Melo
Quoted 4 lines

After I updated to fedora 35 I started seeing the errors below, it may well not be related to that, maybe something on libbpf, haven't investigated, have you seen this?

yep, it seems the perf bench is broken so the counts won't correlated if I revert this one:
92723ea0f11d perf bench: Fix two memory leaks detected with ASan

Quoted 8 lines

it works for me again.. it seems to break -t option

Sohaib, could you please check on that?

[root@dell-r440-01 perf]# ./perf bench sched messaging -g 1 -l 100 -t # Running 'sched/messaging' benchmark:
RRRperf: CLIENT: ready write: Bad file descriptor
Rperf: SENDER: write: Bad file descriptor

I'm reverting that patch, with you as the author of the revert, ok?

- Arnaldo

Quoted 118 lines

thanks,
jirka

Quoted 115 lines

⬢[acme@toolbox perf]$ perf -vv
perf version 5.16.rc1.gfa2b5229b222

                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
               libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
                   aio: [ on  ]  # HAVE_AIO_SUPPORT
                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
               libpfm4: [ OFF ]  # HAVE_LIBPFM

⬢[acme@toolbox perf]$

This is with what I have now in my perf/urgent branch, the csets there aren't related:

⬢[acme@toolbox perf]$ git log --oneline torvalds/master..
b194c9cd09dd98af (HEAD -> perf/urgent, quaco/perf/urgent, acme/tmp.perf/urgent, acme/perf/urgent) perf evsel: Fix memory leaks relating to unit d9fc706108c15f8b perf report: Fix memory leaks around perf_tip()
0ca1f534a776cc7d perf hist: Fix memory leak of a perf_hpp_fmt
8b8dcc3720d57d88 tools headers UAPI: Sync MIPS syscall table file changed by new futex_waitv syscall
e8c04ea0fef5731d tools build: Fix removal of feature-sync-compare-and-swap feature detection
9e1a8d9f683260d5 perf inject: Fix ARM SPE handling
92723ea0f11d9249 perf bench: Fix two memory leaks detected with ASan
cb5a63feae2d963c perf test sample-parsing: Fix branch_stack entry endianness check
162b944598344fd7 tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources
db4b284029099224 perf sort: Fix the 'p_stage_cyc' sort key behavior
4d03c75363eeca86 perf sort: Fix the 'ins_lat' sort key behavior
784e8adda4cdb3e2 perf sort: Fix the 'weight' sort key behavior
70f9c9b2df1dd12c perf tools: Set COMPAT_NEED_REALLOCARRAY for CONFIG_AUXTRACE=1
ccb05590c4325ce5 perf tests wp: Remove unused functions on s390
346e91998cba46b6 tools headers UAPI: Sync linux/kvm.h with the kernel sources
b075c1d81e7d0e96 tools headers cpufeatures: Sync with the kernel sources
⬢[acme@toolbox perf]$

- Arnaldo

[acme@quaco perf]$ uname -a
Linux quaco 5.14.17-301.fc35.x86_64 #1 SMP Mon Nov 8 13:57:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
92: Check Arm CoreSight trace data recording and synthesized samples: Skip
93: Check Arm SPE trace data recording and synthesized samples : Skip
94: Check open filename arg using perf trace + vfs_getname : Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRRRRRRR Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRR Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRRRR Ok
[root@quaco ~]# uname -a
Linux quaco 5.14.17-301.fc35.x86_64 #1 SMP Mon Nov 8 13:57:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux [root@quaco ~]# set -o vi
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30079
RRRRRRRRRRRRRRRRRThe difference between 31599305 and 36265639 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30170
RRRRRRRRRRRRRRRRRRRRRRRRThe difference between 33311934 and 36973889 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30257
RRRRRRRRRRRRRRRRRThe difference between 31420157 and 36680527 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30341
RRRRRRRRRRRRRRRRRRRThe difference between 32451720 and 36750342 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30433
RRRRRRRRRRRRRRRRRRtest child finished with 0
---- end ----
perf stat --bpf-counters test: Ok
[root@quaco ~]#

Signature · 1 line
- Arnaldo
#8 lore raw
Quoted 13 lines · Arnaldo Carvalho de Melo

Em Fri, Nov 19, 2021 at 03:08:44PM +0100, Jiri Olsa escreveu:

Quoted 12 lines · Arnaldo Carvalho de Melo
Quoted 4 lines

After I updated to fedora 35 I started seeing the errors below, it may well not be related to that, maybe something on libbpf, haven't investigated, have you seen this?

yep, it seems the perf bench is broken so the counts won't correlated if I revert this one:
92723ea0f11d perf bench: Fix two memory leaks detected with ASan

it works for me again.. it seems to break -t option

Quoted 8 lines
Quoted 6 lines

Sohaib, could you please check on that?

[root@dell-r440-01 perf]# ./perf bench sched messaging -g 1 -l 100 -t # Running 'sched/messaging' benchmark:
RRRperf: CLIENT: ready write: Bad file descriptor
Rperf: SENDER: write: Bad file descriptor

I'm reverting that patch, with you as the author of the revert, ok?

sure, thanks

jirka

Quoted 126 lines

- Arnaldo

Quoted 118 lines

thanks,
jirka

Quoted 115 lines

⬢[acme@toolbox perf]$ perf -vv
perf version 5.16.rc1.gfa2b5229b222

                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
               libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
                   aio: [ on  ]  # HAVE_AIO_SUPPORT
                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
               libpfm4: [ OFF ]  # HAVE_LIBPFM

⬢[acme@toolbox perf]$

This is with what I have now in my perf/urgent branch, the csets there aren't related:

⬢[acme@toolbox perf]$ git log --oneline torvalds/master..
b194c9cd09dd98af (HEAD -> perf/urgent, quaco/perf/urgent, acme/tmp.perf/urgent, acme/perf/urgent) perf evsel: Fix memory leaks relating to unit d9fc706108c15f8b perf report: Fix memory leaks around perf_tip()
0ca1f534a776cc7d perf hist: Fix memory leak of a perf_hpp_fmt
8b8dcc3720d57d88 tools headers UAPI: Sync MIPS syscall table file changed by new futex_waitv syscall
e8c04ea0fef5731d tools build: Fix removal of feature-sync-compare-and-swap feature detection
9e1a8d9f683260d5 perf inject: Fix ARM SPE handling
92723ea0f11d9249 perf bench: Fix two memory leaks detected with ASan
cb5a63feae2d963c perf test sample-parsing: Fix branch_stack entry endianness check
162b944598344fd7 tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources
db4b284029099224 perf sort: Fix the 'p_stage_cyc' sort key behavior
4d03c75363eeca86 perf sort: Fix the 'ins_lat' sort key behavior
784e8adda4cdb3e2 perf sort: Fix the 'weight' sort key behavior
70f9c9b2df1dd12c perf tools: Set COMPAT_NEED_REALLOCARRAY for CONFIG_AUXTRACE=1
ccb05590c4325ce5 perf tests wp: Remove unused functions on s390
346e91998cba46b6 tools headers UAPI: Sync linux/kvm.h with the kernel sources
b075c1d81e7d0e96 tools headers cpufeatures: Sync with the kernel sources
⬢[acme@toolbox perf]$

- Arnaldo

[acme@quaco perf]$ uname -a
Linux quaco 5.14.17-301.fc35.x86_64 #1 SMP Mon Nov 8 13:57:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
92: Check Arm CoreSight trace data recording and synthesized samples: Skip
93: Check Arm SPE trace data recording and synthesized samples : Skip
94: Check open filename arg using perf trace + vfs_getname : Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRRRRRRR Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRR FAILED!
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRR Ok
[root@quaco ~]# perf test 91
91: perf stat --bpf-counters test :RRRRRRRRRRRRRRR Ok
[root@quaco ~]# uname -a
Linux quaco 5.14.17-301.fc35.x86_64 #1 SMP Mon Nov 8 13:57:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux [root@quaco ~]# set -o vi
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30079
RRRRRRRRRRRRRRRRRThe difference between 31599305 and 36265639 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30170
RRRRRRRRRRRRRRRRRRRRRRRRThe difference between 33311934 and 36973889 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30257
RRRRRRRRRRRRRRRRRThe difference between 31420157 and 36680527 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30341
RRRRRRRRRRRRRRRRRRRThe difference between 32451720 and 36750342 are greater than 10%. test child finished with -1
---- end ----
perf stat --bpf-counters test: FAILED!
[root@quaco ~]# perf test -v 91
91: perf stat --bpf-counters test :
--- start ---
test child forked, pid 30433
RRRRRRRRRRRRRRRRRRtest child finished with 0
---- end ----
perf stat --bpf-counters test: Ok
[root@quaco ~]#

Signature · 1 line
- Arnaldo