[systemd-devel] [PATCH] util: preserve get_process_capeff behavior

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Thu Sep 19 14:40:51 PDT 2013


On Thu, Sep 19, 2013 at 10:28:40AM -0700, Shawn Landden wrote:
> We can't optimize the strcspn(t, WHITESPACE); to a strchr(t, '\n') - t;
> because of the " kB" that meminfo and a few other places have, that we want
> to drop.
> 
> get_status_field() has to be run every time we log a message, and I am
> starting to not like this function at all. I think we should go back to
> having it hand-rolled in get_process_capeff(), at least for that one in the
> hot-path.
Hi Shawn,

I think there's value in having one function to parse /proc/self/status.
I pushed some tests and a simple fix to avoid backtracking. Anyway, this
parsing might be going away, once we start using the equivalent of SCM_CREDENTIALS
for capabilities, so I don't think it makes sense to optimize it at this point.

Zbyszek


More information about the systemd-devel mailing list