Commit Graph

37 Commits

Author SHA1 Message Date
Lennart Poettering a4bcff5ba3 journal: introduce entry array chain cache
When traversing entry array chains for a bisection or for retrieving an
item by index we previously always started at the beginning of the
chain. Since we tend to look at the same chains repeatedly, let's cache
where we have been the last time, and maybe we can skip ahead with this
the next time.

This turns most bisections and index lookups from O(log(n)*log(n)) into
O(log(n)). More importantly however, we seek around on disk much less,
which is good to reduce buffer cache and seek times on rotational disks.
2012-10-26 03:24:03 +02:00
Lennart Poettering 3c1668da62 journal: add ability to list values a specified field can take in all entries of the journal
The new 'unique' API allows listing all unique field values that a field
specified by a field name can take in all entries of the journal. This
allows answering queries such as "What units logged to the journal?",
"What hosts have logged into the journal?", "Which boot IDs have logged
into the journal?".

Ultimately this allows implementation of tools similar to lastlog based
on journal data.

Note that listing these field values will not work for journal files
created with older journald, as the field values are not indexed in
older files.
2012-10-18 03:35:18 +02:00
Lennart Poettering fb0951b02e journal: implement time-based rotation/vacuuming
This also enables time-based rotation (but not vacuuming) after 1month,
so that not more one month of journal is lost at a time per vacuuming.
2012-10-16 22:58:07 +02:00
Lennart Poettering 8088cbd3cf journal: use a macro to check for file header flags 2012-08-20 16:11:42 +02:00
Lennart Poettering fc89a13992 journal: validate timestamps as well 2012-08-19 15:16:11 +02:00
Lennart Poettering fb9a24b6b1 journal: even more simple static object tests 2012-08-18 01:45:39 +02:00
Lennart Poettering db11ac1ab5 journald: add additional simple static tests to verifier 2012-08-18 00:37:21 +02:00
Lennart Poettering baed47c3c2 journal: rework terminology
Let's clean up our terminology a bit. New terminology:

FSS = Forward Secure Sealing
FSPRG = Forward Secure Pseudo-Random Generator

FSS is the combination of FSPRG and a HMAC.

Sealing = process of adding authentication tags to the journal.
Verification = process of checking authentication tags to the journal.

Sealing Key = The key used for adding authentication tags to the journal.
Verification Key = The key used for checking authentication tags of the journal.
Key pair = The pair of Sealing Key and Verification Key

Internally, the Sealing Key is the combination of the FSPRG State plus
change interval/start time.

Internally, the Verification Key is the combination of the FSPRG Seed
plus change interval/start time.
2012-08-17 00:45:18 +02:00
Lennart Poettering b7c9ae91d1 journal: parse fsprg seed 2012-08-16 21:00:47 +02:00
Zbigniew Jędrzejewski-Szmek 2737027897 journal: rename 'mmap' to 'mmap_cache' to appease gcc
warning: declaration of 'mmap' shadows a global declaration [-Wshadow]
2012-08-16 19:44:51 +02:00
Lennart Poettering 0284adc6a6 journal: split up journal-file.c 2012-08-16 17:10:57 +02:00
Lennart Poettering beec008561 journal: implement basic journal file verification logic 2012-08-16 17:10:57 +02:00
Lennart Poettering 16e9f408fa journal: implement generic sharable mmap caching logic
instead of having one simple per-file cache implement an more
comprehensive one that works for multiple files and can actually
maintain multiple maps per file and per object type.
2012-08-16 17:10:56 +02:00
Lennart Poettering b0af6f41ea journal: add all objects we add to HMAC 2012-08-13 20:57:38 +02:00
Lennart Poettering 7560fffcd2 journald: initial version of FSPRG hookup
This adds forward-secure authentication of journal files. This patch
includes key generation as well as tagging of journal files,
Verification of journal files will be added in a later patch.
2012-08-13 20:31:10 +02:00
Shawn Landden c2f1db8f83 use #pragma once instead of foo*foo #define guards
#pragma once has been "un-deprecated" in gcc since 3.3, and is widely supported
in other compilers.

