logging: print human-readable thread names when logging
The lttng_thread interface used by the session daemon uniquely names
all threads. This name can be used to augment the thread's logging
statement with a human-readable name rather than using the pid/tid
tuple used elsewhere.
Additionally, the thread name is set using the pthread API so that it
is visible in GDB and other tools (e.g. htop).
Invocations of pgrep in the test utilities are replaced by 'pgrep -f',
which matches against the process name.
We are not the first to encounter this problem after renaming the main
thread, see
https://github.com/mongodb/mongo/commit/
726cafd713c7333640f8458ec9808ed4f678e3a7#diff-a9003101d1e4a99ac2d43d9b1b839587R122
pgrep uses the name name in /proc/$PID/status which contains the
thread name, not the executable name. In the case of the sessiond,
this is now "Main".
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I73dfe8683b2ea31f7ed0c2ffdfa8332f36e28f9b