<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Krystal,<div><br></div><div>I'm thinking that if we're looking to do this in one shot, it's never going to get done. I don't care if the log records are time ordered. I don't care if we happen to lose one or two of them. In some cases I'll simply delete corrupted records from the log file. Missing a few out of thousands makes very little difference in the analysis.</div><div><br></div><div>I was thinking that maybe the gclog_or_tty could be replaced with a set of buffers. Writes would end up in the buffers. This is where things get a little fuzzy as I don't understand all of the intricacies of the code. But, maybe there is a way to have the GC thread dump the buffer just at the end of it's phase with the exception of CMS. Though might delegate the dumping of CMS records to the young gen collector. All the CMS collector would offer it's log records to the YG collector when it's done.</div><div><br></div><div>Regards,</div><div>Kirk</div><div><br></div><div><div><blockquote type="cite"><div><br></div><div>Unfortunately the current way of logging directly uses the global tty, gclog_or_tty, xtty in a lot of places throughout the code, and RAII objects aren't supposed to be passed around. I tried to modify TraceTime to get this fixed, but it got quite messy.</div>
<div><br></div><div>Would it be okay if:</div><div>A thread-local hook is added to outputStream, and allow those RAII objects to keep a buffer and register thenselves to the hook (nested ones get chained up), and that whenever an outputStream object receives a print/stamp sort of method call, it delegates the call to the registered buffers; and finally in the RAII objects' destructors, unregister from the outputStream and write out the buffered contents.</div>
<div><br></div><div>This way the code that use gclog_or_tty directly would stay the same, and we may get logs that look more intact but doesn't always keep the ordering of events.</div><div><br></div><div>If it sounds like a possible solution, I'd volunteer to write a prototype for it. Don't know how it'd conflict with the standardizing of logging, though.</div>
<div><br></div><div>Regards,</div><div>Kris Mok</div><div><br><div class="gmail_quote">On Wed, Nov 9, 2011 at 12:22 AM, Jon Masamitsu <span dir="ltr"><<a href="mailto:jon.masamitsu@oracle.com">jon.masamitsu@oracle.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Kirk,<br>
    <br>
    Sorry but there is nothing I'm aware of that will fix this<br>
    problem with the current way of doing logging.   It plagues<br>
    us as much as anyone but no one has screamed "I can't<br>
    take it anymore"  and fixed it.<br><font color="#888888">
    <br>
    Jon</font><div><div></div><div class="h5"><br>
    <br>
    On 11/07/11 13:49, Charles K Pepperdine wrote:
    </div></div><blockquote type="cite"><div><div></div><div class="h5">Hi all,
      <div><br>
      </div>
      <div>Line 15 of this log file has a ParNew record split by the end
        or an abortable-preclean. Is there a way to prevent the gc log
        records from being corrupted in this way? This is not the only
        place it happens and it makes an already impossible task of
        scanning these things much harder.</div>
      <div><br>
      </div>
      <div>Regards,</div>
      <div>Kirk</div>
      <div><br>
        <div><br>
          <div>Begin forwarded message:</div>
          <br>
          <blockquote type="cite"><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"></span></blockquote>

        </div>
      </div></div></div>
      =<br>
      <fieldset></fieldset>
      <br>
      <div>
        <div>
          <blockquote type="cite"><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"></span></blockquote>

        </div>
        <br>
      </div>
    </blockquote>
  </div>

</blockquote></div><br></div>
</blockquote></div><br></div></body></html>