Bug 166663

Summary: Use prctl to name thread on Linux
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cgarcia, cmarcelo, commit-queue, dbates, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 166676    
Attachments:
Description Flags
Patch mcatanzaro: review+

Yusuke Suzuki
Reported 2017-01-03 14:22:40 PST
Use prctl to name thread on Linux
Attachments
Patch (1.43 KB, patch)
2017-01-03 14:24 PST, Yusuke Suzuki
mcatanzaro: review+
Yusuke Suzuki
Comment 1 2017-01-03 14:24:00 PST
Michael Catanzaro
Comment 2 2017-01-03 15:26:16 PST
Comment on attachment 297953 [details] Patch OK, I don't see why not. Did you do this to help Carlos keep track of which thread is the main thread? :D What do our thread names look like? I see from prctl(2) that they are truncated to 16 characters; I wonder if our names are often longer than that?
Yusuke Suzuki
Comment 3 2017-01-03 23:37:58 PST
(In reply to comment #2) > Comment on attachment 297953 [details] > Patch > > OK, I don't see why not. Did you do this to help Carlos keep track of which > thread is the main thread? :D > > What do our thread names look like? I see from prctl(2) that they are > truncated to 16 characters; I wonder if our names are often longer than that? Yeah, characters are truncated. The typical form is like, jsc.watchdog.queue org.webkit.ThreadedCompositorWorkQueue So I think we should retrieve trailing 16 characters.
Yusuke Suzuki
Comment 4 2017-01-04 00:27:04 PST
(In reply to comment #3) > (In reply to comment #2) > > Comment on attachment 297953 [details] > > Patch > > > > OK, I don't see why not. Did you do this to help Carlos keep track of which > > thread is the main thread? :D > > > > What do our thread names look like? I see from prctl(2) that they are > > truncated to 16 characters; I wonder if our names are often longer than that? > > Yeah, characters are truncated. The typical form is like, > > jsc.watchdog.queue > org.webkit.ThreadedCompositorWorkQueue > > So I think we should retrieve trailing 16 characters. I'll just port WorkQueue::platformInitialize's threadName handling.
Yusuke Suzuki
Comment 5 2017-01-04 00:27:57 PST
(In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #2) > > > Comment on attachment 297953 [details] > > > Patch > > > > > > OK, I don't see why not. Did you do this to help Carlos keep track of which > > > thread is the main thread? :D > > > > > > What do our thread names look like? I see from prctl(2) that they are > > > truncated to 16 characters; I wonder if our names are often longer than that? > > > > Yeah, characters are truncated. The typical form is like, > > > > jsc.watchdog.queue > > org.webkit.ThreadedCompositorWorkQueue > > > > So I think we should retrieve trailing 16 characters. > > I'll just port WorkQueue::platformInitialize's threadName handling. I'll do that in different patch :)
Yusuke Suzuki
Comment 6 2017-01-04 00:30:52 PST
Yusuke Suzuki
Comment 7 2017-01-04 01:44:32 PST
(In reply to comment #2) > Comment on attachment 297953 [details] > Patch > > OK, I don't see why not. Did you do this to help Carlos keep track of which > thread is the main thread? :D > > What do our thread names look like? I see from prctl(2) that they are > truncated to 16 characters; I wonder if our names are often longer than that? I found it when debugging WorkQueue thing. I'm super happy if it would help Carlos :)
Note You need to log in before you can comment on or make changes to this bug.