perf bench messaging: Store chlid process pid when creating worker for process mode
authorYang Jihong <yangjihong1@huawei.com>
Sat, 23 Sep 2023 09:30:36 +0000 (09:30 +0000)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 27 Sep 2023 04:47:12 +0000 (21:47 -0700)
commit07f3e6cf8581bcfe9f1bd4540768bc202983349f
tree827da071e11fa7aa27b8df3b72a44376b8fc29e3
parent5d2050453d489595ffa9491e05964e85c1927f35
perf bench messaging: Store chlid process pid when creating worker for process mode

To save pid of child processes when creating worker:
1. The messaging worker is changed to `union` type to store thread id and
   process pid.
2. Save child process pid in create_process_worker().
3. Rename `pth_tab` as `work_tab`.

Test result:

  # perf bench sched messaging
  # Running 'sched/messaging' benchmark:
  # 20 sender and receiver processes per group
  # 10 groups == 400 processes run

       Total time: 6.744 [sec]
  # perf bench sched messaging -t
  # Running 'sched/messaging' benchmark:
  # 20 sender and receiver threads per group
  # 10 groups == 400 threads run

       Total time: 5.788 [sec]

Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20230923093037.961232-4-yangjihong1@huawei.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/bench/sched-messaging.c