Systemd/src/journal
Zbigniew Jędrzejewski-Szmek 2b0445262a tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID
Embedding sd_id128_t's in constant strings was rather cumbersome. We had
SD_ID128_CONST_STR which returned a const char[], but it had two problems:
- it wasn't possible to statically concatanate this array with a normal string
- gcc wasn't really able to optimize this, and generated code to perform the
  "conversion" at runtime.
Because of this, even our own code in coredumpctl wasn't using
SD_ID128_CONST_STR.

Add a new macro to generate a constant string: SD_ID128_MAKE_STR.
It is not as elegant as SD_ID128_CONST_STR, because it requires a repetition
of the numbers, but in practice it is more convenient to use, and allows gcc
to generate smarter code:

$ size .libs/systemd{,-logind,-journald}{.old,}
   text	   data	    bss	    dec	    hex	filename
1265204	 149564	   4808	1419576	 15a938	.libs/systemd.old
1260268	 149564	   4808	1414640	 1595f0	.libs/systemd
 246805	  13852	    209	 260866	  3fb02	.libs/systemd-logind.old
 240973	  13852	    209	 255034	  3e43a	.libs/systemd-logind
 146839	   4984	     34	 151857	  25131	.libs/systemd-journald.old
 146391	   4984	     34	 151409	  24f71	.libs/systemd-journald

It is also much easier to check if a certain binary uses a certain MESSAGE_ID:

$ strings .libs/systemd.old|grep MESSAGE_ID
MESSAGE_ID=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
MESSAGE_ID=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
MESSAGE_ID=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
MESSAGE_ID=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x

$ strings .libs/systemd|grep MESSAGE_ID
MESSAGE_ID=c7a787079b354eaaa9e77b371893cd27
MESSAGE_ID=b07a249cd024414a82dd00cd181378ff
MESSAGE_ID=641257651c1b4ec9a8624d7a40a9e1e7
MESSAGE_ID=de5b426a63be47a7b6ac3eaac82e2f6f
MESSAGE_ID=d34d037fff1847e6ae669a370e694725
MESSAGE_ID=7d4958e842da4a758f6c1cdc7b36dcc5
MESSAGE_ID=1dee0369c7fc4736b7099b38ecb46ee7
MESSAGE_ID=39f53479d3a045ac8e11786248231fbf
MESSAGE_ID=be02cf6855d2428ba40df7e9d022f03d
MESSAGE_ID=7b05ebc668384222baa8881179cfda54
MESSAGE_ID=9d1aaa27d60140bd96365438aad20286
2017-02-15 00:45:12 -05:00
..
.gitignore gitignore: libsystemd-journal.pc is no more (#3863) 2016-08-02 16:04:39 +02:00
audit-type.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
audit-type.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
cat.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
catalog.c tree-wide: make ++/-- usage consistent WRT spacing 2016-02-22 20:32:04 -08:00
catalog.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
compress.c journal: fix warning about LZ4_compress_limitedOutput 2016-12-10 13:52:49 -05:00
compress.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
fsprg.c journal: assert gcry_mpi_scan succeeded 2016-04-08 21:08:54 -04:00
fsprg.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journal-authenticate.c Merge pull request #2589 from keszybz/resolve-tool-2 2016-02-13 11:15:41 +01:00
journal-authenticate.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journal-def.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journal-file.c Merge pull request #5204 from keszybz/masked-warning-cleanup 2017-02-02 11:47:30 +01:00
journal-file.h journal: set STATE_ARCHIVED as part of offlining (#2740) 2016-04-27 08:29:43 +02:00
journal-internal.h sd-journal: add API for opening journal files or directories by fd 2016-04-25 15:24:46 +02:00
journal-qrcode.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journal-qrcode.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journal-send.c sd-journal: suppress empty lines 2016-07-19 17:51:20 +02:00
journal-vacuum.c journalctl: say in which directory we vacuum stuff 2016-10-12 20:25:20 +02:00
journal-vacuum.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journal-verify.c journal-verify: get rid of strerror 2016-09-13 20:10:56 -04:00
journal-verify.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journalctl.c journalctl: replace string_erase with memset('x') 2017-02-05 21:07:55 -05:00
journald-audit.c tree-wide: make ++/-- usage consistent WRT spacing 2016-02-22 20:32:04 -08:00
journald-audit.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald-console.c Rename formats-util.h to format-util.h 2016-11-07 10:15:08 -05:00
journald-console.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald-gperf.gperf journal: introduce JournalStorage and JournalStorageSpace structures 2016-10-19 09:53:07 +02:00
journald-kmsg.c tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID 2017-02-15 00:45:12 -05:00
journald-kmsg.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald-native.c Move export format parsing from src/journal-remote/ to src/basic/ 2017-02-14 23:56:48 -05:00
journald-native.h Move export format parsing from src/journal-remote/ to src/basic/ 2017-02-14 23:56:48 -05:00
journald-rate-limit.c journald, ratelimit: fix inaccurate message suppression in journal_rate_limit_test() (#4291) 2016-10-06 11:44:51 +02:00
journald-rate-limit.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald-server.c tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID 2017-02-15 00:45:12 -05:00
journald-server.h tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID 2017-02-15 00:45:12 -05:00
journald-stream.c journal: add stdout_stream_scan() comment (#4102) 2016-09-28 07:35:48 +02:00
journald-stream.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald-syslog.c tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID 2017-02-15 00:45:12 -05:00
journald-syslog.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald-wall.c Rename formats-util.h to format-util.h 2016-11-07 10:15:08 -05:00
journald-wall.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
journald.c tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID 2017-02-15 00:45:12 -05:00
journald.conf core: rename StartLimitInterval= to StartLimitIntervalSec= 2016-04-29 16:27:48 +02:00
lookup3.c journal/lookup3: silence gcc 7 implicit-fallthrough warning 2017-01-31 14:04:55 -05:00
lookup3.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
Makefile
mmap-cache.c tree-wide: use mfree more 2016-10-16 23:35:39 -04:00
mmap-cache.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
sd-journal.c journalctl: add remote log dir to search path when --merge is passed (#4970) 2016-12-24 00:42:13 +01:00
test-audit-type.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
test-catalog.c fileio: simplify mkostemp_safe() (#4090) 2016-09-13 08:20:38 +02:00
test-compress-benchmark.c test-compress-benchmark: fix argument parsing on 32bit 2016-04-02 18:58:21 -04:00
test-compress.c test-compress: fix warning about LZ4_compress_limitedOutput 2016-12-17 18:27:01 -05:00
test-journal-enum.c tree-wide: make ++/-- usage consistent WRT spacing 2016-02-22 20:32:04 -08:00
test-journal-flush.c sd-journal: add API for opening journal files or directories by fd 2016-04-25 15:24:46 +02:00
test-journal-init.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
test-journal-interleaving.c tests: get rid of strerror 2016-09-13 20:10:57 -04:00
test-journal-match.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
test-journal-send.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
test-journal-stream.c sd-journal: add API for opening journal files or directories by fd 2016-04-25 15:24:46 +02:00
test-journal-syslog.c tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
test-journal-verify.c sd-journal: add API for opening journal files or directories by fd 2016-04-25 15:24:46 +02:00
test-journal.c sd-journal: add API for opening journal files or directories by fd 2016-04-25 15:24:46 +02:00
test-mmap-cache.c fileio: simplify mkostemp_safe() (#4090) 2016-09-13 08:20:38 +02:00