Systemd/src/systemd
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
..
_sd-common.h headers: use __inline__ instead of inline 2016-03-11 13:41:49 -05:00
Makefile build-sys: add stub makefiles to subdirs 2012-01-05 16:29:21 +01:00
sd-bus-protocol.h headers: remove commas at end of enum lists 2016-03-11 13:50:56 -05:00
sd-bus-vtable.h headers: remove commas at end of enum lists 2016-03-11 13:50:56 -05:00
sd-bus.h sd-bus: optionally, exit process or event loop on disconnect 2016-08-22 17:31:41 +02:00
sd-daemon.h Add sd_is_socket_sockaddr (#4885) 2016-12-14 11:51:26 +01:00
sd-device.h include sys/sysmacros.h in more places 2016-03-14 23:29:10 -04:00
sd-dhcp-client.h networkd: support setting dhcp client listen port (#4631) 2016-11-10 18:34:19 -05:00
sd-dhcp-lease.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
sd-dhcp-server.h networkd: Add EmitRouter= option for DHCP Server (#3251) 2016-05-17 19:34:25 -04:00
sd-dhcp6-client.h sd-network: rename "index" field of the various clients to "ifindex" 2016-05-26 15:34:42 +02:00
sd-dhcp6-lease.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
sd-event.h sd-event: expose the event loop iteration counter via sd_event_get_iteration() (#3631) 2016-06-30 21:25:07 +02:00
sd-hwdb.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
sd-id128.h tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID 2017-02-15 00:45:12 -05:00
sd-ipv4acd.h ipv4acd: rename "ll" parameter to "acd" everywhere 2016-05-26 15:34:43 +02:00
sd-ipv4ll.h ipv4ll: change "seed" parameter to be uint64_t 2016-05-26 15:34:43 +02:00
sd-journal.h sd-journal: "soft" deprecate sd_journal_open_container() 2016-04-25 19:29:01 +02:00
sd-lldp.h lldp: include sys/types.h in sd-lldp.h 2016-06-06 19:59:08 +02:00
sd-login.h Typo 2016-02-11 21:52:02 -05:00
sd-messages.h tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID 2017-02-15 00:45:12 -05:00
sd-ndisc.h network: beef up ipv6 RA support considerably 2016-06-06 20:11:38 +02:00
sd-netlink.h sd-netlink: fix sd_netlink_inc_rcvbuf() prototype 2016-06-03 19:20:00 +02:00
sd-network.h networkd: rework how carrier bindings are serialized 2016-02-21 20:40:57 +01:00
sd-path.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00
sd-resolve.h libsystemd-network: sd-event uses 64bit priorities, expose them in the APIs as such 2016-02-20 22:42:29 +01:00
sd-utf8.h tree-wide: remove Emacs lines from all files 2016-02-10 13:41:57 +01:00