DEBUG: pollers/fd: add thread id suffix to per-thread memory areas name hints
Willy reported that since
abb8412d2 ("DEBUG: pollers: add name hint for
large memory areas used by pollers") and
22ec2ad8b ("DEBUG: fd: add name
hint for large memory areas") multiple maps with the same name could be
found in /proc/<pid>/maps when haproxy process is started with multiple
threads, which can be annoying.
In fact this happens because some poller and fd-created memory areas are
being created for each available thread, and since the naming was done
using vma_set_name() with the same <type> and <name> inputs, the resulting
name was the same for all threads.
Thanks to the previous commit, we now use vma_set_name_id() for naming
per-thread memory areas so that "-id" prefix is appended after the name
name, where "id" equals to 'tid+1' (to match the thread numbering logic
found in config file or in ha_panic() report), allowing to easily
identify which haproxy thread owns the map in /proc/<pid>/maps:
7d3b26200000-
7d3b26a01000 rw-p
00000000 00:00 0 [anon:ev_poll:poll_events-2]
7d3b26c00000-
7d3b27001000 rw-p
00000000 00:00 0 [anon:fd:fd_updt-2]
7d3b27200000-
7d3b27a01000 rw-p
00000000 00:00 0 [anon:ev_poll:poll_events-1]
7d3b34200000-
7d3b34601000 rw-p
00000000 00:00 0 [anon:fd:fd_updt-1]