linux-stable/tools/perf/bench
Yang Jihong bb2e04d449 perf bench messaging: Kill child processes when exit abnormally in process mode
When exit abnormally in process mode, customize SIGINT and SIGTERM signal
handler to kill the forked child processes.

Before:

  # perf bench sched messaging -l 1000000 -g 1 &
  [1] 8519
  # # Running 'sched/messaging' benchmark:

  # pgrep sched-messaging | wc -l
  41
  # kill -15 8519
  [1]+  Terminated              perf bench sched messaging -l 1000000 -g 1
  # pgrep sched-messaging | wc -l
  40

After:

  # perf bench sched messaging -l 1000000 -g 1 &
  [1] 8472
  # # Running 'sched/messaging' benchmark:

  # pgrep sched-messaging | wc -l
  41
  # kill -15 8472
  [1]+  Exit 1                  perf bench sched messaging -l 1000000 -g 1
  # pgrep sched-messaging | wc -l
  0

Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20230923093037.961232-5-yangjihong1@huawei.com
[ namhyung: fix a whitespace ]
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2023-09-26 21:47:12 -07:00
..
bench.h perf tools changes for v6.6: 2023-09-09 20:06:17 -07:00
breakpoint.c perf bench breakpoint: Skip run if no breakpoints available 2023-08-23 08:39:02 -03:00
Build perf tools changes for v6.6: 2023-09-09 20:06:17 -07:00
epoll-ctl.c perf bench epoll: Fix missing frees/puts on the exit path 2023-06-12 18:18:14 -03:00
epoll-wait.c perf bench epoll: Fix missing frees/puts on the exit path 2023-06-12 18:18:14 -03:00
evlist-open-close.c perf evlist: Rename cpus to user_requested_cpus 2022-04-01 16:19:35 -03:00
find-bit-bench.c perf bench: Avoid NDEBUG warning 2023-04-04 09:39:56 -03:00
futex-hash.c perf bench: Update use of pthread mutex/cond 2022-10-04 08:55:19 -03:00
futex-lock-pi.c perf bench futex: Avoid memory leaks from pthread_attr 2023-06-12 18:18:14 -03:00
futex-requeue.c perf bench futex: Avoid memory leaks from pthread_attr 2023-06-12 18:18:14 -03:00
futex-wake-parallel.c perf bench futex: Avoid memory leaks from pthread_attr 2023-06-12 18:18:14 -03:00
futex-wake.c perf bench futex: Avoid memory leaks from pthread_attr 2023-06-12 18:18:14 -03:00
futex.h Revert "perf bench futex: Add support for 32-bit systems with 64-bit time_t" 2021-11-01 11:42:54 -03:00
inject-buildid.c perf bench inject-buildid: Use zfree() to reduce chances of use after free 2023-04-12 10:14:01 -03:00
kallsyms-parse.c
mem-functions.c
mem-memcpy-arch.h
mem-memcpy-x86-64-asm-def.h tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
mem-memcpy-x86-64-asm.S tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
mem-memset-arch.h
mem-memset-x86-64-asm-def.h tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
mem-memset-x86-64-asm.S tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' 2023-05-17 10:42:19 -03:00
numa.c perf bench numa: Fix type of loop iterator in do_work, it should be 'long' 2023-04-04 09:39:56 -03:00
pmu-scan.c perf pmu: Abstract alias/event struct 2023-08-24 10:42:46 -03:00
sched-messaging.c perf bench messaging: Kill child processes when exit abnormally in process mode 2023-09-26 21:47:12 -07:00
sched-pipe.c perf tools: Cast (struct timeval).tv_sec when printing 2021-03-06 16:54:24 -03:00
sched-seccomp-notify.c perf/benchmark: add a new benchmark for seccom_unotify 2023-07-17 16:08:08 -07:00
synthesize.c perf tools: Allow controlling synthesizing PERF_RECORD_ metadata events during record 2021-09-17 08:44:19 -03:00
syscall.c perf bench syscall: Add fork syscall benchmark 2023-04-04 09:39:55 -03:00
uprobe.c perf bench uprobe trace_printk: Add entry attaching an BPF program that does a trace_printk 2023-07-20 11:33:24 -03:00