[GHC] #14153: Change worker thread name to something mentioning original process name
#14153: Change worker thread name to something mentioning original process name ----------------------------------------+--------------------------------- Reporter: enolan | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 8.2.1 Keywords: | Operating System: Linux Architecture: Unknown/Multiple | Type of failure: None/Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: ----------------------------------------+--------------------------------- Worker OS thread are renamed to `ghc_worker` when spawned. This is annoying when reading debugging messages that print the process name. For example, at work I'm debugging a segfault in a Haskell program and the kernel message just says `ghc_worker[21992]: segfault at 0 ip...` which doesn't tell me which of our Haskell programs is having the problem. I'd like to change this so it mentions the original name. On Linux, we can get that from the `program_invocation_name` global. `pthread_setname_np` has a maximum length of 15 characters, so we'll have to truncate it. I propose the first 13 characters of the original name followed by ":w". I'd just as soon not change the name in the first place but apparently this change was made to make it easier to distinguish worker threads from the main thread when debugging processes in gdb (commit 674c631ea111233daa929ef63500d75ba0db8858). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14153> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14153: Change worker thread name to something mentioning original process name -------------------------------------+------------------------------------- Reporter: enolan | Owner: enolan Type: feature request | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by enolan): * owner: (none) => enolan -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14153#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14153: Change worker thread name to something mentioning original process name -------------------------------------+------------------------------------- Reporter: enolan | Owner: enolan Type: feature request | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): I agree; I have found the `ghc_worker` name quite confusing in the past. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14153#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14153: Change worker thread name to something mentioning original process name -------------------------------------+------------------------------------- Reporter: enolan | Owner: enolan Type: feature request | Status: patch Priority: normal | Milestone: Component: Runtime System | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): phab:D4001 Wiki Page: | -------------------------------------+------------------------------------- Changes (by enolan): * status: new => patch * differential: => phab:D4001 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14153#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14153: Change worker thread name to something mentioning original process name -------------------------------------+------------------------------------- Reporter: enolan | Owner: enolan Type: feature request | Status: patch Priority: normal | Milestone: Component: Runtime System | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): phab:D4001 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"d07b8c7ae8bc22a7c36c96cb3fd800aecdde6eac/ghc" d07b8c7/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="d07b8c7ae8bc22a7c36c96cb3fd800aecdde6eac" 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 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14153#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14153: Change worker thread name to something mentioning original process name -------------------------------------+------------------------------------- Reporter: enolan | Owner: enolan Type: feature request | Status: closed Priority: normal | Milestone: 8.4.1 Component: Runtime System | Version: 8.2.1 Resolution: fixed | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): phab:D4001 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.4.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14153#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC