/src/systemd/src/libsystemd/sd-journal/journal-file.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | | #pragma once |
3 | | |
4 | | #include "compress.h" |
5 | | #include "forward.h" |
6 | | #include "gcrypt-util.h" |
7 | | #include "journal-def.h" |
8 | | #include "missing_fcntl.h" |
9 | | #include "mmap-cache.h" |
10 | | #include "sparse-endian.h" |
11 | | |
12 | | typedef struct JournalMetrics { |
13 | | /* For all these: UINT64_MAX means "pick automatically", and 0 means "no limit enforced" */ |
14 | | uint64_t max_size; /* how large journal files grow at max */ |
15 | | uint64_t min_size; /* how large journal files grow at least */ |
16 | | uint64_t max_use; /* how much disk space to use in total at max, keep_free permitting */ |
17 | | uint64_t min_use; /* how much disk space to use in total at least, even if keep_free says not to */ |
18 | | uint64_t keep_free; /* how much to keep free on disk */ |
19 | | uint64_t n_max_files; /* how many files to keep around at max */ |
20 | | } JournalMetrics; |
21 | | |
22 | | typedef enum direction { |
23 | | DIRECTION_UP, |
24 | | DIRECTION_DOWN, |
25 | | _DIRECTION_INVALID = -EINVAL, |
26 | | } direction_t; |
27 | | |
28 | | typedef enum LocationType { |
29 | | /* The first and last entries, resp. */ |
30 | | LOCATION_HEAD, |
31 | | LOCATION_TAIL, |
32 | | |
33 | | /* We already read the entry we currently point to, and the |
34 | | * next one to read should probably not be this one again. */ |
35 | | LOCATION_DISCRETE, |
36 | | |
37 | | /* We should seek to the precise location specified, and |
38 | | * return it, as we haven't read it yet. */ |
39 | | LOCATION_SEEK, |
40 | | } LocationType; |
41 | | |
42 | | typedef enum OfflineState { |
43 | | OFFLINE_JOINED, |
44 | | OFFLINE_SYNCING, |
45 | | OFFLINE_OFFLINING, |
46 | | OFFLINE_CANCEL, |
47 | | OFFLINE_AGAIN_FROM_SYNCING, |
48 | | OFFLINE_AGAIN_FROM_OFFLINING, |
49 | | OFFLINE_DONE, |
50 | | } OfflineState; |
51 | | |
52 | | typedef struct JournalFile { |
53 | | int fd; |
54 | | MMapFileDescriptor *cache_fd; |
55 | | |
56 | | mode_t mode; |
57 | | |
58 | | int open_flags; |
59 | | bool close_fd:1; |
60 | | bool archive:1; |
61 | | bool strict_order:1; |
62 | | |
63 | | direction_t last_direction; |
64 | | LocationType location_type; |
65 | | uint64_t last_n_entries; |
66 | | |
67 | | char *path; |
68 | | struct stat last_stat; |
69 | | usec_t last_stat_usec; |
70 | | |
71 | | Header *header; |
72 | | HashItem *data_hash_table; |
73 | | HashItem *field_hash_table; |
74 | | |
75 | | uint64_t current_offset; |
76 | | uint64_t current_seqnum; |
77 | | uint64_t current_realtime; |
78 | | uint64_t current_monotonic; |
79 | | sd_id128_t current_boot_id; |
80 | | uint64_t current_xor_hash; |
81 | | |
82 | | JournalMetrics metrics; |
83 | | |
84 | | sd_event_source *post_change_timer; |
85 | | usec_t post_change_timer_period; |
86 | | |
87 | | OrderedHashmap *chain_cache; |
88 | | |
89 | | pthread_t offline_thread; |
90 | | volatile OfflineState offline_state; |
91 | | |
92 | | unsigned last_seen_generation; |
93 | | |
94 | | uint64_t compress_threshold_bytes; |
95 | | #if HAVE_COMPRESSION |
96 | | void *compress_buffer; |
97 | | #endif |
98 | | |
99 | | gcry_md_hd_t hmac; |
100 | | bool hmac_running; |
101 | | |
102 | | FSSHeader *fss_file; |
103 | | size_t fss_file_size; |
104 | | |
105 | | uint64_t fss_start_usec; |
106 | | uint64_t fss_interval_usec; |
107 | | |
108 | | void *fsprg_state; |
109 | | size_t fsprg_state_size; |
110 | | |
111 | | void *fsprg_seed; |
112 | | size_t fsprg_seed_size; |
113 | | |
114 | | /* When we insert this file into the per-boot priority queue 'newest_by_boot_id' in sd_journal, then by these keys */ |
115 | | sd_id128_t newest_boot_id; |
116 | | sd_id128_t newest_machine_id; |
117 | | uint64_t newest_monotonic_usec; |
118 | | uint64_t newest_realtime_usec; |
119 | | unsigned newest_boot_id_prioq_idx; |
120 | | uint64_t newest_entry_offset; |
121 | | uint8_t newest_state; |
122 | | } JournalFile; |
123 | | |
124 | | typedef enum JournalFileFlags { |
125 | | JOURNAL_COMPRESS = 1 << 0, |
126 | | JOURNAL_SEAL = 1 << 1, |
127 | | JOURNAL_STRICT_ORDER = 1 << 2, |
128 | | _JOURNAL_FILE_FLAGS_ALL = JOURNAL_COMPRESS|JOURNAL_SEAL|JOURNAL_STRICT_ORDER, |
129 | | } JournalFileFlags; |
130 | | |
131 | | typedef struct { |
132 | | uint64_t object_offset; |
133 | | uint64_t hash; |
134 | | } EntryItem; |
135 | | |
136 | | extern const struct hash_ops journal_file_hash_ops_by_path; |
137 | | |
138 | | int journal_file_open( |
139 | | int fd, |
140 | | const char *fname, |
141 | | int open_flags, |
142 | | JournalFileFlags file_flags, |
143 | | mode_t mode, |
144 | | uint64_t compress_threshold_bytes, |
145 | | JournalMetrics *metrics, |
146 | | MMapCache *mmap_cache, |
147 | | JournalFile *template, |
148 | | JournalFile **ret); |
149 | | |
150 | | int journal_file_set_offline_thread_join(JournalFile *f); |
151 | | JournalFile* journal_file_close(JournalFile *j); |
152 | | int journal_file_fstat(JournalFile *f); |
153 | | DEFINE_TRIVIAL_CLEANUP_FUNC(JournalFile*, journal_file_close); |
154 | | |
155 | 1.47M | #define ALIGN64(x) (((x) + 7ULL) & ~7ULL) |
156 | 211M | #define VALID64(x) (((x) & 7ULL) == 0ULL) |
157 | | |
158 | | /* Use six characters to cover the offsets common in smallish journal |
159 | | * files without adding too many zeros. */ |
160 | | #define OFSfmt "%06"PRIx64 |
161 | | |
162 | 52.9M | static inline bool VALID_REALTIME(uint64_t u) { |
163 | | /* This considers timestamps until the year 3112 valid. That should be plenty room... */ |
164 | 52.9M | return u > 0 && u < (1ULL << 55); |
165 | 52.9M | } Unexecuted instantiation: journald-audit.c:VALID_REALTIME Unexecuted instantiation: journald-console.c:VALID_REALTIME Unexecuted instantiation: journald-context.c:VALID_REALTIME Unexecuted instantiation: journald-kmsg.c:VALID_REALTIME Unexecuted instantiation: journald-manager.c:VALID_REALTIME Unexecuted instantiation: journald-native.c:VALID_REALTIME Unexecuted instantiation: journald-socket.c:VALID_REALTIME Unexecuted instantiation: journald-stream.c:VALID_REALTIME Unexecuted instantiation: journald-sync.c:VALID_REALTIME Unexecuted instantiation: journald-syslog.c:VALID_REALTIME Unexecuted instantiation: journald-varlink.c:VALID_REALTIME Unexecuted instantiation: journald-wall.c:VALID_REALTIME Unexecuted instantiation: fuzz-journald.c:VALID_REALTIME Unexecuted instantiation: journald-gperf.c:VALID_REALTIME Unexecuted instantiation: fuzz-journald-native-fd.c:VALID_REALTIME Unexecuted instantiation: fuzz-journald-syslog.c:VALID_REALTIME Unexecuted instantiation: fuzz-journald-kmsg.c:VALID_REALTIME Unexecuted instantiation: fuzz-journald-stream.c:VALID_REALTIME Unexecuted instantiation: fuzz-journald-native.c:VALID_REALTIME Unexecuted instantiation: fuzz-journald-audit.c:VALID_REALTIME Unexecuted instantiation: journal-remote-parse.c:VALID_REALTIME Unexecuted instantiation: journal-remote-write.c:VALID_REALTIME Unexecuted instantiation: journal-remote.c:VALID_REALTIME Unexecuted instantiation: fuzz-journal-remote.c:VALID_REALTIME Unexecuted instantiation: journal-file-util.c:VALID_REALTIME journal-importer.c:VALID_REALTIME Line | Count | Source | 162 | 6.77k | static inline bool VALID_REALTIME(uint64_t u) { | 163 | | /* This considers timestamps until the year 3112 valid. That should be plenty room... */ | 164 | 6.77k | return u > 0 && u < (1ULL << 55); | 165 | 6.77k | } |
Unexecuted instantiation: journal-util.c:VALID_REALTIME logs-show.c:VALID_REALTIME Line | Count | Source | 162 | 727k | static inline bool VALID_REALTIME(uint64_t u) { | 163 | | /* This considers timestamps until the year 3112 valid. That should be plenty room... */ | 164 | 727k | return u > 0 && u < (1ULL << 55); | 165 | 727k | } |
Unexecuted instantiation: journal-authenticate.c:VALID_REALTIME journal-file.c:VALID_REALTIME Line | Count | Source | 162 | 48.8M | static inline bool VALID_REALTIME(uint64_t u) { | 163 | | /* This considers timestamps until the year 3112 valid. That should be plenty room... */ | 164 | 48.8M | return u > 0 && u < (1ULL << 55); | 165 | 48.8M | } |
Unexecuted instantiation: journal-vacuum.c:VALID_REALTIME Unexecuted instantiation: journal-verify.c:VALID_REALTIME sd-journal.c:VALID_REALTIME Line | Count | Source | 162 | 3.32M | static inline bool VALID_REALTIME(uint64_t u) { | 163 | | /* This considers timestamps until the year 3112 valid. That should be plenty room... */ | 164 | 3.32M | return u > 0 && u < (1ULL << 55); | 165 | 3.32M | } |
Unexecuted instantiation: dbus-execute.c:VALID_REALTIME Unexecuted instantiation: load-fragment.c:VALID_REALTIME |
166 | | |
167 | 51.5M | static inline bool VALID_MONOTONIC(uint64_t u) { |
168 | | /* This considers timestamps until 1142 years of runtime valid. */ |
169 | 51.5M | return u < (1ULL << 55); |
170 | 51.5M | } Unexecuted instantiation: journald-audit.c:VALID_MONOTONIC Unexecuted instantiation: journald-console.c:VALID_MONOTONIC Unexecuted instantiation: journald-context.c:VALID_MONOTONIC Unexecuted instantiation: journald-kmsg.c:VALID_MONOTONIC Unexecuted instantiation: journald-manager.c:VALID_MONOTONIC Unexecuted instantiation: journald-native.c:VALID_MONOTONIC Unexecuted instantiation: journald-socket.c:VALID_MONOTONIC Unexecuted instantiation: journald-stream.c:VALID_MONOTONIC Unexecuted instantiation: journald-sync.c:VALID_MONOTONIC Unexecuted instantiation: journald-syslog.c:VALID_MONOTONIC Unexecuted instantiation: journald-varlink.c:VALID_MONOTONIC Unexecuted instantiation: journald-wall.c:VALID_MONOTONIC Unexecuted instantiation: fuzz-journald.c:VALID_MONOTONIC Unexecuted instantiation: journald-gperf.c:VALID_MONOTONIC Unexecuted instantiation: fuzz-journald-native-fd.c:VALID_MONOTONIC Unexecuted instantiation: fuzz-journald-syslog.c:VALID_MONOTONIC Unexecuted instantiation: fuzz-journald-kmsg.c:VALID_MONOTONIC Unexecuted instantiation: fuzz-journald-stream.c:VALID_MONOTONIC Unexecuted instantiation: fuzz-journald-native.c:VALID_MONOTONIC Unexecuted instantiation: fuzz-journald-audit.c:VALID_MONOTONIC Unexecuted instantiation: journal-remote-parse.c:VALID_MONOTONIC Unexecuted instantiation: journal-remote-write.c:VALID_MONOTONIC Unexecuted instantiation: journal-remote.c:VALID_MONOTONIC Unexecuted instantiation: fuzz-journal-remote.c:VALID_MONOTONIC Unexecuted instantiation: journal-file-util.c:VALID_MONOTONIC journal-importer.c:VALID_MONOTONIC Line | Count | Source | 167 | 730 | static inline bool VALID_MONOTONIC(uint64_t u) { | 168 | | /* This considers timestamps until 1142 years of runtime valid. */ | 169 | 730 | return u < (1ULL << 55); | 170 | 730 | } |
Unexecuted instantiation: journal-util.c:VALID_MONOTONIC logs-show.c:VALID_MONOTONIC Line | Count | Source | 167 | 73.1k | static inline bool VALID_MONOTONIC(uint64_t u) { | 168 | | /* This considers timestamps until 1142 years of runtime valid. */ | 169 | 73.1k | return u < (1ULL << 55); | 170 | 73.1k | } |
Unexecuted instantiation: journal-authenticate.c:VALID_MONOTONIC journal-file.c:VALID_MONOTONIC Line | Count | Source | 167 | 48.8M | static inline bool VALID_MONOTONIC(uint64_t u) { | 168 | | /* This considers timestamps until 1142 years of runtime valid. */ | 169 | 48.8M | return u < (1ULL << 55); | 170 | 48.8M | } |
Unexecuted instantiation: journal-vacuum.c:VALID_MONOTONIC Unexecuted instantiation: journal-verify.c:VALID_MONOTONIC sd-journal.c:VALID_MONOTONIC Line | Count | Source | 167 | 2.65M | static inline bool VALID_MONOTONIC(uint64_t u) { | 168 | | /* This considers timestamps until 1142 years of runtime valid. */ | 169 | 2.65M | return u < (1ULL << 55); | 170 | 2.65M | } |
Unexecuted instantiation: dbus-execute.c:VALID_MONOTONIC Unexecuted instantiation: load-fragment.c:VALID_MONOTONIC |
171 | | |
172 | 0 | static inline bool VALID_EPOCH(uint64_t u) { |
173 | | /* This allows changing the key for 1142 years, every usec. */ |
174 | 0 | return u < (1ULL << 55); |
175 | 0 | } Unexecuted instantiation: journald-audit.c:VALID_EPOCH Unexecuted instantiation: journald-console.c:VALID_EPOCH Unexecuted instantiation: journald-context.c:VALID_EPOCH Unexecuted instantiation: journald-kmsg.c:VALID_EPOCH Unexecuted instantiation: journald-manager.c:VALID_EPOCH Unexecuted instantiation: journald-native.c:VALID_EPOCH Unexecuted instantiation: journald-socket.c:VALID_EPOCH Unexecuted instantiation: journald-stream.c:VALID_EPOCH Unexecuted instantiation: journald-sync.c:VALID_EPOCH Unexecuted instantiation: journald-syslog.c:VALID_EPOCH Unexecuted instantiation: journald-varlink.c:VALID_EPOCH Unexecuted instantiation: journald-wall.c:VALID_EPOCH Unexecuted instantiation: fuzz-journald.c:VALID_EPOCH Unexecuted instantiation: journald-gperf.c:VALID_EPOCH Unexecuted instantiation: fuzz-journald-native-fd.c:VALID_EPOCH Unexecuted instantiation: fuzz-journald-syslog.c:VALID_EPOCH Unexecuted instantiation: fuzz-journald-kmsg.c:VALID_EPOCH Unexecuted instantiation: fuzz-journald-stream.c:VALID_EPOCH Unexecuted instantiation: fuzz-journald-native.c:VALID_EPOCH Unexecuted instantiation: fuzz-journald-audit.c:VALID_EPOCH Unexecuted instantiation: journal-remote-parse.c:VALID_EPOCH Unexecuted instantiation: journal-remote-write.c:VALID_EPOCH Unexecuted instantiation: journal-remote.c:VALID_EPOCH Unexecuted instantiation: fuzz-journal-remote.c:VALID_EPOCH Unexecuted instantiation: journal-file-util.c:VALID_EPOCH Unexecuted instantiation: journal-importer.c:VALID_EPOCH Unexecuted instantiation: journal-util.c:VALID_EPOCH Unexecuted instantiation: logs-show.c:VALID_EPOCH Unexecuted instantiation: journal-authenticate.c:VALID_EPOCH Unexecuted instantiation: journal-file.c:VALID_EPOCH Unexecuted instantiation: journal-vacuum.c:VALID_EPOCH Unexecuted instantiation: journal-verify.c:VALID_EPOCH Unexecuted instantiation: sd-journal.c:VALID_EPOCH Unexecuted instantiation: dbus-execute.c:VALID_EPOCH Unexecuted instantiation: load-fragment.c:VALID_EPOCH |
176 | | |
177 | | #define JOURNAL_HEADER_CONTAINS(h, field) \ |
178 | 12.6M | (le64toh((h)->header_size) >= offsetof(Header, field) + sizeof((h)->field)) |
179 | | |
180 | | #define JOURNAL_HEADER_SEALED(h) \ |
181 | 6.11k | FLAGS_SET(le32toh((h)->compatible_flags), HEADER_COMPATIBLE_SEALED) |
182 | | |
183 | | #define JOURNAL_HEADER_SEALED_CONTINUOUS(h) \ |
184 | 0 | FLAGS_SET(le32toh((h)->compatible_flags), HEADER_COMPATIBLE_SEALED_CONTINUOUS) |
185 | | |
186 | | #define JOURNAL_HEADER_TAIL_ENTRY_BOOT_ID(h) \ |
187 | 1.16k | FLAGS_SET(le32toh((h)->compatible_flags), HEADER_COMPATIBLE_TAIL_ENTRY_BOOT_ID) |
188 | | |
189 | | #define JOURNAL_HEADER_COMPRESSED_XZ(h) \ |
190 | 0 | FLAGS_SET(le32toh((h)->incompatible_flags), HEADER_INCOMPATIBLE_COMPRESSED_XZ) |
191 | | |
192 | | #define JOURNAL_HEADER_COMPRESSED_LZ4(h) \ |
193 | 0 | FLAGS_SET(le32toh((h)->incompatible_flags), HEADER_INCOMPATIBLE_COMPRESSED_LZ4) |
194 | | |
195 | | #define JOURNAL_HEADER_COMPRESSED_ZSTD(h) \ |
196 | 0 | FLAGS_SET(le32toh((h)->incompatible_flags), HEADER_INCOMPATIBLE_COMPRESSED_ZSTD) |
197 | | |
198 | | #define JOURNAL_HEADER_KEYED_HASH(h) \ |
199 | 2.65M | FLAGS_SET(le32toh((h)->incompatible_flags), HEADER_INCOMPATIBLE_KEYED_HASH) |
200 | | |
201 | | #define JOURNAL_HEADER_COMPACT(h) \ |
202 | 327M | FLAGS_SET(le32toh((h)->incompatible_flags), HEADER_INCOMPATIBLE_COMPACT) |
203 | | |
204 | | int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset, Object **ret); |
205 | | int journal_file_pin_object(JournalFile *f, Object *o); |
206 | | int journal_file_read_object_header(JournalFile *f, ObjectType type, uint64_t offset, Object *ret); |
207 | | |
208 | | int journal_file_tail_end_by_pread(JournalFile *f, uint64_t *ret_offset); |
209 | | int journal_file_tail_end_by_mmap(JournalFile *f, uint64_t *ret_offset); |
210 | | |
211 | 10.3M | static inline uint64_t journal_file_entry_item_object_offset(JournalFile *f, Object *o, size_t i) { |
212 | 10.3M | assert(f); |
213 | 10.3M | assert(o); |
214 | 10.3M | return JOURNAL_HEADER_COMPACT(f->header) ? le32toh(o->entry.items.compact[i].object_offset) : |
215 | 10.3M | le64toh(o->entry.items.regular[i].object_offset); |
216 | 10.3M | } Unexecuted instantiation: journald-audit.c:journal_file_entry_item_object_offset Unexecuted instantiation: journald-console.c:journal_file_entry_item_object_offset Unexecuted instantiation: journald-context.c:journal_file_entry_item_object_offset Unexecuted instantiation: journald-kmsg.c:journal_file_entry_item_object_offset Unexecuted instantiation: journald-manager.c:journal_file_entry_item_object_offset Unexecuted instantiation: journald-native.c:journal_file_entry_item_object_offset Unexecuted instantiation: journald-socket.c:journal_file_entry_item_object_offset Unexecuted instantiation: journald-stream.c:journal_file_entry_item_object_offset Unexecuted instantiation: journald-sync.c:journal_file_entry_item_object_offset Unexecuted instantiation: journald-syslog.c:journal_file_entry_item_object_offset Unexecuted instantiation: journald-varlink.c:journal_file_entry_item_object_offset Unexecuted instantiation: journald-wall.c:journal_file_entry_item_object_offset Unexecuted instantiation: fuzz-journald.c:journal_file_entry_item_object_offset Unexecuted instantiation: journald-gperf.c:journal_file_entry_item_object_offset Unexecuted instantiation: fuzz-journald-native-fd.c:journal_file_entry_item_object_offset Unexecuted instantiation: fuzz-journald-syslog.c:journal_file_entry_item_object_offset Unexecuted instantiation: fuzz-journald-kmsg.c:journal_file_entry_item_object_offset Unexecuted instantiation: fuzz-journald-stream.c:journal_file_entry_item_object_offset Unexecuted instantiation: fuzz-journald-native.c:journal_file_entry_item_object_offset Unexecuted instantiation: fuzz-journald-audit.c:journal_file_entry_item_object_offset Unexecuted instantiation: journal-remote-parse.c:journal_file_entry_item_object_offset Unexecuted instantiation: journal-remote-write.c:journal_file_entry_item_object_offset Unexecuted instantiation: journal-remote.c:journal_file_entry_item_object_offset Unexecuted instantiation: fuzz-journal-remote.c:journal_file_entry_item_object_offset Unexecuted instantiation: journal-file-util.c:journal_file_entry_item_object_offset Unexecuted instantiation: journal-importer.c:journal_file_entry_item_object_offset Unexecuted instantiation: journal-util.c:journal_file_entry_item_object_offset Unexecuted instantiation: logs-show.c:journal_file_entry_item_object_offset Unexecuted instantiation: journal-authenticate.c:journal_file_entry_item_object_offset Unexecuted instantiation: journal-file.c:journal_file_entry_item_object_offset Unexecuted instantiation: journal-vacuum.c:journal_file_entry_item_object_offset Unexecuted instantiation: journal-verify.c:journal_file_entry_item_object_offset sd-journal.c:journal_file_entry_item_object_offset Line | Count | Source | 211 | 10.3M | static inline uint64_t journal_file_entry_item_object_offset(JournalFile *f, Object *o, size_t i) { | 212 | 10.3M | assert(f); | 213 | 10.3M | assert(o); | 214 | 10.3M | return JOURNAL_HEADER_COMPACT(f->header) ? le32toh(o->entry.items.compact[i].object_offset) : | 215 | 10.3M | le64toh(o->entry.items.regular[i].object_offset); | 216 | 10.3M | } |
Unexecuted instantiation: dbus-execute.c:journal_file_entry_item_object_offset Unexecuted instantiation: load-fragment.c:journal_file_entry_item_object_offset |
217 | | |
218 | 115M | static inline size_t journal_file_entry_item_size(JournalFile *f) { |
219 | 115M | assert(f); |
220 | 115M | return JOURNAL_HEADER_COMPACT(f->header) ? sizeof_field(Object, entry.items.compact[0]) : |
221 | 115M | sizeof_field(Object, entry.items.regular[0]); |
222 | 115M | } Unexecuted instantiation: journald-audit.c:journal_file_entry_item_size Unexecuted instantiation: journald-console.c:journal_file_entry_item_size Unexecuted instantiation: journald-context.c:journal_file_entry_item_size Unexecuted instantiation: journald-kmsg.c:journal_file_entry_item_size Unexecuted instantiation: journald-manager.c:journal_file_entry_item_size Unexecuted instantiation: journald-native.c:journal_file_entry_item_size Unexecuted instantiation: journald-socket.c:journal_file_entry_item_size Unexecuted instantiation: journald-stream.c:journal_file_entry_item_size Unexecuted instantiation: journald-sync.c:journal_file_entry_item_size Unexecuted instantiation: journald-syslog.c:journal_file_entry_item_size Unexecuted instantiation: journald-varlink.c:journal_file_entry_item_size Unexecuted instantiation: journald-wall.c:journal_file_entry_item_size Unexecuted instantiation: fuzz-journald.c:journal_file_entry_item_size Unexecuted instantiation: journald-gperf.c:journal_file_entry_item_size Unexecuted instantiation: fuzz-journald-native-fd.c:journal_file_entry_item_size Unexecuted instantiation: fuzz-journald-syslog.c:journal_file_entry_item_size Unexecuted instantiation: fuzz-journald-kmsg.c:journal_file_entry_item_size Unexecuted instantiation: fuzz-journald-stream.c:journal_file_entry_item_size Unexecuted instantiation: fuzz-journald-native.c:journal_file_entry_item_size Unexecuted instantiation: fuzz-journald-audit.c:journal_file_entry_item_size Unexecuted instantiation: journal-remote-parse.c:journal_file_entry_item_size Unexecuted instantiation: journal-remote-write.c:journal_file_entry_item_size Unexecuted instantiation: journal-remote.c:journal_file_entry_item_size Unexecuted instantiation: fuzz-journal-remote.c:journal_file_entry_item_size Unexecuted instantiation: journal-file-util.c:journal_file_entry_item_size Unexecuted instantiation: journal-importer.c:journal_file_entry_item_size Unexecuted instantiation: journal-util.c:journal_file_entry_item_size Unexecuted instantiation: logs-show.c:journal_file_entry_item_size Unexecuted instantiation: journal-authenticate.c:journal_file_entry_item_size journal-file.c:journal_file_entry_item_size Line | Count | Source | 218 | 115M | static inline size_t journal_file_entry_item_size(JournalFile *f) { | 219 | 115M | assert(f); | 220 | 115M | return JOURNAL_HEADER_COMPACT(f->header) ? sizeof_field(Object, entry.items.compact[0]) : | 221 | 115M | sizeof_field(Object, entry.items.regular[0]); | 222 | 115M | } |
Unexecuted instantiation: journal-vacuum.c:journal_file_entry_item_size Unexecuted instantiation: journal-verify.c:journal_file_entry_item_size Unexecuted instantiation: sd-journal.c:journal_file_entry_item_size Unexecuted instantiation: dbus-execute.c:journal_file_entry_item_size Unexecuted instantiation: load-fragment.c:journal_file_entry_item_size |
223 | | |
224 | | uint64_t journal_file_entry_n_items(JournalFile *f, Object *o) _pure_; |
225 | | |
226 | | int journal_file_data_payload( |
227 | | JournalFile *f, |
228 | | Object *o, |
229 | | uint64_t offset, |
230 | | const char *field, |
231 | | size_t field_length, |
232 | | size_t data_threshold, |
233 | | void **ret_data, |
234 | | size_t *ret_size); |
235 | | |
236 | 62.3M | static inline size_t journal_file_data_payload_offset(JournalFile *f) { |
237 | 62.3M | return JOURNAL_HEADER_COMPACT(f->header) |
238 | 62.3M | ? offsetof(Object, data.compact.payload) |
239 | 62.3M | : offsetof(Object, data.regular.payload); |
240 | 62.3M | } Unexecuted instantiation: journald-audit.c:journal_file_data_payload_offset Unexecuted instantiation: journald-console.c:journal_file_data_payload_offset Unexecuted instantiation: journald-context.c:journal_file_data_payload_offset Unexecuted instantiation: journald-kmsg.c:journal_file_data_payload_offset Unexecuted instantiation: journald-manager.c:journal_file_data_payload_offset Unexecuted instantiation: journald-native.c:journal_file_data_payload_offset Unexecuted instantiation: journald-socket.c:journal_file_data_payload_offset Unexecuted instantiation: journald-stream.c:journal_file_data_payload_offset Unexecuted instantiation: journald-sync.c:journal_file_data_payload_offset Unexecuted instantiation: journald-syslog.c:journal_file_data_payload_offset Unexecuted instantiation: journald-varlink.c:journal_file_data_payload_offset Unexecuted instantiation: journald-wall.c:journal_file_data_payload_offset Unexecuted instantiation: fuzz-journald.c:journal_file_data_payload_offset Unexecuted instantiation: journald-gperf.c:journal_file_data_payload_offset Unexecuted instantiation: fuzz-journald-native-fd.c:journal_file_data_payload_offset Unexecuted instantiation: fuzz-journald-syslog.c:journal_file_data_payload_offset Unexecuted instantiation: fuzz-journald-kmsg.c:journal_file_data_payload_offset Unexecuted instantiation: fuzz-journald-stream.c:journal_file_data_payload_offset Unexecuted instantiation: fuzz-journald-native.c:journal_file_data_payload_offset Unexecuted instantiation: fuzz-journald-audit.c:journal_file_data_payload_offset Unexecuted instantiation: journal-remote-parse.c:journal_file_data_payload_offset Unexecuted instantiation: journal-remote-write.c:journal_file_data_payload_offset Unexecuted instantiation: journal-remote.c:journal_file_data_payload_offset Unexecuted instantiation: fuzz-journal-remote.c:journal_file_data_payload_offset Unexecuted instantiation: journal-file-util.c:journal_file_data_payload_offset Unexecuted instantiation: journal-importer.c:journal_file_data_payload_offset Unexecuted instantiation: journal-util.c:journal_file_data_payload_offset Unexecuted instantiation: logs-show.c:journal_file_data_payload_offset Unexecuted instantiation: journal-authenticate.c:journal_file_data_payload_offset journal-file.c:journal_file_data_payload_offset Line | Count | Source | 236 | 62.3M | static inline size_t journal_file_data_payload_offset(JournalFile *f) { | 237 | 62.3M | return JOURNAL_HEADER_COMPACT(f->header) | 238 | 62.3M | ? offsetof(Object, data.compact.payload) | 239 | 62.3M | : offsetof(Object, data.regular.payload); | 240 | 62.3M | } |
Unexecuted instantiation: journal-vacuum.c:journal_file_data_payload_offset Unexecuted instantiation: journal-verify.c:journal_file_data_payload_offset Unexecuted instantiation: sd-journal.c:journal_file_data_payload_offset Unexecuted instantiation: dbus-execute.c:journal_file_data_payload_offset Unexecuted instantiation: load-fragment.c:journal_file_data_payload_offset |
241 | | |
242 | 11.7M | static inline uint8_t* journal_file_data_payload_field(JournalFile *f, Object *o) { |
243 | 11.7M | return JOURNAL_HEADER_COMPACT(f->header) ? o->data.compact.payload : o->data.regular.payload; |
244 | 11.7M | } Unexecuted instantiation: journald-audit.c:journal_file_data_payload_field Unexecuted instantiation: journald-console.c:journal_file_data_payload_field Unexecuted instantiation: journald-context.c:journal_file_data_payload_field Unexecuted instantiation: journald-kmsg.c:journal_file_data_payload_field Unexecuted instantiation: journald-manager.c:journal_file_data_payload_field Unexecuted instantiation: journald-native.c:journal_file_data_payload_field Unexecuted instantiation: journald-socket.c:journal_file_data_payload_field Unexecuted instantiation: journald-stream.c:journal_file_data_payload_field Unexecuted instantiation: journald-sync.c:journal_file_data_payload_field Unexecuted instantiation: journald-syslog.c:journal_file_data_payload_field Unexecuted instantiation: journald-varlink.c:journal_file_data_payload_field Unexecuted instantiation: journald-wall.c:journal_file_data_payload_field Unexecuted instantiation: fuzz-journald.c:journal_file_data_payload_field Unexecuted instantiation: journald-gperf.c:journal_file_data_payload_field Unexecuted instantiation: fuzz-journald-native-fd.c:journal_file_data_payload_field Unexecuted instantiation: fuzz-journald-syslog.c:journal_file_data_payload_field Unexecuted instantiation: fuzz-journald-kmsg.c:journal_file_data_payload_field Unexecuted instantiation: fuzz-journald-stream.c:journal_file_data_payload_field Unexecuted instantiation: fuzz-journald-native.c:journal_file_data_payload_field Unexecuted instantiation: fuzz-journald-audit.c:journal_file_data_payload_field Unexecuted instantiation: journal-remote-parse.c:journal_file_data_payload_field Unexecuted instantiation: journal-remote-write.c:journal_file_data_payload_field Unexecuted instantiation: journal-remote.c:journal_file_data_payload_field Unexecuted instantiation: fuzz-journal-remote.c:journal_file_data_payload_field Unexecuted instantiation: journal-file-util.c:journal_file_data_payload_field Unexecuted instantiation: journal-importer.c:journal_file_data_payload_field Unexecuted instantiation: journal-util.c:journal_file_data_payload_field Unexecuted instantiation: logs-show.c:journal_file_data_payload_field Unexecuted instantiation: journal-authenticate.c:journal_file_data_payload_field journal-file.c:journal_file_data_payload_field Line | Count | Source | 242 | 11.7M | static inline uint8_t* journal_file_data_payload_field(JournalFile *f, Object *o) { | 243 | 11.7M | return JOURNAL_HEADER_COMPACT(f->header) ? o->data.compact.payload : o->data.regular.payload; | 244 | 11.7M | } |
Unexecuted instantiation: journal-vacuum.c:journal_file_data_payload_field Unexecuted instantiation: journal-verify.c:journal_file_data_payload_field Unexecuted instantiation: sd-journal.c:journal_file_data_payload_field Unexecuted instantiation: dbus-execute.c:journal_file_data_payload_field Unexecuted instantiation: load-fragment.c:journal_file_data_payload_field |
245 | | |
246 | | uint64_t journal_file_entry_array_n_items(JournalFile *f, Object *o) _pure_; |
247 | | |
248 | 66.4M | static inline uint64_t journal_file_entry_array_item(JournalFile *f, Object *o, size_t i) { |
249 | 66.4M | assert(f); |
250 | 66.4M | assert(o); |
251 | 66.4M | return JOURNAL_HEADER_COMPACT(f->header) ? le32toh(o->entry_array.items.compact[i]) : |
252 | 66.4M | le64toh(o->entry_array.items.regular[i]); |
253 | 66.4M | } Unexecuted instantiation: journald-audit.c:journal_file_entry_array_item Unexecuted instantiation: journald-console.c:journal_file_entry_array_item Unexecuted instantiation: journald-context.c:journal_file_entry_array_item Unexecuted instantiation: journald-kmsg.c:journal_file_entry_array_item Unexecuted instantiation: journald-manager.c:journal_file_entry_array_item Unexecuted instantiation: journald-native.c:journal_file_entry_array_item Unexecuted instantiation: journald-socket.c:journal_file_entry_array_item Unexecuted instantiation: journald-stream.c:journal_file_entry_array_item Unexecuted instantiation: journald-sync.c:journal_file_entry_array_item Unexecuted instantiation: journald-syslog.c:journal_file_entry_array_item Unexecuted instantiation: journald-varlink.c:journal_file_entry_array_item Unexecuted instantiation: journald-wall.c:journal_file_entry_array_item Unexecuted instantiation: fuzz-journald.c:journal_file_entry_array_item Unexecuted instantiation: journald-gperf.c:journal_file_entry_array_item Unexecuted instantiation: fuzz-journald-native-fd.c:journal_file_entry_array_item Unexecuted instantiation: fuzz-journald-syslog.c:journal_file_entry_array_item Unexecuted instantiation: fuzz-journald-kmsg.c:journal_file_entry_array_item Unexecuted instantiation: fuzz-journald-stream.c:journal_file_entry_array_item Unexecuted instantiation: fuzz-journald-native.c:journal_file_entry_array_item Unexecuted instantiation: fuzz-journald-audit.c:journal_file_entry_array_item Unexecuted instantiation: journal-remote-parse.c:journal_file_entry_array_item Unexecuted instantiation: journal-remote-write.c:journal_file_entry_array_item Unexecuted instantiation: journal-remote.c:journal_file_entry_array_item Unexecuted instantiation: fuzz-journal-remote.c:journal_file_entry_array_item Unexecuted instantiation: journal-file-util.c:journal_file_entry_array_item Unexecuted instantiation: journal-importer.c:journal_file_entry_array_item Unexecuted instantiation: journal-util.c:journal_file_entry_array_item Unexecuted instantiation: logs-show.c:journal_file_entry_array_item Unexecuted instantiation: journal-authenticate.c:journal_file_entry_array_item journal-file.c:journal_file_entry_array_item Line | Count | Source | 248 | 66.4M | static inline uint64_t journal_file_entry_array_item(JournalFile *f, Object *o, size_t i) { | 249 | 66.4M | assert(f); | 250 | 66.4M | assert(o); | 251 | 66.4M | return JOURNAL_HEADER_COMPACT(f->header) ? le32toh(o->entry_array.items.compact[i]) : | 252 | 66.4M | le64toh(o->entry_array.items.regular[i]); | 253 | 66.4M | } |
Unexecuted instantiation: journal-vacuum.c:journal_file_entry_array_item Unexecuted instantiation: journal-verify.c:journal_file_entry_array_item Unexecuted instantiation: sd-journal.c:journal_file_entry_array_item Unexecuted instantiation: dbus-execute.c:journal_file_entry_array_item Unexecuted instantiation: load-fragment.c:journal_file_entry_array_item |
254 | | |
255 | 56.2M | static inline size_t journal_file_entry_array_item_size(JournalFile *f) { |
256 | 56.2M | assert(f); |
257 | 56.2M | return JOURNAL_HEADER_COMPACT(f->header) ? sizeof(le32_t) : sizeof(le64_t); |
258 | 56.2M | } Unexecuted instantiation: journald-audit.c:journal_file_entry_array_item_size Unexecuted instantiation: journald-console.c:journal_file_entry_array_item_size Unexecuted instantiation: journald-context.c:journal_file_entry_array_item_size Unexecuted instantiation: journald-kmsg.c:journal_file_entry_array_item_size Unexecuted instantiation: journald-manager.c:journal_file_entry_array_item_size Unexecuted instantiation: journald-native.c:journal_file_entry_array_item_size Unexecuted instantiation: journald-socket.c:journal_file_entry_array_item_size Unexecuted instantiation: journald-stream.c:journal_file_entry_array_item_size Unexecuted instantiation: journald-sync.c:journal_file_entry_array_item_size Unexecuted instantiation: journald-syslog.c:journal_file_entry_array_item_size Unexecuted instantiation: journald-varlink.c:journal_file_entry_array_item_size Unexecuted instantiation: journald-wall.c:journal_file_entry_array_item_size Unexecuted instantiation: fuzz-journald.c:journal_file_entry_array_item_size Unexecuted instantiation: journald-gperf.c:journal_file_entry_array_item_size Unexecuted instantiation: fuzz-journald-native-fd.c:journal_file_entry_array_item_size Unexecuted instantiation: fuzz-journald-syslog.c:journal_file_entry_array_item_size Unexecuted instantiation: fuzz-journald-kmsg.c:journal_file_entry_array_item_size Unexecuted instantiation: fuzz-journald-stream.c:journal_file_entry_array_item_size Unexecuted instantiation: fuzz-journald-native.c:journal_file_entry_array_item_size Unexecuted instantiation: fuzz-journald-audit.c:journal_file_entry_array_item_size Unexecuted instantiation: journal-remote-parse.c:journal_file_entry_array_item_size Unexecuted instantiation: journal-remote-write.c:journal_file_entry_array_item_size Unexecuted instantiation: journal-remote.c:journal_file_entry_array_item_size Unexecuted instantiation: fuzz-journal-remote.c:journal_file_entry_array_item_size journal-file-util.c:journal_file_entry_array_item_size Line | Count | Source | 255 | 28.5k | static inline size_t journal_file_entry_array_item_size(JournalFile *f) { | 256 | 28.5k | assert(f); | 257 | 28.5k | return JOURNAL_HEADER_COMPACT(f->header) ? sizeof(le32_t) : sizeof(le64_t); | 258 | 28.5k | } |
Unexecuted instantiation: journal-importer.c:journal_file_entry_array_item_size Unexecuted instantiation: journal-util.c:journal_file_entry_array_item_size Unexecuted instantiation: logs-show.c:journal_file_entry_array_item_size Unexecuted instantiation: journal-authenticate.c:journal_file_entry_array_item_size journal-file.c:journal_file_entry_array_item_size Line | Count | Source | 255 | 56.1M | static inline size_t journal_file_entry_array_item_size(JournalFile *f) { | 256 | 56.1M | assert(f); | 257 | 56.1M | return JOURNAL_HEADER_COMPACT(f->header) ? sizeof(le32_t) : sizeof(le64_t); | 258 | 56.1M | } |
Unexecuted instantiation: journal-vacuum.c:journal_file_entry_array_item_size Unexecuted instantiation: journal-verify.c:journal_file_entry_array_item_size Unexecuted instantiation: sd-journal.c:journal_file_entry_array_item_size Unexecuted instantiation: dbus-execute.c:journal_file_entry_array_item_size Unexecuted instantiation: load-fragment.c:journal_file_entry_array_item_size |
259 | | |
260 | | uint64_t journal_file_hash_table_n_items(Object *o) _pure_; |
261 | | |
262 | | int journal_file_append_object(JournalFile *f, ObjectType type, uint64_t size, Object **ret_object, uint64_t *ret_offset); |
263 | | int journal_file_append_entry( |
264 | | JournalFile *f, |
265 | | const dual_timestamp *ts, |
266 | | const sd_id128_t *boot_id, |
267 | | const struct iovec iovec[], |
268 | | size_t n_iovec, |
269 | | uint64_t *seqnum, |
270 | | sd_id128_t *seqnum_id, |
271 | | Object **ret_object, |
272 | | uint64_t *ret_offset); |
273 | | |
274 | | int journal_file_find_data_object(JournalFile *f, const void *data, uint64_t size, Object **ret_object, uint64_t *ret_offset); |
275 | | int journal_file_find_data_object_with_hash(JournalFile *f, const void *data, uint64_t size, uint64_t hash, Object **ret_object, uint64_t *ret_offset); |
276 | | |
277 | | int journal_file_find_field_object(JournalFile *f, const void *field, uint64_t size, Object **ret_object, uint64_t *ret_offset); |
278 | | int journal_file_find_field_object_with_hash(JournalFile *f, const void *field, uint64_t size, uint64_t hash, Object **ret_object, uint64_t *ret_offset); |
279 | | |
280 | | void journal_file_reset_location(JournalFile *f); |
281 | | void journal_file_save_location(JournalFile *f, Object *o, uint64_t offset); |
282 | | int journal_file_next_entry(JournalFile *f, uint64_t p, direction_t direction, Object **ret_object, uint64_t *ret_offset); |
283 | | |
284 | | int journal_file_move_to_entry_by_offset(JournalFile *f, uint64_t p, direction_t direction, Object **ret_object, uint64_t *ret_offset); |
285 | | int journal_file_move_to_entry_by_seqnum(JournalFile *f, uint64_t seqnum, direction_t direction, Object **ret_object, uint64_t *ret_offset); |
286 | | int journal_file_move_to_entry_by_realtime(JournalFile *f, uint64_t realtime, direction_t direction, Object **ret_object, uint64_t *ret_offset); |
287 | | int journal_file_move_to_entry_by_monotonic(JournalFile *f, sd_id128_t boot_id, uint64_t monotonic, direction_t direction, Object **ret_object, uint64_t *ret_offset); |
288 | | |
289 | | int journal_file_move_to_entry_for_data(JournalFile *f, Object *d, direction_t direction, Object **ret_object, uint64_t *ret_offset); |
290 | | |
291 | | int journal_file_move_to_entry_by_offset_for_data(JournalFile *f, Object *d, uint64_t p, direction_t direction, Object **ret_object, uint64_t *ret_offset); |
292 | | int journal_file_move_to_entry_by_seqnum_for_data(JournalFile *f, Object *d, uint64_t seqnum, direction_t direction, Object **ret_object, uint64_t *ret_offset); |
293 | | int journal_file_move_to_entry_by_realtime_for_data(JournalFile *f, Object *d, uint64_t realtime, direction_t direction, Object **ret_object, uint64_t *ret_offset); |
294 | | int journal_file_move_to_entry_by_monotonic_for_data(JournalFile *f, Object *d, sd_id128_t boot_id, uint64_t monotonic, direction_t direction, Object **ret_object, uint64_t *ret_offset); |
295 | | |
296 | | int journal_file_copy_entry(JournalFile *from, JournalFile *to, Object *o, uint64_t p, uint64_t *seqnum, sd_id128_t *seqnum_id); |
297 | | |
298 | | void journal_file_dump(JournalFile *f); |
299 | | void journal_file_print_header(JournalFile *f); |
300 | | |
301 | | int journal_file_archive(JournalFile *f, char **ret_previous_path); |
302 | | int journal_file_parse_uid_from_filename(const char *path, uid_t *uid); |
303 | | |
304 | | int journal_file_dispose(int dir_fd, const char *fname); |
305 | | |
306 | | void journal_file_post_change(JournalFile *f); |
307 | | int journal_file_enable_post_change_timer(JournalFile *f, sd_event *e, usec_t t); |
308 | | |
309 | | void journal_reset_metrics(JournalMetrics *m); |
310 | | |
311 | | int journal_file_get_cutoff_realtime_usec(JournalFile *f, usec_t *ret_from, usec_t *ret_to); |
312 | | int journal_file_get_cutoff_monotonic_usec(JournalFile *f, sd_id128_t boot, usec_t *ret_from, usec_t *ret_to); |
313 | | |
314 | | bool journal_file_rotate_suggested(JournalFile *f, usec_t max_file_usec, int log_level); |
315 | | |
316 | | int journal_file_map_data_hash_table(JournalFile *f); |
317 | | int journal_file_map_field_hash_table(JournalFile *f); |
318 | | |
319 | 0 | static inline Compression JOURNAL_FILE_COMPRESSION(JournalFile *f) { |
320 | 0 | assert(f); |
321 | |
|
322 | 0 | if (JOURNAL_HEADER_COMPRESSED_XZ(f->header)) |
323 | 0 | return COMPRESSION_XZ; |
324 | 0 | if (JOURNAL_HEADER_COMPRESSED_LZ4(f->header)) |
325 | 0 | return COMPRESSION_LZ4; |
326 | 0 | if (JOURNAL_HEADER_COMPRESSED_ZSTD(f->header)) |
327 | 0 | return COMPRESSION_ZSTD; |
328 | 0 | return COMPRESSION_NONE; |
329 | 0 | } Unexecuted instantiation: journald-audit.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journald-console.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journald-context.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journald-kmsg.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journald-manager.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journald-native.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journald-socket.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journald-stream.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journald-sync.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journald-syslog.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journald-varlink.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journald-wall.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: fuzz-journald.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journald-gperf.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: fuzz-journald-native-fd.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: fuzz-journald-syslog.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: fuzz-journald-kmsg.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: fuzz-journald-stream.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: fuzz-journald-native.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: fuzz-journald-audit.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journal-remote-parse.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journal-remote-write.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journal-remote.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: fuzz-journal-remote.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journal-file-util.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journal-importer.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journal-util.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: logs-show.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journal-authenticate.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journal-file.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journal-vacuum.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: journal-verify.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: sd-journal.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: dbus-execute.c:JOURNAL_FILE_COMPRESSION Unexecuted instantiation: load-fragment.c:JOURNAL_FILE_COMPRESSION |
330 | | |
331 | | uint64_t journal_file_hash_data(JournalFile *f, const void *data, size_t sz); |
332 | | |
333 | | bool journal_field_valid(const char *p, size_t l, bool allow_protected); |
334 | | |
335 | | const char* journal_object_type_to_string(ObjectType type) _const_; |
336 | | |
337 | 11.2M | static inline Compression COMPRESSION_FROM_OBJECT(const Object *o) { |
338 | 11.2M | assert(o); |
339 | | |
340 | 11.2M | switch (o->object.flags & _OBJECT_COMPRESSED_MASK) { |
341 | 11.2M | case 0: |
342 | 11.2M | return COMPRESSION_NONE; |
343 | 0 | case OBJECT_COMPRESSED_XZ: |
344 | 0 | return COMPRESSION_XZ; |
345 | 0 | case OBJECT_COMPRESSED_LZ4: |
346 | 0 | return COMPRESSION_LZ4; |
347 | 0 | case OBJECT_COMPRESSED_ZSTD: |
348 | 0 | return COMPRESSION_ZSTD; |
349 | 0 | default: |
350 | 0 | return _COMPRESSION_INVALID; |
351 | 11.2M | } |
352 | 11.2M | } Unexecuted instantiation: journald-audit.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journald-console.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journald-context.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journald-kmsg.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journald-manager.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journald-native.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journald-socket.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journald-stream.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journald-sync.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journald-syslog.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journald-varlink.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journald-wall.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: fuzz-journald.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journald-gperf.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: fuzz-journald-native-fd.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: fuzz-journald-syslog.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: fuzz-journald-kmsg.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: fuzz-journald-stream.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: fuzz-journald-native.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: fuzz-journald-audit.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journal-remote-parse.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journal-remote-write.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journal-remote.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: fuzz-journal-remote.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journal-file-util.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journal-importer.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journal-util.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: logs-show.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journal-authenticate.c:COMPRESSION_FROM_OBJECT journal-file.c:COMPRESSION_FROM_OBJECT Line | Count | Source | 337 | 11.2M | static inline Compression COMPRESSION_FROM_OBJECT(const Object *o) { | 338 | 11.2M | assert(o); | 339 | | | 340 | 11.2M | switch (o->object.flags & _OBJECT_COMPRESSED_MASK) { | 341 | 11.2M | case 0: | 342 | 11.2M | return COMPRESSION_NONE; | 343 | 0 | case OBJECT_COMPRESSED_XZ: | 344 | 0 | return COMPRESSION_XZ; | 345 | 0 | case OBJECT_COMPRESSED_LZ4: | 346 | 0 | return COMPRESSION_LZ4; | 347 | 0 | case OBJECT_COMPRESSED_ZSTD: | 348 | 0 | return COMPRESSION_ZSTD; | 349 | 0 | default: | 350 | 0 | return _COMPRESSION_INVALID; | 351 | 11.2M | } | 352 | 11.2M | } |
Unexecuted instantiation: journal-vacuum.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: journal-verify.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: sd-journal.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: dbus-execute.c:COMPRESSION_FROM_OBJECT Unexecuted instantiation: load-fragment.c:COMPRESSION_FROM_OBJECT |
353 | | |
354 | 0 | static inline uint8_t COMPRESSION_TO_OBJECT_FLAG(Compression c) { |
355 | 0 | switch (c) { |
356 | 0 | case COMPRESSION_XZ: |
357 | 0 | return OBJECT_COMPRESSED_XZ; |
358 | 0 | case COMPRESSION_LZ4: |
359 | 0 | return OBJECT_COMPRESSED_LZ4; |
360 | 0 | case COMPRESSION_ZSTD: |
361 | 0 | return OBJECT_COMPRESSED_ZSTD; |
362 | 0 | default: |
363 | 0 | return 0; |
364 | 0 | } |
365 | 0 | } Unexecuted instantiation: journald-audit.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journald-console.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journald-context.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journald-kmsg.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journald-manager.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journald-native.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journald-socket.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journald-stream.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journald-sync.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journald-syslog.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journald-varlink.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journald-wall.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: fuzz-journald.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journald-gperf.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: fuzz-journald-native-fd.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: fuzz-journald-syslog.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: fuzz-journald-kmsg.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: fuzz-journald-stream.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: fuzz-journald-native.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: fuzz-journald-audit.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journal-remote-parse.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journal-remote-write.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journal-remote.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: fuzz-journal-remote.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journal-file-util.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journal-importer.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journal-util.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: logs-show.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journal-authenticate.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journal-file.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journal-vacuum.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: journal-verify.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: sd-journal.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: dbus-execute.c:COMPRESSION_TO_OBJECT_FLAG Unexecuted instantiation: load-fragment.c:COMPRESSION_TO_OBJECT_FLAG |
366 | | |
367 | 6.66k | static inline uint32_t COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG(Compression c) { |
368 | 6.66k | switch (c) { |
369 | 0 | case COMPRESSION_XZ: |
370 | 0 | return HEADER_INCOMPATIBLE_COMPRESSED_XZ; |
371 | 0 | case COMPRESSION_LZ4: |
372 | 0 | return HEADER_INCOMPATIBLE_COMPRESSED_LZ4; |
373 | 0 | case COMPRESSION_ZSTD: |
374 | 0 | return HEADER_INCOMPATIBLE_COMPRESSED_ZSTD; |
375 | 6.66k | default: |
376 | 6.66k | return 0; |
377 | 6.66k | } |
378 | 6.66k | } Unexecuted instantiation: journald-audit.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journald-console.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journald-context.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journald-kmsg.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journald-manager.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journald-native.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journald-socket.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journald-stream.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journald-sync.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journald-syslog.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journald-varlink.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journald-wall.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: fuzz-journald.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journald-gperf.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: fuzz-journald-native-fd.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: fuzz-journald-syslog.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: fuzz-journald-kmsg.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: fuzz-journald-stream.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: fuzz-journald-native.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: fuzz-journald-audit.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journal-remote-parse.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journal-remote-write.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journal-remote.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: fuzz-journal-remote.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journal-file-util.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journal-importer.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journal-util.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: logs-show.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journal-authenticate.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG journal-file.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Line | Count | Source | 367 | 6.66k | static inline uint32_t COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG(Compression c) { | 368 | 6.66k | switch (c) { | 369 | 0 | case COMPRESSION_XZ: | 370 | 0 | return HEADER_INCOMPATIBLE_COMPRESSED_XZ; | 371 | 0 | case COMPRESSION_LZ4: | 372 | 0 | return HEADER_INCOMPATIBLE_COMPRESSED_LZ4; | 373 | 0 | case COMPRESSION_ZSTD: | 374 | 0 | return HEADER_INCOMPATIBLE_COMPRESSED_ZSTD; | 375 | 6.66k | default: | 376 | 6.66k | return 0; | 377 | 6.66k | } | 378 | 6.66k | } |
Unexecuted instantiation: journal-vacuum.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: journal-verify.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: sd-journal.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: dbus-execute.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG Unexecuted instantiation: load-fragment.c:COMPRESSION_TO_HEADER_INCOMPATIBLE_FLAG |
379 | | |
380 | 1.52M | static inline bool journal_file_writable(JournalFile *f) { |
381 | 1.52M | assert(f); |
382 | 1.52M | return (f->open_flags & O_ACCMODE_STRICT) != O_RDONLY; |
383 | 1.52M | } Unexecuted instantiation: journald-audit.c:journal_file_writable Unexecuted instantiation: journald-console.c:journal_file_writable Unexecuted instantiation: journald-context.c:journal_file_writable Unexecuted instantiation: journald-kmsg.c:journal_file_writable Unexecuted instantiation: journald-manager.c:journal_file_writable Unexecuted instantiation: journald-native.c:journal_file_writable Unexecuted instantiation: journald-socket.c:journal_file_writable Unexecuted instantiation: journald-stream.c:journal_file_writable Unexecuted instantiation: journald-sync.c:journal_file_writable Unexecuted instantiation: journald-syslog.c:journal_file_writable Unexecuted instantiation: journald-varlink.c:journal_file_writable Unexecuted instantiation: journald-wall.c:journal_file_writable Unexecuted instantiation: fuzz-journald.c:journal_file_writable Unexecuted instantiation: journald-gperf.c:journal_file_writable Unexecuted instantiation: fuzz-journald-native-fd.c:journal_file_writable Unexecuted instantiation: fuzz-journald-syslog.c:journal_file_writable Unexecuted instantiation: fuzz-journald-kmsg.c:journal_file_writable Unexecuted instantiation: fuzz-journald-stream.c:journal_file_writable Unexecuted instantiation: fuzz-journald-native.c:journal_file_writable Unexecuted instantiation: fuzz-journald-audit.c:journal_file_writable Unexecuted instantiation: journal-remote-parse.c:journal_file_writable Unexecuted instantiation: journal-remote-write.c:journal_file_writable Unexecuted instantiation: journal-remote.c:journal_file_writable Unexecuted instantiation: fuzz-journal-remote.c:journal_file_writable journal-file-util.c:journal_file_writable Line | Count | Source | 380 | 6.66k | static inline bool journal_file_writable(JournalFile *f) { | 381 | 6.66k | assert(f); | 382 | 6.66k | return (f->open_flags & O_ACCMODE_STRICT) != O_RDONLY; | 383 | 6.66k | } |
Unexecuted instantiation: journal-importer.c:journal_file_writable Unexecuted instantiation: journal-util.c:journal_file_writable Unexecuted instantiation: logs-show.c:journal_file_writable Unexecuted instantiation: journal-authenticate.c:journal_file_writable journal-file.c:journal_file_writable Line | Count | Source | 380 | 1.51M | static inline bool journal_file_writable(JournalFile *f) { | 381 | 1.51M | assert(f); | 382 | 1.51M | return (f->open_flags & O_ACCMODE_STRICT) != O_RDONLY; | 383 | 1.51M | } |
Unexecuted instantiation: journal-vacuum.c:journal_file_writable Unexecuted instantiation: journal-verify.c:journal_file_writable Unexecuted instantiation: sd-journal.c:journal_file_writable Unexecuted instantiation: dbus-execute.c:journal_file_writable Unexecuted instantiation: load-fragment.c:journal_file_writable |