Include original process name in worker thread name (#14153)
authorEcho Nolan <echo@echonolan.net>
Mon, 25 Sep 2017 22:33:30 +0000 (18:33 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 26 Sep 2017 02:43:52 +0000 (22:43 -0400)
commitd07b8c7ae8bc22a7c36c96cb3fd800aecdde6eac
tree46a5cbf6659af1a8dd7890f8d0c8e5fbb65c5228
parent6de1a5a96cdaba080570e9f47ff8711796e2e83b
Include original process name in worker thread name (#14153)

Prior to this commit, worker OS thread were renamed to "ghc_worker" when
spawned. This was annoying when reading debugging messages that print
the process name because it doesn't tell you *which* Haskell program is
generating the message.

This commit changes it to "original_process_name:w", truncating the
original name to fit in the kernel buffer if neccesary.

Test Plan: ./validate

Reviewers: austin, bgamari, erikd, simonmar

Reviewed By: bgamari

Subscribers: Phyx, rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D4001
rts/Task.c