<div dir="ltr">On Tue, Jul 30, 2013 at 6:53 AM, Ed Maste <span dir="ltr"><<a href="mailto:emaste@freebsd.org" target="_blank">emaste@freebsd.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On 29 July 2013 22:13, Michael Sartain <<a href="mailto:mikesart@gmail.com">mikesart@gmail.com</a>> wrote:<br>
><br>
> Here is a patch that defaults thread ids to decimal for freebsd + linux, and<br>
> also adds the ability to add print specifiers to <a href="http://process.id" target="_blank">process.id</a>, <a href="http://thread.id" target="_blank">thread.id</a>,<br>
> <a href="http://thread.protocol.id" target="_blank">thread.protocol.id</a>, thread.index, and line.number. Something like this:<br>
><br>
> // Allow format specifiers: x|X|u with optional width<br>
> specifiers.<br>
> // {<a href="http://thread.id" target="_blank">thread.id</a>%x} ; hex<br>
> // {<a href="http://thread.id" target="_blank">thread.id</a>%X} ; uppercase hex<br>
> // {<a href="http://thread.id" target="_blank">thread.id</a>%u} ; unsigned decimal<br>
> // {<a href="http://thread.id" target="_blank">thread.id</a>%8.8X} ; width.precision + specifier<br>
><br>
> <a href="http://llvm-reviews.chandlerc.com/D1234" target="_blank">http://llvm-reviews.chandlerc.com/D1234</a><br>
><br>
> Please holler with any feedback. Thanks,<br>
> -Mike<br>
<br>
</div>Overall it looks fine to me. I think we'd ideally have a run-time<br>
default, so that if you e.g. debug a Linux core on OS X you get<br>
decimal TIDs, but that could be done later if it's awkward.<br>
</blockquote></div><br></div><div class="gmail_extra">I added a %tid specifier which seems to be a fairly clean way of getting this. Default thread format looks like this now:</div><div class="gmail_extra"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span style="font-family:arial,sans-serif">#define DEFAULT_THREAD_FORMAT "thread #${thread.index}: tid = ${<a href="http://thread.id">thread.id</a>%tid}"\<br></span><font face="arial, sans-serif"> "{, ${frame.pc}}"\ ...</font></blockquote>
<div class="gmail_extra"><div class="gmail_extra"><font face="arial, sans-serif"><br></font></div><div class="gmail_extra"><font face="arial, sans-serif">Let me know if this looks ok and I'll commit...</font></div><div class="gmail_extra">
<span style="font-family:arial,sans-serif">Thanks.</span><br></div><div class="gmail_extra"><font face="arial, sans-serif"> -Mike</font></div></div></div>