I've been using and maintaining (rebasing) this patch for a while now, as
it annoyed me to see #ifndef fooblahfoo, etc all over the place,
almost arrogant about the annoyance of having to define all these names to
perform a commen but neccicary functionality, when a completely superior
alternative exists.

I havn't sent it till now, cause its kindof a style change, and it is bad
voodoo to mess with style that has been established by more established
editors. So feel free to lambast me as a crazy bafoon.

v2 - preserve externally used headers
2012-07-19 12:30:59 +02:00
Lennart Poettering 4a92baf3fa journal: size journal data hash table based on maximum file size metrics
The default of 2047 hash table entries turned out to result in way too
many collisions for bigger files, hence scale the hash table size by the
estimated maximum file size.
2012-07-17 00:59:03 +02:00
Lennart Poettering dca6219e04 journal: automatically rotate journal files if the data hash table is full > 75%
Previously, when the main data hash table grows too full the performance
simply started to decrease drastically. Instead, now simply rotate to a
new journal file as the hash table gets to full, so that we can start
with a new fresh empty hash table.
2012-07-17 00:59:03 +02:00
Lennart Poettering cbdca8525b journal: beef up journal matches considerably
we now can take multiple matches, and they will apply as AND if they
apply to different fields and OR if they apply to the same fields. Also,
terms of this kind can be combined with an overreaching OR.
2012-07-13 00:32:32 +02:00
Lennart Poettering 089842938d journal: expose and make use of cutoff times of journal
This helps explaining when the log output of "systemctl status" is
incomplete because the logs got rotated since the service was started.
2012-06-17 00:03:12 +02:00
Lennart Poettering 5430f7f2bc relicense to LGPLv2.1 (with exceptions)
We finally got the OK from all contributors with non-trivial commits to
relicense systemd from GPL2+ to LGPL2.1+.

Some udev bits continue to be GPL2+ for now, but we are looking into
relicensing them too, to allow free copy/paste of all code within
systemd.

The bits that used to be MIT continue to be MIT.

The big benefit of the relicensing is that closed source code may now
link against libsystemd-login.so and friends.
2012-04-12 00:24:39 +02:00
Frederic Crozat 4fd052aede add sparse support to detect endianness bug
le16/32/64_t type should be used when storing little-endian value

header to integrate with sparse from Josh Triplett <josh@joshtriplett.org>
2012-03-22 01:09:37 +01:00
Lennart Poettering 9447a7f1de journal: if we encounter a corrupted file, rotate and go on 2012-03-15 01:13:01 +01:00
Lennart Poettering b785c858c3 journal: fix more 32/64 bit issues 2012-01-11 22:44:43 +01:00
Lennart Poettering 81527be142 build-sys: move public header files into a dir of their own 2012-01-05 16:01:58 +01:00
Lennart Poettering babfc09177 journal: automatically deduce journal metrics from file system sizes 2011-12-31 02:31:54 +01:00
Lennart Poettering 74ef2d16ad journal: move max_use into metrics structure 2011-12-31 00:57:14 +01:00
Lennart Poettering cf244689e9 journald: flush /run to /var as soon as it becomes available 2011-12-29 15:00:57 +01:00
Lennart Poettering 807e17f05e journal: add inline compression support with XZ 2011-12-21 02:40:59 +01:00
Lennart Poettering bc85bfee87 journal: fix space reservation limit enforcement 2011-12-20 02:38:36 +01:00
Lennart Poettering de190aef08 journal: implement multiple field matches 2011-11-08 18:20:03 +01:00
Lennart Poettering e892bd1797 journal: unify code for up and for down traversal 2011-10-15 01:38:44 +02:00
Lennart Poettering 7210bfb370 journal: move field index from file into journal object 2011-10-14 05:38:40 +02:00
Lennart Poettering c2373f848d journal: synchronize seqnum across files 2011-10-14 05:12:58 +02:00
Lennart Poettering 3fbf9cbb02 journal: implement parallel file traversal 2011-10-14 04:44:50 +02:00
Lennart Poettering 0ac38b7072 journal: implementation rotation 2011-10-13 05:19:35 +02:00
Lennart Poettering cec736d21f journal: implement parallel traversal in client 2011-10-08 02:21:05 +02:00
Renamed from src/journal/journal-private.h (Browse further)