[systemd-devel] [PATCH v2] journalctl: Improve boot ID lookup

Lennart Poettering lennart at poettering.net
Wed Apr 8 05:39:48 PDT 2015


On Thu, 02.04.15 17:08, Jan Janssen (medhefgo at web.de) wrote:

> This method should greatly improve offset based lookup. We now don't have
> to aggregate the full boot listing just so we can jump to a specific position,
> which can be a real pain on big journals just for a mere "-b -1" case.
> 
> As an additional benefit --list-boots should improve slightly too, because
> we now need to do less seeking.
> 
> Note that there can be a change in boot order with this lookup method
> because it will use the order of boots in the journal, not the realtime stamp
> stored in them. That's arguably better, though.
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=72601
> ---
> Hi,
> 
> today I realized that it would be nice if we could do without the cursor seeking.
> Turns out we can! I could swear that I tested sd_journal_flush_matches() would
> reset our position in the journal. But it seems that sd_journal_next/previous
> will advance just fine from the last position we were in, even after a flush.
> 
> Though, I would still like someone with better journal internals knowledge confirm
> that this is how it's supposed to work.
> 
> Some testing/timing from others than me would be nice too.

Hmm, the patch is hard to read, can you explain what precisely the new
algorithm is you propose?

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list