<div dir="ltr">On Thu, Sep 19, 2013 at 2:40 PM, Zbigniew Jędrzejewski-Szmek <span dir="ltr"><<a href="mailto:zbyszek@in.waw.pl" target="_blank">zbyszek@in.waw.pl</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Sep 19, 2013 at 10:28:40AM -0700, Shawn Landden wrote:<br>
> We can't optimize the strcspn(t, WHITESPACE); to a strchr(t, '\n') - t;<br>
> because of the " kB" that meminfo and a few other places have, that we want<br>
> to drop.<br>
><br>
> get_status_field() has to be run every time we log a message, and I am<br>
> starting to not like this function at all. I think we should go back to<br>
> having it hand-rolled in get_process_capeff(), at least for that one in the<br>
> hot-path.<br>
</div>Hi Shawn,<br>
<br>
I think there's value in having one function to parse /proc/self/status.<br>
I pushed some tests and a simple fix to avoid backtracking.</blockquote><div>It wasn't backtracking more than it has already gone forward. I even had an assert for this, anyways, the current version is correct. </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Anyway, this<br>
parsing might be going away, once we start using the equivalent of SCM_CREDENTIALS<br>
for capabilities, </blockquote><div>That requires a kernel patch, meanwhile we will have compatibility code for old kernels...I think my optimized version still makes sense, although something like SCM_CREDIENTIALS would certainly be more optimized.</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">so I don't think it makes sense to optimize it at this point.<br>
<br>
Zbyszek<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><br>---<br>Shawn Landden<br><div>+1 360 389 3001 (SMS preferred)</div></div>
</div></div>