perf top: Fix stdio interface input handling with glibc 2.28+
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/3 perf top: Fix stdio interface input handling with glibc 2.28+
Since glibc 2.28 when running 'perf top --stdio', input handling no longer works, but hitting any key always just prints the "Mapped keys" help text.
To fix it, call clearerr() in the display_thread() loop to clear any EOF sticky errors, as instructed in the glibc NEWS file
(https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS):
* All stdio functions now treat end-of-file as a sticky condition. If you read from a file until EOF, and then the file is enlarged by another process, you must call clearerr or another function with the same effect (e.g. fseek, rewind) before you can read the additional data. This corrects a longstanding C99 conformance bug. It is most likely to affect programs that use stdio to read interactive input from a terminal. (Bug #1190.)
--- tools/perf/builtin-top.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/builtin-top.c +3 -1
@@ -684,7 +684,9 @@ static void *display_thread(void *arg) delay_msecs = top->delay_secs *MSEC_PER_SEC ;set_term_quiet_input (&save);/* trash return*/ -getc (stdin); +clearerr (stdin); +if (poll (&stdin_poll,1 ,0 ) >0 ) +getc (stdin);while (!done) {perf_top__print_sym_table (top);
Signature · 1 line
2.21.1
Em Thu, Mar 05, 2020 at 10:37:12AM +0200, Tommi Rantala escreveu:
Quoted 8 lines
Since glibc 2.28 when running 'perf top --stdio', input handling no longer works, but hitting any key always just prints the "Mapped keys" help text.
To fix it, call
clearerr()in thedisplay_thread()loop to clear any EOF sticky errors, as instructed in the glibc NEWS file
(https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS):
Quoted 7 lines
* All stdio functions now treat end-of-file as a sticky condition. If you read from a file until EOF, and then the file is enlarged by another process, you must call clearerr or another function with the same effect (e.g. fseek, rewind) before you can read the additional data. This corrects a longstanding C99 conformance bug. It is most likely to affect programs that use stdio to read interactive input from a terminal. (Bug #1190.)
Thanks for fixing this, I had stumbled on it at some point, but since I mostly use the TUI interface, it fell thru the cracks.
Do you prefer it over the TUI one?
Thanks, tested and applied.
- Arnaldo
Quoted 23 lines
Signed-off-by Tommi Rantala <[email protected]>--- tools/perf/builtin-top.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)tools/perf/builtin-top.c +3
-1@@ -684,7 +684,9 @@ static void *display_thread(void *arg) delay_msecs = top->delay_secs *MSEC_PER_SEC ;set_term_quiet_input (&save);/* trash return*/ -getc (stdin); +clearerr (stdin); +if (poll (&stdin_poll,1 ,0 ) >0 ) +getc (stdin);while (!done) {perf_top__print_sym_table (top);Signature · 1 line
2.21.1
Signature · 1 line
- Arnaldo
Quoted 4 lines · Arnaldo Carvalho de Melo
Thanks for fixing this, I had stumbled on it at some point, but since I mostly use the TUI interface, it fell thru the cracks.
Do you prefer it over the TUI one?
The stdio interface is important for us, as we're building perf without s- lang. To reduce dependencies I assume... But the TUI interface is certainly nice, so maybe we should just include s-lang to get it.
-Tommi
Quoted 27 lines
Thanks, tested and applied.
- Arnaldo
Quoted 23 lines
Signed-off-by Tommi Rantala <[email protected]>--- tools/perf/builtin-top.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)tools/perf/builtin-top.c +3
-1@@ -684,7 +684,9 @@ static void *display_thread(void *arg) delay_msecs = top->delay_secs *MSEC_PER_SEC ;set_term_quiet_input (&save);/* trash return*/ -getc (stdin); +clearerr (stdin); +if (poll (&stdin_poll,1 ,0 ) >0 ) +getc (stdin);while (!done) {perf_top__print_sym_table (top);Signature · 1 line
2.21.1
The following commit has been merged into the perf/urgent branch of tip:
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 29b4f5f188571c112713c35cc87eefb46efee612 Gitweb: https://git.kernel.org/tip/29b4f5f188571c112713c35cc87eefb46efee612 Author: Tommi Rantala <[email protected]> AuthorDate: Thu, 05 Mar 2020 10:37:12 +02:00 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitterDate: Fri, 06 Mar 2020 08:30:47 -03:00
perf top: Fix stdio interface input handling with glibc 2.28+
Since glibc 2.28 when running 'perf top --stdio', input handling no longer works, but hitting any key always just prints the "Mapped keys" help text.
To fix it, call clearerr() in the display_thread() loop to clear any EOF sticky errors, as instructed in the glibc NEWS file
(https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS):
* All stdio functions now treat end-of-file as a sticky condition. If you read from a file until EOF, and then the file is enlarged by another process, you must call clearerr or another function with the same effect (e.g. fseek, rewind) before you can read the additional data. This corrects a longstanding C99 conformance bug. It is most likely to affect programs that use stdio to read interactive input from a terminal. (Bug #1190.)
--- tools/perf/builtin-top.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/builtin-top.c +3 -1
@@ -684,7 +684,9 @@ repeat: delay_msecs = top->delay_secs *MSEC_PER_SEC ;set_term_quiet_input (&save);/* trash return*/ -getc (stdin); +clearerr (stdin); +if (poll (&stdin_poll,1 ,0 ) >0 ) +getc (stdin);while (!done) {perf_top__print_sym_table (top);
PATCH 2/3 perf bench futex-wake: Restore thread count default to online CPU count
In reply to a message not in the archiveSince commit 3b2323c2c1c4 ("perf bench futex: Use cpumaps") the default number of threads the benchmark uses got changed from number of online CPUs to zero:
$ perf bench futex wake # Running 'futex/wake' benchmark: Run summary [PID 15930]: blocking on 0 threads (at [private] futex 0x558b8ee4bfac), waking up 1 at a time. [Run 1]: Wokeup 0 of 0 threads in 0.0000 ms [...] [Run 10]: Wokeup 0 of 0 threads in 0.0000 ms Wokeup 0 of 0 threads in 0.0004 ms (+-40.82%)
Restore the old behavior by grabbing the number of online CPUs via cpu->nr:
$ perf bench futex wake # Running 'futex/wake' benchmark: Run summary [PID 18356]: blocking on 8 threads (at [private] futex 0xb3e62c), waking up 1 at a time. [Run 1]: Wokeup 8 of 8 threads in 0.0260 ms [...] [Run 10]: Wokeup 8 of 8 threads in 0.0270 ms Wokeup 8 of 8 threads in 0.0419 ms (+-24.35%)
--- tools/perf/bench/futex-wake.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/bench/futex-wake.c +2 -2
@@ -43,7 +43,7 @@ static bool done = false, silent = false, fshared = false;static pthread_mutex_t thread_lock;static pthread_cond_t thread_parent, thread_worker;static struct stats waketime_stats, wakeup_stats; -static unsigned int ncpus, threads_starting, nthreads =0 ; +static unsigned int threads_starting, nthreads =0 ;static int futex_flag =0 ;static const struct option options[] = {
@@ -141,7 +141,7 @@ int bench_futex_wake(int argc, const char **argv)sigaction (SIGINT , &act,NULL );if (!nthreads) - nthreads = ncpus; + nthreads = cpu->nr; worker =calloc (nthreads,sizeof (*worker));if (!worker)
Signature · 1 line
2.21.1
Re: [PATCH 2/3] perf bench futex-wake: Restore thread count default to online CPU count
Em Thu, Mar 05, 2020 at 10:37:13AM +0200, Tommi Rantala escreveu:
Quoted 23 lines
Since commit
3b2323c2c1c4("perf bench futex: Use cpumaps") the default number of threads the benchmark uses got changed from number of online CPUs to zero:$ perf bench futex wake # Running 'futex/wake' benchmark: Run summary [PID 15930]: blocking on 0 threads (at [private] futex 0x558b8ee4bfac), waking up 1 at a time. [Run 1]: Wokeup 0 of 0 threads in 0.0000 ms [...] [Run 10]: Wokeup 0 of 0 threads in 0.0000 ms Wokeup 0 of 0 threads in 0.0004 ms (+-40.82%)Restore the old behavior by grabbing the number of online CPUs via
cpu->nr:$ perf bench futex wake # Running 'futex/wake' benchmark: Run summary [PID 18356]: blocking on 8 threads (at [private] futex 0xb3e62c), waking up 1 at a time. [Run 1]: Wokeup 8 of 8 threads in 0.0260 ms [...] [Run 10]: Wokeup 8 of 8 threads in 0.0270 ms Wokeup 8 of 8 threads in 0.0419 ms (+-24.35%)
Quoted 1 line
Fixes 3b2323c2c1c4 ("perf bench futex: Use cpumaps")
Thanks, tested and applied.
- Arnaldo
Quoted 30 lines
Signed-off-by Tommi Rantala <[email protected]>--- tools/perf/bench/futex-wake.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/perf/bench/futex-wake.c +2
-2@@ -43,7 +43,7 @@ static bool done = false, silent = false, fshared = false;static pthread_mutex_t thread_lock;static pthread_cond_t thread_parent, thread_worker;static struct stats waketime_stats, wakeup_stats; -static unsigned int ncpus, threads_starting, nthreads =0 ; +static unsigned int threads_starting, nthreads =0 ;static int futex_flag =0 ;static const struct option options[] = {@@ -141,7 +141,7 @@ int bench_futex_wake(int argc, const char **argv)sigaction (SIGINT , &act,NULL );if (!nthreads) - nthreads = ncpus; + nthreads = cpu->nr; worker =calloc (nthreads,sizeof (*worker));if (!worker)Signature · 1 line
2.21.1
Signature · 1 line
- Arnaldo
Davidlohr Bueso
reviewerRe: [PATCH 2/3] perf bench futex-wake: Restore thread count default to online CPU count
Quoted 24 lines · Arnaldo Carvalho de Melo
Em Thu, Mar 05, 2020 at 10:37:13AM +0200, Tommi Rantala escreveu:
Quoted 23 lines
Since commit
3b2323c2c1c4("perf bench futex: Use cpumaps") the default number of threads the benchmark uses got changed from number of online CPUs to zero:$ perf bench futex wake # Running 'futex/wake' benchmark: Run summary [PID 15930]: blocking on 0 threads (at [private] futex 0x558b8ee4bfac), waking up 1 at a time. [Run 1]: Wokeup 0 of 0 threads in 0.0000 ms [...] [Run 10]: Wokeup 0 of 0 threads in 0.0000 ms Wokeup 0 of 0 threads in 0.0004 ms (+-40.82%)Restore the old behavior by grabbing the number of online CPUs via
cpu->nr:$ perf bench futex wake # Running 'futex/wake' benchmark: Run summary [PID 18356]: blocking on 8 threads (at [private] futex 0xb3e62c), waking up 1 at a time. [Run 1]: Wokeup 8 of 8 threads in 0.0260 ms [...] [Run 10]: Wokeup 8 of 8 threads in 0.0270 ms Wokeup 8 of 8 threads in 0.0419 ms (+-24.35%)
Quoted 3 lines
Quoted 1 line
Fixes 3b2323c2c1c4 ("perf bench futex: Use cpumaps")Thanks, tested and applied.
Thanks!
Re: [PATCH 2/3] perf bench futex-wake: Restore thread count default to online CPU count
Quoted 30 lines · Davidlohr Bueso
Quoted 2 lines · Arnaldo Carvalho de Melo
Em Thu, Mar 05, 2020 at 10:37:13AM +0200, Tommi Rantala escreveu:
Quoted 1 line
Since commit
3b2323c2c1c4("perf bench futex: Use cpumaps") thedefault
Quoted 1 line
Quoted 1 line
number of threads the benchmark uses got changed from number of
online
Quoted 5 lines
Quoted 5 lines
CPUs to zero:
$ perf bench futex wake # Running 'futex/wake' benchmark: Run summary [PID 15930]: blocking on 0 threads (at [private] futex
0x558b8ee4bfac), waking up 1 at a time.Quoted 11 lines
Quoted 11 lines
[Run 1]: Wokeup 0 of 0 threads in 0.0000 ms
[...]
[Run 10]: Wokeup 0 of 0 threads in 0.0000 ms
Wokeup 0 of 0 threads in 0.0004 ms (+-40.82%)Restore the old behavior by grabbing the number of online CPUs via
cpu->nr:$ perf bench futex wake # Running 'futex/wake' benchmark: Run summary [PID 18356]: blocking on 8 threads (at [private] futex
0xb3e62c), waking up 1 at a time.Quoted 5 lines
Quoted 5 lines
[Run 1]: Wokeup 8 of 8 threads in 0.0260 ms
[...]
[Run 10]: Wokeup 8 of 8 threads in 0.0270 ms
Wokeup 8 of 8 threads in 0.0419 ms (+-24.35%)
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Fixes 3b2323c2c1c4 ("perf bench futex: Use cpumaps")Thanks, tested and applied.
Thanks!
Taking that as an Acked-by, ok?
Signature · 1 line
Sent from my Android device with K-9 Mail. Please excuse my brevity.
[tip: perf/urgent] perf bench futex-wake: Restore thread count default to online CPU count
In reply to Tommi RantalaThe following commit has been merged into the perf/urgent branch of tip:
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: f649bd9dd5d5004543bbc3c50b829577b49f5d75 Gitweb: https://git.kernel.org/tip/f649bd9dd5d5004543bbc3c50b829577b49f5d75 Author: Tommi Rantala <[email protected]> AuthorDate: Thu, 05 Mar 2020 10:37:13 +02:00 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitterDate: Fri, 06 Mar 2020 08:30:47 -03:00
perf bench futex-wake: Restore thread count default to online CPU count
Since commit 3b2323c2c1c4 ("perf bench futex: Use cpumaps") the default number of threads the benchmark uses got changed from number of online CPUs to zero:
$ perf bench futex wake # Running 'futex/wake' benchmark: Run summary [PID 15930]: blocking on 0 threads (at [private] futex 0x558b8ee4bfac), waking up 1 at a time. [Run 1]: Wokeup 0 of 0 threads in 0.0000 ms [...] [Run 10]: Wokeup 0 of 0 threads in 0.0000 ms Wokeup 0 of 0 threads in 0.0004 ms (+-40.82%)
Restore the old behavior by grabbing the number of online CPUs via cpu->nr:
$ perf bench futex wake # Running 'futex/wake' benchmark: Run summary [PID 18356]: blocking on 8 threads (at [private] futex 0xb3e62c), waking up 1 at a time. [Run 1]: Wokeup 8 of 8 threads in 0.0260 ms [...] [Run 10]: Wokeup 8 of 8 threads in 0.0270 ms Wokeup 8 of 8 threads in 0.0419 ms (+-24.35%)
--- tools/perf/bench/futex-wake.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/bench/futex-wake.c +2 -2
@@ -43,7 +43,7 @@ static bool done = false, silent = false, fshared = false;static pthread_mutex_t thread_lock;static pthread_cond_t thread_parent, thread_worker;static struct stats waketime_stats, wakeup_stats; -static unsigned int ncpus, threads_starting, nthreads =0 ; +static unsigned int threads_starting, nthreads =0 ;static int futex_flag =0 ;static const struct option options[] = {
@@ -141,7 +141,7 @@ int bench_futex_wake(int argc, const char **argv)sigaction (SIGINT , &act,NULL );if (!nthreads) - nthreads = ncpus; + nthreads = cpu->nr; worker =calloc (nthreads,sizeof (*worker));if (!worker)
PATCH 3/3 perf bench: Clear struct sigaction before sigaction() syscall
In reply to a message not in the archiveAvoid garbage in sigaction structs used in sigaction() syscalls. Valgrind is complaining about it.
--- tools/perf/bench/epoll-ctl.c | 1 + tools/perf/bench/epoll-wait.c | 1 + tools/perf/bench/futex-hash.c | 1 + tools/perf/bench/futex-lock-pi.c | 1 + tools/perf/bench/futex-requeue.c | 1 + tools/perf/bench/futex-wake-parallel.c | 1 + tools/perf/bench/futex-wake.c | 1 + 7 files changed, 7 insertions(+)
tools/perf/bench/epoll-ctl.c +1 -0
@@ -313,6 +313,7 @@ int bench_epoll_ctl(int argc, const char **argv)exit (EXIT_FAILURE ); } +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
tools/perf/bench/epoll-wait.c +1 -0
@@ -427,6 +427,7 @@ int bench_epoll_wait(int argc, const char **argv)exit (EXIT_FAILURE ); } +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
tools/perf/bench/futex-hash.c +1 -0
@@ -137,6 +137,7 @@ int bench_futex_hash(int argc, const char **argv)if (!cpu) goto errmem; +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
tools/perf/bench/futex-lock-pi.c +1 -0
@@ -161,6 +161,7 @@ int bench_futex_lock_pi(int argc, const char **argv)if (!cpu)err (EXIT_FAILURE ,"calloc" ); +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
tools/perf/bench/futex-requeue.c +1 -0
@@ -128,6 +128,7 @@ int bench_futex_requeue(int argc, const char **argv)if (!cpu)err (EXIT_FAILURE ,"cpu_map__new" ); +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
tools/perf/bench/futex-wake-parallel.c +1 -0
@@ -234,6 +234,7 @@ int bench_futex_wake_parallel(int argc, const char **argv)exit (EXIT_FAILURE ); } +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
tools/perf/bench/futex-wake.c +1 -0
@@ -136,6 +136,7 @@ int bench_futex_wake(int argc, const char **argv)if (!cpu)err (EXIT_FAILURE ,"calloc" ); +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
Signature · 1 line
2.21.1
Arnaldo Carvalho de Melo
AppliedRe: [PATCH 3/3] perf bench: Clear struct sigaction before sigaction() syscall
Em Thu, Mar 05, 2020 at 10:37:14AM +0200, Tommi Rantala escreveu:
Quoted 2 lines
Avoid garbage in sigaction structs used in
sigaction()syscalls. Valgrind is complaining about it.
Thanks, applied.
- Arnaldo
Quoted 98 lines
Signed-off-by Tommi Rantala <[email protected]>--- tools/perf/bench/epoll-ctl.c | 1 + tools/perf/bench/epoll-wait.c | 1 + tools/perf/bench/futex-hash.c | 1 + tools/perf/bench/futex-lock-pi.c | 1 + tools/perf/bench/futex-requeue.c | 1 + tools/perf/bench/futex-wake-parallel.c | 1 + tools/perf/bench/futex-wake.c | 1 + 7 files changed, 7 insertions(+)tools/perf/bench/epoll-ctl.c +1
-0@@ -313,6 +313,7 @@ int bench_epoll_ctl(int argc, const char **argv)exit (EXIT_FAILURE ); } +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );tools/perf/bench/epoll-wait.c +1
-0@@ -427,6 +427,7 @@ int bench_epoll_wait(int argc, const char **argv)exit (EXIT_FAILURE ); } +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );tools/perf/bench/futex-hash.c +1
-0@@ -137,6 +137,7 @@ int bench_futex_hash(int argc, const char **argv)if (!cpu) goto errmem; +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );tools/perf/bench/futex-lock-pi.c +1
-0@@ -161,6 +161,7 @@ int bench_futex_lock_pi(int argc, const char **argv)if (!cpu)err (EXIT_FAILURE ,"calloc" ); +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );tools/perf/bench/futex-requeue.c +1
-0@@ -128,6 +128,7 @@ int bench_futex_requeue(int argc, const char **argv)if (!cpu)err (EXIT_FAILURE ,"cpu_map__new" ); +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );tools/perf/bench/futex-wake-parallel.c +1
-0@@ -234,6 +234,7 @@ int bench_futex_wake_parallel(int argc, const char **argv)exit (EXIT_FAILURE ); } +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );tools/perf/bench/futex-wake.c +1
-0@@ -136,6 +136,7 @@ int bench_futex_wake(int argc, const char **argv)if (!cpu)err (EXIT_FAILURE ,"calloc" ); +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );Signature · 1 line
2.21.1
Signature · 1 line
- Arnaldo
[tip: perf/urgent] perf bench: Clear struct sigaction before sigaction() syscall
In reply to Tommi RantalaThe following commit has been merged into the perf/urgent branch of tip:
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 7b919a53102d81cd2e310b4941ac51c465d249ca Gitweb: https://git.kernel.org/tip/7b919a53102d81cd2e310b4941ac51c465d249ca Author: Tommi Rantala <[email protected]> AuthorDate: Thu, 05 Mar 2020 10:37:14 +02:00 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitterDate: Fri, 06 Mar 2020 08:30:47 -03:00
perf bench: Clear struct sigaction before sigaction() syscall
Avoid garbage in sigaction structs used in sigaction() syscalls. Valgrind is complaining about it.
--- tools/perf/bench/epoll-ctl.c | 1 + tools/perf/bench/epoll-wait.c | 1 + tools/perf/bench/futex-hash.c | 1 + tools/perf/bench/futex-lock-pi.c | 1 + tools/perf/bench/futex-requeue.c | 1 + tools/perf/bench/futex-wake-parallel.c | 1 + tools/perf/bench/futex-wake.c | 1 + 7 files changed, 7 insertions(+)
tools/perf/bench/epoll-ctl.c +1 -0
@@ -312,6 +312,7 @@ int bench_epoll_ctl(int argc, const char **argv)exit (EXIT_FAILURE ); } +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
tools/perf/bench/epoll-wait.c +1 -0
@@ -426,6 +426,7 @@ int bench_epoll_wait(int argc, const char **argv)exit (EXIT_FAILURE ); } +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
tools/perf/bench/futex-hash.c +1 -0
@@ -137,6 +137,7 @@ int bench_futex_hash(int argc, const char **argv)if (!cpu) goto errmem; +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
tools/perf/bench/futex-lock-pi.c +1 -0
@@ -160,6 +160,7 @@ int bench_futex_lock_pi(int argc, const char **argv)if (!cpu)err (EXIT_FAILURE ,"calloc" ); +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
tools/perf/bench/futex-requeue.c +1 -0
@@ -128,6 +128,7 @@ int bench_futex_requeue(int argc, const char **argv)if (!cpu)err (EXIT_FAILURE ,"cpu_map__new" ); +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
tools/perf/bench/futex-wake-parallel.c +1 -0
@@ -234,6 +234,7 @@ int bench_futex_wake_parallel(int argc, const char **argv)exit (EXIT_FAILURE ); } +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );
tools/perf/bench/futex-wake.c +1 -0
@@ -136,6 +136,7 @@ int bench_futex_wake(int argc, const char **argv)if (!cpu)err (EXIT_FAILURE ,"calloc" ); +memset (&act,0 ,sizeof (act));sigfillset (&act.sa_mask); act.sa_sigaction = toggle_done;sigaction (SIGINT , &act,NULL );