diff options
author | Jan Janssen <medhefgo@web.de> | 2013-06-28 17:26:30 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-07-16 17:38:12 +0200 |
commit | a331b5e6d4724365bad9edeb9420c7e26e7f50da (patch) | |
tree | d2bbe6684dbbf91e3ac89a552b0b4c211aa5bbe4 /man | |
parent | 18d4e7c26e7806ac363d19989df7144d5058ce41 (diff) |
journalctl: Add support for showing messages from a previous boot
Hi,
I redid the boot ID look up to use enumerate_unique.
This is quite fast if the cache is warm but painfully slow if
it isn't. It has a slight chance of returning the wrong order if
realtime clock jumps around.
This one has to do n searches for every boot ID there is plus
a sort, so it depends heavily on cache hotness. This is in contrast
to the other way of look-up through filtering by a MESSAGE_ID,
which only needs about 1 seek + whatever amount of relative IDs
you want to walk.
I also have a linked-list + (in-place) mergesort version of this
patch, which has pretty much the same runtime. But since this one
is using libc sorting and armortized allocation, I prefer this
one.
To summarize: The MESSAGE_ID way is a *lot* faster but can be
incomplete due to rotation, while the enumerate+sort will find
every boot ID out there but will be painfully slow for large
journals and cold caches.
You choose :P
Jan
Diffstat (limited to 'man')
-rw-r--r-- | man/journalctl.xml | 54 |
1 files changed, 43 insertions, 11 deletions
diff --git a/man/journalctl.xml b/man/journalctl.xml index b8b29b4cb5..0e779b952c 100644 --- a/man/journalctl.xml +++ b/man/journalctl.xml @@ -327,23 +327,51 @@ </varlistentry> <varlistentry> - <term><option>-b</option></term> - <term><option>--this-boot</option></term> - - <listitem><para>Show data only from - current boot. This will add a match - for <literal>_BOOT_ID=</literal> for - the current boot ID of the - kernel.</para></listitem> + <term><option>-b <optional><replaceable>ID</replaceable></optional></option></term> + <term><option>--boot=<optional><replaceable>ID</replaceable></optional></option></term> + + <listitem><para>Show messages from the specified + boot <replaceable>ID</replaceable> or from + current boot if no <replaceable>ID</replaceable> + is given. This will add a match for + <literal>_BOOT_ID=</literal>.</para> + + <para>The argument is a 128 bit ID given in + short or UUID form and optionally followed by + <literal>:n</literal> which identifies the nth + boot relative to the boot ID given to the left + of <literal>:</literal>. Supplying a negative + value for n will look for a past boot and a + positive value for a future boot. The boot IDs + are searched for in chronological order. If no + number is provided after <literal>:</literal>, + <literal>-1</literal> is assumed. A value of 0 + is valid and equivalent to omitting + <literal>:0</literal>.</para> + + <para>Alternatively, the argument may constist + only of <literal>:n</literal>. In this case, a + positive value will look up the nth boot + starting from the beginning of the jouranl, a + negative value will look up a previous boot + relative to the current boot. <literal>:0</literal> + will look for the current boot ID. Thus, + <literal>:1</literal> is the first boot found in + the journal, <literal>:2</literal> the second + and so on; while <literal>:-1</literal> is the + previous boot, <literal>:-2</literal> the boot + before that and so on. Omitting a value after + <literal>:</literal> will look for the previous + boot.</para></listitem> </varlistentry> <varlistentry> <term><option>-k</option></term> <term><option>--dmesg</option></term> - <listitem><para>Show kernel messages from - current boot. This implies <option>-b</option> - and adds the match <literal>_TRANSPORT=kernel</literal>. + <listitem><para>Show only kernel messages. This + implies <option>-b</option> and adds the match + <literal>_TRANSPORT=kernel</literal>. </para></listitem> </varlistentry> @@ -721,6 +749,10 @@ <programlisting>journalctl /dev/sda</programlisting> + <para>Show all kernel logs from last boot:</para> + + <programlisting>journalctl -k -b :</programlisting> + </refsect1> <refsect1> |