<div dir="ltr">Thank you for your suggestions!<div>Based on our discussion, I've uploaded the patch[1] :)</div><div><br></div><div>[1]: <a href="https://bugs.webkit.org/show_bug.cgi?id=166678">https://bugs.webkit.org/show_bug.cgi?id=166678</a></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,<br>Yusuke Suzuki</div></div></div></div>
<br><div class="gmail_quote">On Fri, Jan 6, 2017 at 2:50 PM, Yusuke SUZUKI <span dir="ltr"><<a href="mailto:utatane.tea@gmail.com" target="_blank">utatane.tea@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">On Fri, Jan 6, 2017 at 2:43 PM, Maciej Stachowiak <span dir="ltr"><<a href="mailto:mjs@apple.com" target="_blank">mjs@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="m_-3400076575786200877h5"><br><div><blockquote type="cite"><div>On Jan 5, 2017, at 8:07 PM, Yusuke SUZUKI <<a href="mailto:utatane.tea@gmail.com" target="_blank">utatane.tea@gmail.com</a>> wrote:</div><br class="m_-3400076575786200877m_118899531110008129Apple-interchange-newline"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 6, 2017 at 10:37 AM, Maciej Stachowiak<span class="m_-3400076575786200877m_118899531110008129Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:mjs@apple.com" target="_blank">mjs@apple.com</a>></span><span class="m_-3400076575786200877m_118899531110008129Apple-converted-space"> </span>wro<wbr>te:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class="m_-3400076575786200877m_118899531110008129gmail-"><blockquote type="cite"><div>On Jan 5, 2017, at 9:37 AM, Brady Eidson <<a href="mailto:beidson@apple.com" target="_blank">beidson@apple.com</a>> wrote:</div><br class="m_-3400076575786200877m_118899531110008129gmail-m_-8698724453431853117Apple-interchange-newline"><div><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Jan 5, 2017, at 12:48 AM, Yusuke SUZUKI <<a href="mailto:utatane.tea@gmail.com" target="_blank">utatane.tea@gmail.com</a>> wrote:</div><br class="m_-3400076575786200877m_118899531110008129gmail-m_-8698724453431853117Apple-interchange-newline"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 5, 2017 at 5:43 PM, Darin Adler<span class="m_-3400076575786200877m_118899531110008129Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:darin@apple.com" target="_blank">darin@apple.com</a>></span><span class="m_-3400076575786200877m_118899531110008129Apple-converted-space"> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">I understand the appeal of “org.webkit” and structured names but personally I would prefer to read names that look like titles and are made up of words with spaces, like these:<br><br>“WebKit: Image Decoder”, rather than “org.webkit.ImageDecoder”.<br>“WebKit: JavaScript DFG Compiler” rather than “org.webkit.jsc.DFGCompiler”.<br><br>Not sure how well that would generalize to all the different names.<br><br>I like the idea of having a smart way of automatically making a shorter name for the platforms that have shorter length limits.<br></blockquote><div><br></div><div>One interesting idea I've come up with is that,</div><div><br></div><div>1. specifying "org.webkit.ImageDecoder"</div><div>2. In Linux, we just use "ImageDecoder" part.</div><div>3. In macOS port, we automatically convert it to "WebKit: Image Decoder”</div></div></div></div></div></blockquote><div><br></div><div><div>Why do we specify “org.webkit.ImageDecoder” if only the “ImageDecoder” part is ever going to be used?</div></div><div>Is that because Windows could use “org.webkit.”?</div></div></div></div></blockquote><div><br></div></span><div>What about if you just specify "Image Decoder" and we automatically convert that to either "ImageDecoder" or "WebKit: Image Decoder" based on platform thread name limits? Is there any case where we want a prefix other than "WebKit: "?</div></div></div></blockquote><div><br></div><div>Yeah. For the prefix case, automatically adding "WebKit: " is fine. The current ToT has the name like "<span style="font-size:12.8px">com.apple.IPC.ReceiveQueue".</span></div><div><span style="font-size:12.8px">Previously I thought that we may need to convert it to "Apple WebKit:" or something like that.</span></div><div><span style="font-size:12.8px">But now, I think simply using "WebKit: IPC Receive Queue" is fine.</span></div><div><br></div><div>But I think automatically changing "ImageDecoder" to "Image Decoder" does not work well with long names.</div><div>There is a name like "AsynchrnousDisassembler". It is >= 15 characters. "AsynchronousDisas" is not good for Linux.</div><div>On the other hand, using "AsyncDisasm" => "WebKit: AsyncDisasm" is not good for macOS.</div><div>For macOS, we can choose more readable name like "WebKIt: Asynchronous Disassembler".</div><div><br></div><div>So, I think Geoffrey's suggestion works well: using long / short name pairs. Like,</div><div><br></div><div>ThreadName { "Asynchronous Disassembler", "AsyncDisasm" } // { const char*, const char* }</div><div><br></div><div>// OR, </div><div>CREATE_THREAD_NAME("Asynchrono<wbr>us Disassembler", "AsyncDisasm") macro => generating ThreadName("WebKit: Asynchronous Disassembler") on macOS, ThreadName("AsyncDisasm") on Linux</div></div></div></div></div></blockquote><br></div></div></div><div>If there's a good set of "short name" and "long name" length limits, it would be cool if we could check the length at compile time, which seems more feasible with the macro.</div><div><br></div></div></blockquote><div><br></div></div></div><div>Yeah! That's what I would like to do. The typical ThreadName implementation would become the following.</div><div><br></div><div>class ThreadName {</div><div>public:</div><div> template<unsigned N></div><div> explicit ThreadName(const char (&name)[N])</div><div> : m_name(name)</div><div> {</div><div>#if OS(LINUX)</div><div> static_assert(N <= 16, "");</div><div>#else if OS(WINDOWS)</div><div> static_assert(N <= 32, "");</div><div>#endif</div><div> }</div><div><br></div><div> operator const char*()</div><div> {</div><div> return m_name;</div><div> }</div><div><br></div><div>private:</div><div> const char* m_name;</div><div>};</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>Regards,</div><div>Maciej</div><div><br></div></div></blockquote></div><br></div></div>
</blockquote></div><br></div>