memdup_suffix0:
   19|    570|void* memdup_suffix0(const void *p, size_t l) {
   20|    570|        void *ret;
   21|       |
   22|    570|        assert(l == 0 || p);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  1.14k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  |  Branch (95:44): [True: 0, False: 570]
  |  |  |  |  |  |  |  Branch (95:44): [True: 570, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   23|       |
   24|       |        /* The same as memdup() but place a safety NUL byte after the allocated memory */
   25|       |
   26|    570|        if (_unlikely_(l == SIZE_MAX)) /* prevent overflow */
  ------------------
  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  ------------------
  ------------------
   27|      0|                return NULL;
   28|       |
   29|    570|        ret = malloc(l + 1);
   30|    570|        if (!ret)
  ------------------
  |  Branch (30:13): [True: 0, False: 570]
  ------------------
   31|      0|                return NULL;
   32|       |
   33|    570|        ((uint8_t*) ret)[l] = 0;
   34|    570|        return memcpy_safe(ret, p, l);
   35|    570|}

journald-manager.c:malloc_multiply:
   88|    570|_malloc_ _alloc_(1, 2) static inline void *malloc_multiply(size_t need, size_t size) {
   89|    570|        if (size_multiply_overflow(size, need))
  ------------------
  |  Branch (89:13): [True: 0, False: 570]
  ------------------
   90|      0|                return NULL;
   91|       |
   92|    570|        return malloc(size * need ?: 1);
  ------------------
  |  Branch (92:23): [True: 570, False: 0]
  ------------------
   93|    570|}
journald-manager.c:size_multiply_overflow:
   84|    570|static inline bool size_multiply_overflow(size_t size, size_t need) {
   85|    570|        return _unlikely_(need != 0 && size > (SIZE_MAX / need));
  ------------------
  |  |   95|  1.14k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (95:44): [True: 570, False: 0]
  |  |  |  Branch (95:44): [True: 0, False: 570]
  |  |  ------------------
  ------------------
   86|    570|}
journald-syslog.c:freep:
   78|  2.85k|static inline void freep(void *p) {
   79|  2.85k|        *(void**)p = mfree(*(void**) p);
  ------------------
  |  |  404|  2.85k|        ({                                      \
  |  |  405|  2.85k|                free(memory);                   \
  |  |  406|  2.85k|                (typeof(memory)) NULL;          \
  |  |  407|  2.85k|        })
  ------------------
   80|  2.85k|}
journald-syslog.c:malloc_multiply:
   88|    544|_malloc_ _alloc_(1, 2) static inline void *malloc_multiply(size_t need, size_t size) {
   89|    544|        if (size_multiply_overflow(size, need))
  ------------------
  |  Branch (89:13): [True: 0, False: 544]
  ------------------
   90|      0|                return NULL;
   91|       |
   92|    544|        return malloc(size * need ?: 1);
  ------------------
  |  Branch (92:23): [True: 544, False: 0]
  ------------------
   93|    544|}
journald-syslog.c:size_multiply_overflow:
   84|    544|static inline bool size_multiply_overflow(size_t size, size_t need) {
   85|    544|        return _unlikely_(need != 0 && size > (SIZE_MAX / need));
  ------------------
  |  |   95|  1.08k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (95:44): [True: 544, False: 0]
  |  |  |  Branch (95:44): [True: 0, False: 544]
  |  |  ------------------
  ------------------
   86|    544|}
journald-wall.c:freep:
   78|  1.14k|static inline void freep(void *p) {
   79|  1.14k|        *(void**)p = mfree(*(void**) p);
  ------------------
  |  |  404|  1.14k|        ({                                      \
  |  |  405|  1.14k|                free(memory);                   \
  |  |  406|  1.14k|                (typeof(memory)) NULL;          \
  |  |  407|  1.14k|        })
  ------------------
   80|  1.14k|}
hostname-setup.c:freep:
   78|    162|static inline void freep(void *p) {
   79|    162|        *(void**)p = mfree(*(void**) p);
  ------------------
  |  |  404|    162|        ({                                      \
  |  |  405|    162|                free(memory);                   \
  |  |  406|    162|                (typeof(memory)) NULL;          \
  |  |  407|    162|        })
  ------------------
   80|    162|}
wall.c:freep:
   78|    324|static inline void freep(void *p) {
   79|    324|        *(void**)p = mfree(*(void**) p);
  ------------------
  |  |  404|    324|        ({                                      \
  |  |  405|    324|                free(memory);                   \
  |  |  406|    324|                (typeof(memory)) NULL;          \
  |  |  407|    324|        })
  ------------------
   80|    324|}
log.c:freep:
   78|    570|static inline void freep(void *p) {
   79|    570|        *(void**)p = mfree(*(void**) p);
  ------------------
  |  |  404|    570|        ({                                      \
  |  |  405|    570|                free(memory);                   \
  |  |  406|    570|                (typeof(memory)) NULL;          \
  |  |  407|    570|        })
  ------------------
   80|    570|}
prioq.c:malloc_multiply:
   88|    570|_malloc_ _alloc_(1, 2) static inline void *malloc_multiply(size_t need, size_t size) {
   89|    570|        if (size_multiply_overflow(size, need))
  ------------------
  |  Branch (89:13): [True: 0, False: 570]
  ------------------
   90|      0|                return NULL;
   91|       |
   92|    570|        return malloc(size * need ?: 1);
  ------------------
  |  Branch (92:23): [True: 570, False: 0]
  ------------------
   93|    570|}
prioq.c:size_multiply_overflow:
   84|    570|static inline bool size_multiply_overflow(size_t size, size_t need) {
   85|    570|        return _unlikely_(need != 0 && size > (SIZE_MAX / need));
  ------------------
  |  |   95|  1.14k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (95:44): [True: 570, False: 0]
  |  |  |  Branch (95:44): [True: 0, False: 570]
  |  |  ------------------
  ------------------
   86|    570|}
string-util.c:freep:
   78|    610|static inline void freep(void *p) {
   79|    610|        *(void**)p = mfree(*(void**) p);
  ------------------
  |  |  404|    610|        ({                                      \
  |  |  405|    610|                free(memory);                   \
  |  |  406|    610|                (typeof(memory)) NULL;          \
  |  |  407|    610|        })
  ------------------
   80|    610|}
string-util.c:GREEDY_ALLOC_ROUND_UP:
  111|    610|static inline size_t GREEDY_ALLOC_ROUND_UP(size_t l) {
  112|    610|        size_t m;
  113|       |
  114|       |        /* Round up allocation sizes a bit to some reasonable, likely larger value. This is supposed to be
  115|       |         * used for cases which are likely called in an allocation loop of some form, i.e. that repetitively
  116|       |         * grow stuff, for example strv_extend() and suchlike.
  117|       |         *
  118|       |         * Note the difference to GREEDY_REALLOC() here, as this helper operates on a single size value only,
  119|       |         * and rounds up to next multiple of 2, needing no further counter.
  120|       |         *
  121|       |         * Note the benefits of direct ALIGN_POWER2() usage: type-safety for size_t, sane handling for very
  122|       |         * small (i.e. <= 2) and safe handling for very large (i.e. > SSIZE_MAX) values. */
  123|       |
  124|    610|        if (l <= 2)
  ------------------
  |  Branch (124:13): [True: 0, False: 610]
  ------------------
  125|      0|                return 2; /* Never allocate less than 2 of something.  */
  126|       |
  127|    610|        m = ALIGN_POWER2(l);
  128|    610|        if (m == 0) /* overflow? */
  ------------------
  |  Branch (128:13): [True: 0, False: 610]
  ------------------
  129|      0|                return l;
  130|       |
  131|    610|        return m;
  132|    610|}
terminal-util.c:freep:
   78|     81|static inline void freep(void *p) {
   79|     81|        *(void**)p = mfree(*(void**) p);
  ------------------
  |  |  404|     81|        ({                                      \
  |  |  405|     81|                free(memory);                   \
  |  |  406|     81|                (typeof(memory)) NULL;          \
  |  |  407|     81|        })
  ------------------
   80|     81|}
sd-event.c:malloc_multiply:
   88|    570|_malloc_ _alloc_(1, 2) static inline void *malloc_multiply(size_t need, size_t size) {
   89|    570|        if (size_multiply_overflow(size, need))
  ------------------
  |  Branch (89:13): [True: 0, False: 570]
  ------------------
   90|      0|                return NULL;
   91|       |
   92|    570|        return malloc(size * need ?: 1);
  ------------------
  |  Branch (92:23): [True: 570, False: 0]
  ------------------
   93|    570|}
sd-event.c:size_multiply_overflow:
   84|    570|static inline bool size_multiply_overflow(size_t size, size_t need) {
   85|    570|        return _unlikely_(need != 0 && size > (SIZE_MAX / need));
  ------------------
  |  |   95|  1.14k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (95:44): [True: 570, False: 0]
  |  |  |  Branch (95:44): [True: 0, False: 570]
  |  |  ------------------
  ------------------
   86|    570|}

invoked_by_systemd:
   41|    570|bool invoked_by_systemd(void) {
   42|    570|        int r;
   43|       |
   44|       |        /* If the process is directly executed by PID1 (e.g. ExecStart= or generator), systemd-importd,
   45|       |         * or systemd-homed, then $SYSTEMD_EXEC_PID= is set, and read the command line. */
   46|    570|        const char *e = getenv("SYSTEMD_EXEC_PID");
   47|    570|        if (!e)
  ------------------
  |  Branch (47:13): [True: 570, False: 0]
  ------------------
   48|    570|                return false;
   49|       |
   50|      0|        if (streq(e, "*"))
  ------------------
  |  |   46|      0|#define streq(a,b) (strcmp((a),(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (46:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   51|       |                /* For testing. */
   52|      0|                return true;
   53|       |
   54|      0|        pid_t p;
   55|      0|        r = parse_pid(e, &p);
   56|      0|        if (r < 0) {
  ------------------
  |  Branch (56:13): [True: 0, False: 0]
  ------------------
   57|       |                /* We know that systemd sets the variable correctly. Something else must have set it. */
   58|      0|                log_debug_errno(r, "Failed to parse \"SYSTEMD_EXEC_PID=%s\", ignoring: %m", e);
  ------------------
  |  |  228|      0|#define log_debug_errno(error, ...)     log_full_errno(LOG_DEBUG,   error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  204|      0|        ({                                                              \
  |  |  |  |  205|      0|                int _error = (error);                                   \
  |  |  |  |  206|      0|                ASSERT_NON_ZERO(_error);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  198|      0|#  define ASSERT_NON_ZERO(x) assert((x) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  207|      0|                log_full_errno_zerook(level, _error, __VA_ARGS__);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  208|      0|        })
  |  |  ------------------
  ------------------
   59|      0|                return false;
   60|      0|        }
   61|       |
   62|      0|        return getpid_cached() == p;
   63|      0|}

log_set_assert_return_is_critical:
   16|    570|void log_set_assert_return_is_critical(bool b) {
   17|    570|        assert_return_is_critical = b;
   18|    570|}

mmap_cache_unref:
   45|    570|        scope type *name##_unref(type *p) {                      \
   46|    570|                if (!p)                                          \
  ------------------
  |  Branch (46:21): [True: 570, False: 0]
  ------------------
   47|    570|                        return NULL;                             \
   48|    570|                                                                 \
   49|    570|                assert(p->n_ref > 0);                            \
  ------------------
  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
   50|      0|                p->n_ref--;                                      \
   51|      0|                if (p->n_ref > 0)                                \
  ------------------
  |  Branch (51:21): [True: 0, False: 0]
  ------------------
   52|      0|                        return NULL;                             \
   53|      0|                                                                 \
   54|      0|                return free_func(p);                             \
   55|      0|        }
sd_event_source_unref:
   45|  9.69k|        scope type *name##_unref(type *p) {                      \
   46|  9.69k|                if (!p)                                          \
  ------------------
  |  Branch (46:21): [True: 9.69k, False: 0]
  ------------------
   47|  9.69k|                        return NULL;                             \
   48|  9.69k|                                                                 \
   49|  9.69k|                assert(p->n_ref > 0);                            \
  ------------------
  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
   50|      0|                p->n_ref--;                                      \
   51|      0|                if (p->n_ref > 0)                                \
  ------------------
  |  Branch (51:21): [True: 0, False: 0]
  ------------------
   52|      0|                        return NULL;                             \
   53|      0|                                                                 \
   54|      0|                return free_func(p);                             \
   55|      0|        }
sd_varlink_server_unref:
   45|    570|        scope type *name##_unref(type *p) {                      \
   46|    570|                if (!p)                                          \
  ------------------
  |  Branch (46:21): [True: 570, False: 0]
  ------------------
   47|    570|                        return NULL;                             \
   48|    570|                                                                 \
   49|    570|                assert(p->n_ref > 0);                            \
  ------------------
  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
   50|      0|                p->n_ref--;                                      \
   51|      0|                if (p->n_ref > 0)                                \
  ------------------
  |  Branch (51:21): [True: 0, False: 0]
  ------------------
   52|      0|                        return NULL;                             \
   53|      0|                                                                 \
   54|      0|                return free_func(p);                             \
   55|      0|        }

getenv_bool:
  991|    570|int getenv_bool(const char *p) {
  992|    570|        const char *e;
  993|       |
  994|    570|        e = getenv(p);
  995|    570|        if (!e)
  ------------------
  |  Branch (995:13): [True: 570, False: 0]
  ------------------
  996|    570|                return -ENXIO;
  997|       |
  998|      0|        return parse_boolean(e);
  999|    570|}

fd-util.c:_reset_errno_:
   23|  1.14k|static inline void _reset_errno_(int *saved_errno) {
   24|  1.14k|        if (*saved_errno < 0) /* Invalidated by UNPROTECT_ERRNO? */
  ------------------
  |  Branch (24:13): [True: 0, False: 1.14k]
  ------------------
   25|      0|                return;
   26|       |
   27|  1.14k|        errno = *saved_errno;
   28|  1.14k|}
log.c:_reset_errno_:
   23|    570|static inline void _reset_errno_(int *saved_errno) {
   24|    570|        if (*saved_errno < 0) /* Invalidated by UNPROTECT_ERRNO? */
  ------------------
  |  Branch (24:13): [True: 0, False: 570]
  ------------------
   25|      0|                return;
   26|       |
   27|    570|        errno = *saved_errno;
   28|    570|}

close_nointr:
   35|    570|int close_nointr(int fd) {
   36|    570|        assert(fd >= 0);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   37|       |
   38|    570|        if (close(fd) >= 0)
  ------------------
  |  Branch (38:13): [True: 570, False: 0]
  ------------------
   39|    570|                return 0;
   40|       |
   41|       |        /*
   42|       |         * Just ignore EINTR; a retry loop is the wrong thing to do on
   43|       |         * Linux.
   44|       |         *
   45|       |         * http://lkml.indiana.edu/hypermail/linux/kernel/0509.1/0877.html
   46|       |         * https://bugzilla.gnome.org/show_bug.cgi?id=682819
   47|       |         * http://utcc.utoronto.ca/~cks/space/blog/unix/CloseEINTR
   48|       |         * https://sites.google.com/site/michaelsafyan/software-engineering/checkforeintrwheninvokingclosethinkagain
   49|       |         */
   50|      0|        if (errno == EINTR)
  ------------------
  |  Branch (50:13): [True: 0, False: 0]
  ------------------
   51|      0|                return 0;
   52|       |
   53|      0|        return -errno;
   54|      0|}
safe_close:
   56|  9.69k|int safe_close(int fd) {
   57|       |        /*
   58|       |         * Like close_nointr() but cannot fail. Guarantees errno is unchanged. Is a noop for negative fds,
   59|       |         * and returns -EBADF, so that it can be used in this syntax:
   60|       |         *
   61|       |         * fd = safe_close(fd);
   62|       |         */
   63|       |
   64|  9.69k|        if (fd >= 0) {
  ------------------
  |  Branch (64:13): [True: 570, False: 9.12k]
  ------------------
   65|    570|                PROTECT_ERRNO;
  ------------------
  |  |   31|    570|        _cleanup_(_reset_errno_) _unused_ int _saved_errno_ = errno
  |  |  ------------------
  |  |  |  |   78|    570|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
   66|       |
   67|       |                /* The kernel might return pretty much any error code
   68|       |                 * via close(), but the fd will be closed anyway. The
   69|       |                 * only condition we want to check for here is whether
   70|       |                 * the fd was invalid at all... */
   71|       |
   72|    570|                assert_se(close_nointr(fd) != -EBADF);
  ------------------
  |  |   65|    570|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   73|    570|        }
   74|       |
   75|  9.69k|        return -EBADF;
   76|  9.69k|}
fd_move_above_stdio:
  712|    570|int fd_move_above_stdio(int fd) {
  713|    570|        int flags, copy;
  714|    570|        PROTECT_ERRNO;
  ------------------
  |  |   31|    570|        _cleanup_(_reset_errno_) _unused_ int _saved_errno_ = errno
  |  |  ------------------
  |  |  |  |   78|    570|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
  715|       |
  716|       |        /* Moves the specified file descriptor if possible out of the range [0…2], i.e. the range of
  717|       |         * stdin/stdout/stderr. If it can't be moved outside of this range the original file descriptor is
  718|       |         * returned. This call is supposed to be used for long-lasting file descriptors we allocate in our code that
  719|       |         * might get loaded into foreign code, and where we want ensure our fds are unlikely used accidentally as
  720|       |         * stdin/stdout/stderr of unrelated code.
  721|       |         *
  722|       |         * Note that this doesn't fix any real bugs, it just makes it less likely that our code will be affected by
  723|       |         * buggy code from others that mindlessly invokes 'fprintf(stderr, …' or similar in places where stderr has
  724|       |         * been closed before.
  725|       |         *
  726|       |         * This function is written in a "best-effort" and "least-impact" style. This means whenever we encounter an
  727|       |         * error we simply return the original file descriptor, and we do not touch errno. */
  728|       |
  729|    570|        if (fd < 0 || fd > 2)
  ------------------
  |  Branch (729:13): [True: 0, False: 570]
  |  Branch (729:23): [True: 570, False: 0]
  ------------------
  730|    570|                return fd;
  731|       |
  732|      0|        flags = fcntl(fd, F_GETFD, 0);
  733|      0|        if (flags < 0)
  ------------------
  |  Branch (733:13): [True: 0, False: 0]
  ------------------
  734|      0|                return fd;
  735|       |
  736|      0|        if (flags & FD_CLOEXEC)
  ------------------
  |  Branch (736:13): [True: 0, False: 0]
  ------------------
  737|      0|                copy = fcntl(fd, F_DUPFD_CLOEXEC, 3);
  738|      0|        else
  739|      0|                copy = fcntl(fd, F_DUPFD, 3);
  740|      0|        if (copy < 0)
  ------------------
  |  Branch (740:13): [True: 0, False: 0]
  ------------------
  741|      0|                return fd;
  742|       |
  743|      0|        assert(copy > 2);
  ------------------
  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
  744|       |
  745|      0|        (void) close(fd);
  746|      0|        return copy;
  747|      0|}

_hashmap_free:
  905|  4.56k|HashmapBase* _hashmap_free(HashmapBase *h) {
  906|  4.56k|        if (h) {
  ------------------
  |  Branch (906:13): [True: 0, False: 4.56k]
  ------------------
  907|      0|                _hashmap_clear(h);
  908|      0|                hashmap_free_no_clear(h);
  909|      0|        }
  910|       |
  911|  4.56k|        return NULL;
  912|  4.56k|}
_hashmap_size:
 1596|  1.14k|unsigned _hashmap_size(HashmapBase *h) {
 1597|  1.14k|        if (!h)
  ------------------
  |  Branch (1597:13): [True: 1.14k, False: 0]
  ------------------
 1598|  1.14k|                return 0;
 1599|       |
 1600|      0|        return n_entries(h);
 1601|  1.14k|}

journald-context.c:hashmap_size:
  203|  1.14k|static inline unsigned hashmap_size(Hashmap *h) {
  204|  1.14k|        return _hashmap_size(HASHMAP_BASE(h));
  ------------------
  |  |   46|  1.14k|        __builtin_choose_expr(PTR_COMPATIBLE_WITH_HASHMAP_BASE(h), \
  |  |  ------------------
  |  |  |  |   36|  1.14k|        (__builtin_types_compatible_p(typeof(h), HashmapBase*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   37|  1.14k|         __builtin_types_compatible_p(typeof(h), Hashmap*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (37:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   38|  1.14k|         __builtin_types_compatible_p(typeof(h), OrderedHashmap*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   39|  1.14k|         __builtin_types_compatible_p(typeof(h), Set*))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|  1.14k|                (HashmapBase*)(h), \
  |  |   48|  1.14k|                (void)0)
  ------------------
  205|  1.14k|}
journald-context.c:hashmap_isempty:
  210|    570|static inline bool hashmap_isempty(Hashmap *h) {
  211|    570|        return hashmap_size(h) == 0;
  212|    570|}
journald-context.c:hashmap_free:
   64|    570|static inline Hashmap* hashmap_free(Hashmap *h) {
   65|    570|        return (void*) _hashmap_free(HASHMAP_BASE(h));
  ------------------
  |  |   46|    570|        __builtin_choose_expr(PTR_COMPATIBLE_WITH_HASHMAP_BASE(h), \
  |  |  ------------------
  |  |  |  |   36|    570|        (__builtin_types_compatible_p(typeof(h), HashmapBase*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   37|    570|         __builtin_types_compatible_p(typeof(h), Hashmap*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (37:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   38|    570|         __builtin_types_compatible_p(typeof(h), OrderedHashmap*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   39|    570|         __builtin_types_compatible_p(typeof(h), Set*))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|    570|                (HashmapBase*)(h), \
  |  |   48|    570|                (void)0)
  ------------------
   66|    570|}
journald-manager.c:ordered_hashmap_free:
   67|  1.14k|static inline OrderedHashmap* ordered_hashmap_free(OrderedHashmap *h) {
   68|  1.14k|        return (void*) _hashmap_free(HASHMAP_BASE(h));
  ------------------
  |  |   46|  1.14k|        __builtin_choose_expr(PTR_COMPATIBLE_WITH_HASHMAP_BASE(h), \
  |  |  ------------------
  |  |  |  |   36|  1.14k|        (__builtin_types_compatible_p(typeof(h), HashmapBase*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   37|  1.14k|         __builtin_types_compatible_p(typeof(h), Hashmap*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (37:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   38|  1.14k|         __builtin_types_compatible_p(typeof(h), OrderedHashmap*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   39|  1.14k|         __builtin_types_compatible_p(typeof(h), Set*))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|  1.14k|                (HashmapBase*)(h), \
  |  |   48|  1.14k|                (void)0)
  ------------------
   69|  1.14k|}
sd-event.c:hashmap_free:
   64|  1.71k|static inline Hashmap* hashmap_free(Hashmap *h) {
   65|  1.71k|        return (void*) _hashmap_free(HASHMAP_BASE(h));
  ------------------
  |  |   46|  1.71k|        __builtin_choose_expr(PTR_COMPATIBLE_WITH_HASHMAP_BASE(h), \
  |  |  ------------------
  |  |  |  |   36|  1.71k|        (__builtin_types_compatible_p(typeof(h), HashmapBase*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   37|  1.71k|         __builtin_types_compatible_p(typeof(h), Hashmap*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (37:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   38|  1.71k|         __builtin_types_compatible_p(typeof(h), OrderedHashmap*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   39|  1.71k|         __builtin_types_compatible_p(typeof(h), Set*))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|  1.71k|                (HashmapBase*)(h), \
  |  |   48|  1.71k|                (void)0)
  ------------------
   66|  1.71k|}

undecchar:
   27|    130|int undecchar(char c) {
   28|       |
   29|    130|        if (c >= '0' && c <= '9')
  ------------------
  |  Branch (29:13): [True: 116, False: 14]
  |  Branch (29:25): [True: 105, False: 11]
  ------------------
   30|    105|                return c - '0';
   31|       |
   32|     25|        return -EINVAL;
   33|    130|}

iovec_make_string:
   55|  2.61k|struct iovec* iovec_make_string(struct iovec *iovec, const char *s) {
   56|  2.61k|        assert(iovec);
  ------------------
  |  |   72|  2.61k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  2.61k|        do {                                                            \
  |  |  |  |   59|  2.61k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  2.61k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 2.61k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  2.61k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  2.61k|        } while (false)
  |  |  ------------------
  ------------------
   57|       |
   58|  2.61k|        *iovec = IOVEC_MAKE(s, strlen_ptr(s));
  ------------------
  |  |   21|  2.61k|        (struct iovec) {                                                \
  |  |   22|  2.61k|                .iov_base = (void*) (base),                             \
  |  |   23|  2.61k|                .iov_len = (len),                                       \
  |  |   24|  2.61k|        }
  ------------------
   59|  2.61k|        return iovec;
   60|  2.61k|}

stderr_is_journal:
  233|    570|bool stderr_is_journal(void) {
  234|    570|        _cleanup_free_ char *w = NULL;
  ------------------
  |  |   82|    570|#define _cleanup_free_ _cleanup_(freep)
  |  |  ------------------
  |  |  |  |   78|    570|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
  235|    570|        const char *e;
  236|    570|        uint64_t dev, ino;
  237|    570|        struct stat st;
  238|       |
  239|    570|        e = getenv("JOURNAL_STREAM");
  240|    570|        if (!e)
  ------------------
  |  Branch (240:13): [True: 570, False: 0]
  ------------------
  241|    570|                return false;
  242|       |
  243|      0|        if (extract_first_word(&e, &w, ":", EXTRACT_DONT_COALESCE_SEPARATORS) <= 0)
  ------------------
  |  Branch (243:13): [True: 0, False: 0]
  ------------------
  244|      0|                return false;
  245|      0|        if (!e)
  ------------------
  |  Branch (245:13): [True: 0, False: 0]
  ------------------
  246|      0|                return false;
  247|       |
  248|      0|        if (safe_atou64(w, &dev) < 0)
  ------------------
  |  Branch (248:13): [True: 0, False: 0]
  ------------------
  249|      0|                return false;
  250|      0|        if (safe_atou64(e, &ino) < 0)
  ------------------
  |  Branch (250:13): [True: 0, False: 0]
  ------------------
  251|      0|                return false;
  252|       |
  253|      0|        if (fstat(STDERR_FILENO, &st) < 0)
  ------------------
  |  Branch (253:13): [True: 0, False: 0]
  ------------------
  254|      0|                return false;
  255|       |
  256|      0|        return st.st_dev == dev && st.st_ino == ino;
  ------------------
  |  Branch (256:16): [True: 0, False: 0]
  |  Branch (256:36): [True: 0, False: 0]
  ------------------
  257|      0|}
log_open:
  259|    570|int log_open(void) {
  260|    570|        int r;
  261|       |
  262|       |        /* Do not call from library code. */
  263|       |
  264|       |        /* This function is often called in preparation for logging. Let's make sure we don't clobber errno,
  265|       |         * so that a call to a logging function immediately following a log_open() call can still easily
  266|       |         * reference an error that happened immediately before the log_open() call. */
  267|    570|        PROTECT_ERRNO;
  ------------------
  |  |   31|    570|        _cleanup_(_reset_errno_) _unused_ int _saved_errno_ = errno
  |  |  ------------------
  |  |  |  |   78|    570|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
  268|       |
  269|       |        /* If we don't use the console, we close it here to not get killed by SAK. If we don't use syslog, we
  270|       |         * close it here too, so that we are not confused by somebody deleting the socket in the fs, and to
  271|       |         * make sure we don't use it if prohibit_ipc is set. If we don't use /dev/kmsg we still keep it open,
  272|       |         * because there is no reason to close it. */
  273|       |
  274|    570|        if (log_target == LOG_TARGET_NULL) {
  ------------------
  |  Branch (274:13): [True: 0, False: 570]
  ------------------
  275|      0|                log_close_journal();
  276|      0|                log_close_syslog();
  277|      0|                log_close_console();
  278|      0|                return 0;
  279|      0|        }
  280|       |
  281|    570|        if (getpid_cached() == 1 ||
  ------------------
  |  Branch (281:13): [True: 0, False: 570]
  ------------------
  282|    570|            stderr_is_journal() ||
  ------------------
  |  Branch (282:13): [True: 0, False: 570]
  ------------------
  283|    570|            IN_SET(log_target,
  ------------------
  |  |  361|    570|        ({                                                              \
  |  |  ------------------
  |  |  |  Branch (361:9): [True: 0, False: 570]
  |  |  ------------------
  |  |  362|    570|                bool _found = false;                                    \
  |  |  363|    570|                /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
  |  |  364|    570|                 * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
  |  |  365|    570|                static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
  |  |  366|    570|                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
  |  |  ------------------
  |  |  |  |  142|    570|#define assert_cc(expr) _Static_assert(expr, #expr)
  |  |  ------------------
  |  |  367|    570|                switch (x) {                                            \
  |  |  368|      0|                FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
  |  |  ------------------
  |  |  |  |  356|      0|        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  337|      0|#define  CASE_F_5(X, ...) case X:  CASE_F_4( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  336|      0|#define  CASE_F_4(X, ...) case X:  CASE_F_3( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  335|      0|#define  CASE_F_3(X, ...) case X:  CASE_F_2( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  334|      0|#define  CASE_F_2(X, ...) case X:  CASE_F_1( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  333|      0|#define  CASE_F_1(X)      case X:
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (333:27): [True: 0, False: 570]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (334:27): [True: 0, False: 570]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (335:27): [True: 0, False: 570]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (336:27): [True: 0, False: 570]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (337:27): [True: 0, False: 570]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  358|      0|                   (__VA_ARGS__)
  |  |  ------------------
  |  |  369|      0|                        _found = true;                                  \
  |  |  370|      0|                        break;                                          \
  |  |  371|    570|                default:                                                \
  |  |  ------------------
  |  |  |  Branch (371:17): [True: 570, False: 0]
  |  |  ------------------
  |  |  372|    570|                        ;                                               \
  |  |  373|    570|                }                                                       \
  |  |  374|    570|                _found;                                                 \
  |  |  375|    570|        })
  ------------------
  284|    570|                   LOG_TARGET_KMSG,
  285|    570|                   LOG_TARGET_JOURNAL,
  286|    570|                   LOG_TARGET_JOURNAL_OR_KMSG,
  287|    570|                   LOG_TARGET_SYSLOG,
  288|    570|                   LOG_TARGET_SYSLOG_OR_KMSG)) {
  289|       |
  290|      0|                if (!prohibit_ipc) {
  ------------------
  |  Branch (290:21): [True: 0, False: 0]
  ------------------
  291|      0|                        if (IN_SET(log_target,
  ------------------
  |  |  361|      0|        ({                                                              \
  |  |  ------------------
  |  |  |  Branch (361:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  362|      0|                bool _found = false;                                    \
  |  |  363|      0|                /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
  |  |  364|      0|                 * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
  |  |  365|      0|                static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
  |  |  366|      0|                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
  |  |  ------------------
  |  |  |  |  142|      0|#define assert_cc(expr) _Static_assert(expr, #expr)
  |  |  ------------------
  |  |  367|      0|                switch (x) {                                            \
  |  |  368|      0|                FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
  |  |  ------------------
  |  |  |  |  356|      0|        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  335|      0|#define  CASE_F_3(X, ...) case X:  CASE_F_2( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  334|      0|#define  CASE_F_2(X, ...) case X:  CASE_F_1( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  333|      0|#define  CASE_F_1(X)      case X:
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (333:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (334:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (335:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  358|      0|                   (__VA_ARGS__)
  |  |  ------------------
  |  |  369|      0|                        _found = true;                                  \
  |  |  370|      0|                        break;                                          \
  |  |  371|      0|                default:                                                \
  |  |  ------------------
  |  |  |  Branch (371:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  372|      0|                        ;                                               \
  |  |  373|      0|                }                                                       \
  |  |  374|      0|                _found;                                                 \
  |  |  375|      0|        })
  ------------------
  292|      0|                                   LOG_TARGET_AUTO,
  293|      0|                                   LOG_TARGET_JOURNAL_OR_KMSG,
  294|      0|                                   LOG_TARGET_JOURNAL)) {
  295|       |
  296|      0|                                r = log_open_journal();
  297|      0|                                if (r >= 0) {
  ------------------
  |  Branch (297:37): [True: 0, False: 0]
  ------------------
  298|      0|                                        log_close_syslog();
  299|      0|                                        log_close_console();
  300|      0|                                        return r;
  301|      0|                                }
  302|      0|                        }
  303|       |
  304|      0|                        if (IN_SET(log_target,
  ------------------
  |  |  361|      0|        ({                                                              \
  |  |  ------------------
  |  |  |  Branch (361:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  362|      0|                bool _found = false;                                    \
  |  |  363|      0|                /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
  |  |  364|      0|                 * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
  |  |  365|      0|                static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
  |  |  366|      0|                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
  |  |  ------------------
  |  |  |  |  142|      0|#define assert_cc(expr) _Static_assert(expr, #expr)
  |  |  ------------------
  |  |  367|      0|                switch (x) {                                            \
  |  |  368|      0|                FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
  |  |  ------------------
  |  |  |  |  356|      0|        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  334|      0|#define  CASE_F_2(X, ...) case X:  CASE_F_1( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  333|      0|#define  CASE_F_1(X)      case X:
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (333:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (334:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  358|      0|                   (__VA_ARGS__)
  |  |  ------------------
  |  |  369|      0|                        _found = true;                                  \
  |  |  370|      0|                        break;                                          \
  |  |  371|      0|                default:                                                \
  |  |  ------------------
  |  |  |  Branch (371:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  372|      0|                        ;                                               \
  |  |  373|      0|                }                                                       \
  |  |  374|      0|                _found;                                                 \
  |  |  375|      0|        })
  ------------------
  305|      0|                                   LOG_TARGET_SYSLOG_OR_KMSG,
  306|      0|                                   LOG_TARGET_SYSLOG)) {
  307|       |
  308|      0|                                r = log_open_syslog();
  309|      0|                                if (r >= 0) {
  ------------------
  |  Branch (309:37): [True: 0, False: 0]
  ------------------
  310|      0|                                        log_close_journal();
  311|      0|                                        log_close_console();
  312|      0|                                        return r;
  313|      0|                                }
  314|      0|                        }
  315|      0|                }
  316|       |
  317|      0|                if (IN_SET(log_target, LOG_TARGET_AUTO,
  ------------------
  |  |  361|      0|        ({                                                              \
  |  |  ------------------
  |  |  |  Branch (361:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  362|      0|                bool _found = false;                                    \
  |  |  363|      0|                /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
  |  |  364|      0|                 * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
  |  |  365|      0|                static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
  |  |  366|      0|                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
  |  |  ------------------
  |  |  |  |  142|      0|#define assert_cc(expr) _Static_assert(expr, #expr)
  |  |  ------------------
  |  |  367|      0|                switch (x) {                                            \
  |  |  368|      0|                FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
  |  |  ------------------
  |  |  |  |  356|      0|        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  336|      0|#define  CASE_F_4(X, ...) case X:  CASE_F_3( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  335|      0|#define  CASE_F_3(X, ...) case X:  CASE_F_2( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  334|      0|#define  CASE_F_2(X, ...) case X:  CASE_F_1( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  333|      0|#define  CASE_F_1(X)      case X:
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (333:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (334:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (335:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (336:27): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  358|      0|                   (__VA_ARGS__)
  |  |  ------------------
  |  |  369|      0|                        _found = true;                                  \
  |  |  370|      0|                        break;                                          \
  |  |  371|      0|                default:                                                \
  |  |  ------------------
  |  |  |  Branch (371:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  372|      0|                        ;                                               \
  |  |  373|      0|                }                                                       \
  |  |  374|      0|                _found;                                                 \
  |  |  375|      0|        })
  ------------------
  318|      0|                                       LOG_TARGET_JOURNAL_OR_KMSG,
  319|      0|                                       LOG_TARGET_SYSLOG_OR_KMSG,
  320|      0|                                       LOG_TARGET_KMSG)) {
  321|      0|                        r = log_open_kmsg();
  322|      0|                        if (r >= 0) {
  ------------------
  |  Branch (322:29): [True: 0, False: 0]
  ------------------
  323|      0|                                log_close_journal();
  324|      0|                                log_close_syslog();
  325|      0|                                log_close_console();
  326|      0|                                return r;
  327|      0|                        }
  328|      0|                }
  329|      0|        }
  330|       |
  331|    570|        log_close_journal();
  332|    570|        log_close_syslog();
  333|       |
  334|    570|        return log_open_console();
  335|    570|}
log_set_target:
  337|    570|void log_set_target(LogTarget target) {
  338|    570|        assert(target >= 0);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  339|    570|        assert(target < _LOG_TARGET_MAX);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  340|       |
  341|    570|        if (upgrade_syslog_to_journal) {
  ------------------
  |  Branch (341:13): [True: 0, False: 570]
  ------------------
  342|      0|                if (target == LOG_TARGET_SYSLOG)
  ------------------
  |  Branch (342:21): [True: 0, False: 0]
  ------------------
  343|      0|                        target = LOG_TARGET_JOURNAL;
  344|      0|                else if (target == LOG_TARGET_SYSLOG_OR_KMSG)
  ------------------
  |  Branch (344:26): [True: 0, False: 0]
  ------------------
  345|      0|                        target = LOG_TARGET_JOURNAL_OR_KMSG;
  346|      0|        }
  347|       |
  348|    570|        log_target = target;
  349|    570|}
log_set_max_level:
  372|    570|int log_set_max_level(int level) {
  373|    570|        assert(level == LOG_NULL || log_level_is_valid(level));
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  1.14k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  |  Branch (95:44): [True: 0, False: 570]
  |  |  |  |  |  |  |  Branch (95:44): [True: 570, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  374|       |
  375|    570|        int old = log_max_level;
  376|    570|        log_max_level = level;
  377|       |
  378|       |        /* Also propagate max log level to libc's syslog(), just in case some other component loaded into our
  379|       |         * process logs directly via syslog(). You might wonder why we maintain our own log level variable if
  380|       |         * libc has the same functionality. This has multiple reasons, first and foremost that we want to
  381|       |         * apply this to all our log targets, not just syslog and console. Moreover, we cannot query the
  382|       |         * current log mask from glibc without changing it, but that's useful for testing the current log
  383|       |         * level before even entering the log functions like we do in our macros. */
  384|    570|        setlogmask(LOG_UPTO(level));
  385|       |
  386|       |        /* Ensure that our own LOG_NULL define maps sanely to the log mask */
  387|    570|        assert_cc(LOG_UPTO(LOG_NULL) == 0);
  ------------------
  |  |  142|    570|#define assert_cc(expr) _Static_assert(expr, #expr)
  ------------------
  388|       |
  389|    570|        return old;
  390|    570|}
log_parse_environment_variables:
 1321|    570|void log_parse_environment_variables(void) {
 1322|    570|        const char *e;
 1323|    570|        int r;
 1324|       |
 1325|    570|        e = getenv("SYSTEMD_LOG_TARGET");
 1326|    570|        if (e && log_set_target_from_string(e) < 0)
  ------------------
  |  Branch (1326:13): [True: 0, False: 570]
  |  Branch (1326:18): [True: 0, False: 0]
  ------------------
 1327|    570|                log_warning("Failed to parse log target '%s', ignoring.", e);
  ------------------
  |  |  223|      0|#define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
 1328|       |
 1329|    570|        e = getenv("SYSTEMD_LOG_LEVEL");
 1330|    570|        if (e) {
  ------------------
  |  Branch (1330:13): [True: 0, False: 570]
  ------------------
 1331|      0|                r = log_set_max_level_from_string(e);
 1332|      0|                if (r < 0)
  ------------------
  |  Branch (1332:21): [True: 0, False: 0]
  ------------------
 1333|      0|                        log_warning_errno(r, "Failed to parse log level '%s', ignoring: %m", e);
  ------------------
  |  |  231|      0|#define log_warning_errno(error, ...)   log_full_errno(LOG_WARNING, error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  204|      0|        ({                                                              \
  |  |  |  |  205|      0|                int _error = (error);                                   \
  |  |  |  |  206|      0|                ASSERT_NON_ZERO(_error);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  198|      0|#  define ASSERT_NON_ZERO(x) assert((x) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  207|      0|                log_full_errno_zerook(level, _error, __VA_ARGS__);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  208|      0|        })
  |  |  ------------------
  ------------------
 1334|    570|        } else {
 1335|       |                /* If no explicit log level is specified then let's see if this is a debug invocation, and if
 1336|       |                 * so raise the log level to debug too. Note that this is not symmetric: just because
 1337|       |                 * DEBUG_INVOCATION is explicitly set to 0 we won't lower the log level below debug. This
 1338|       |                 * follows the logic that debug logging is an opt-in thing anyway, and if there's any reason
 1339|       |                 * to enable it we should not disable it here automatically. */
 1340|    570|                r = getenv_bool("DEBUG_INVOCATION");
 1341|    570|                if (r < 0 && r != -ENXIO)
  ------------------
  |  Branch (1341:21): [True: 570, False: 0]
  |  Branch (1341:30): [True: 0, False: 570]
  ------------------
 1342|    570|                        log_warning_errno(r, "Failed to parse $DEBUG_INVOCATION value, ignoring: %m");
  ------------------
  |  |  231|      0|#define log_warning_errno(error, ...)   log_full_errno(LOG_WARNING, error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  204|      0|        ({                                                              \
  |  |  |  |  205|      0|                int _error = (error);                                   \
  |  |  |  |  206|      0|                ASSERT_NON_ZERO(_error);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  198|      0|#  define ASSERT_NON_ZERO(x) assert((x) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  207|      0|                log_full_errno_zerook(level, _error, __VA_ARGS__);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  208|      0|        })
  |  |  ------------------
  ------------------
 1343|    570|                else if (r > 0)
  ------------------
  |  Branch (1343:26): [True: 0, False: 570]
  ------------------
 1344|      0|                        log_set_max_level(LOG_DEBUG);
 1345|    570|        }
 1346|       |
 1347|    570|        e = getenv("SYSTEMD_LOG_COLOR");
 1348|    570|        if (e && log_show_color_from_string(e) < 0)
  ------------------
  |  Branch (1348:13): [True: 0, False: 570]
  |  Branch (1348:18): [True: 0, False: 0]
  ------------------
 1349|    570|                log_warning("Failed to parse log color '%s', ignoring.", e);
  ------------------
  |  |  223|      0|#define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
 1350|       |
 1351|    570|        e = getenv("SYSTEMD_LOG_LOCATION");
 1352|    570|        if (e && log_show_location_from_string(e) < 0)
  ------------------
  |  Branch (1352:13): [True: 0, False: 570]
  |  Branch (1352:18): [True: 0, False: 0]
  ------------------
 1353|    570|                log_warning("Failed to parse log location '%s', ignoring.", e);
  ------------------
  |  |  223|      0|#define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
 1354|       |
 1355|    570|        e = getenv("SYSTEMD_LOG_TIME");
 1356|    570|        if (e && log_show_time_from_string(e) < 0)
  ------------------
  |  Branch (1356:13): [True: 0, False: 570]
  |  Branch (1356:18): [True: 0, False: 0]
  ------------------
 1357|    570|                log_warning("Failed to parse log time '%s', ignoring.", e);
  ------------------
  |  |  223|      0|#define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
 1358|       |
 1359|    570|        e = getenv("SYSTEMD_LOG_TID");
 1360|    570|        if (e && log_show_tid_from_string(e) < 0)
  ------------------
  |  Branch (1360:13): [True: 0, False: 570]
  |  Branch (1360:18): [True: 0, False: 0]
  ------------------
 1361|    570|                log_warning("Failed to parse log tid '%s', ignoring.", e);
  ------------------
  |  |  223|      0|#define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
 1362|       |
 1363|    570|        e = getenv("SYSTEMD_LOG_RATELIMIT_KMSG");
 1364|    570|        if (e && log_set_ratelimit_kmsg_from_string(e) < 0)
  ------------------
  |  Branch (1364:13): [True: 0, False: 570]
  |  Branch (1364:18): [True: 0, False: 0]
  ------------------
 1365|    570|                log_warning("Failed to parse log ratelimit kmsg boolean '%s', ignoring.", e);
  ------------------
  |  |  223|      0|#define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
 1366|    570|}
log_parse_environment:
 1368|    570|void log_parse_environment(void) {
 1369|       |        /* Do not call from library code. */
 1370|       |
 1371|    570|        if (should_parse_proc_cmdline())
  ------------------
  |  Branch (1371:13): [True: 0, False: 570]
  ------------------
 1372|      0|                (void) proc_cmdline_parse(parse_proc_cmdline_item, NULL, PROC_CMDLINE_STRIP_RD_PREFIX);
 1373|       |
 1374|    570|        log_parse_environment_variables();
 1375|    570|}
log_show_color:
 1409|      1|void log_show_color(bool b) {
 1410|      1|        show_color = b;
 1411|      1|}
log_on_console:
 1485|    570|bool log_on_console(void) {
 1486|    570|        if (IN_SET(log_target, LOG_TARGET_CONSOLE,
  ------------------
  |  |  361|    570|        ({                                                              \
  |  |  ------------------
  |  |  |  Branch (361:9): [True: 0, False: 570]
  |  |  ------------------
  |  |  362|    570|                bool _found = false;                                    \
  |  |  363|    570|                /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
  |  |  364|    570|                 * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
  |  |  365|    570|                static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
  |  |  366|    570|                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
  |  |  ------------------
  |  |  |  |  142|    570|#define assert_cc(expr) _Static_assert(expr, #expr)
  |  |  ------------------
  |  |  367|    570|                switch (x) {                                            \
  |  |  368|      0|                FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
  |  |  ------------------
  |  |  |  |  356|      0|        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  334|      0|#define  CASE_F_2(X, ...) case X:  CASE_F_1( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  333|      0|#define  CASE_F_1(X)      case X:
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (333:27): [True: 0, False: 570]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (334:27): [True: 0, False: 570]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  358|      0|                   (__VA_ARGS__)
  |  |  ------------------
  |  |  369|      0|                        _found = true;                                  \
  |  |  370|      0|                        break;                                          \
  |  |  371|    570|                default:                                                \
  |  |  ------------------
  |  |  |  Branch (371:17): [True: 570, False: 0]
  |  |  ------------------
  |  |  372|    570|                        ;                                               \
  |  |  373|    570|                }                                                       \
  |  |  374|    570|                _found;                                                 \
  |  |  375|    570|        })
  ------------------
 1487|    570|                               LOG_TARGET_CONSOLE_PREFIXED))
 1488|      0|                return true;
 1489|       |
 1490|    570|        return syslog_fd < 0 && kmsg_fd < 0 && journal_fd < 0;
  ------------------
  |  Branch (1490:16): [True: 570, False: 0]
  |  Branch (1490:33): [True: 570, False: 0]
  |  Branch (1490:48): [True: 570, False: 0]
  ------------------
 1491|    570|}
log_setup:
 1714|    570|void log_setup(void) {
 1715|    570|        log_set_target(LOG_TARGET_AUTO);
 1716|    570|        log_parse_environment();
 1717|    570|        (void) log_open();
 1718|    570|        if (log_on_console() && show_color < 0)
  ------------------
  |  Branch (1718:13): [True: 570, False: 0]
  |  Branch (1718:33): [True: 1, False: 569]
  ------------------
 1719|      1|                log_show_color(true);
 1720|    570|}
log.c:log_close_journal:
  202|    570|static void log_close_journal(void) {
  203|       |        /* If the journal FD is bad, safe_close will fail, and will try to log, which will fail, so we'll
  204|       |         * try to close the journal FD, which is bad, so safe_close will fail... Whether we can close it
  205|       |         * or not, invalidate it immediately so that we don't get in a recursive loop until we run out of
  206|       |         * stack. */
  207|    570|        (void) safe_close(TAKE_FD(journal_fd));
  ------------------
  |  |   99|    570|#define TAKE_FD(fd) TAKE_GENERIC(fd, int, -EBADF)
  |  |  ------------------
  |  |  |  |  380|    570|        ({                                                       \
  |  |  |  |  381|    570|                type *_pvar_ = &(var);                           \
  |  |  |  |  382|    570|                type _var_ = *_pvar_;                            \
  |  |  |  |  383|    570|                type _nullvalue_ = nullvalue;                    \
  |  |  |  |  384|    570|                *_pvar_ = _nullvalue_;                           \
  |  |  |  |  385|    570|                _var_;                                           \
  |  |  |  |  386|    570|        })
  |  |  ------------------
  ------------------
  208|    570|}
log.c:log_close_syslog:
  136|    570|static void log_close_syslog(void) {
  137|       |        /* See comment in log_close_journal() */
  138|    570|        (void) safe_close(TAKE_FD(syslog_fd));
  ------------------
  |  |   99|    570|#define TAKE_FD(fd) TAKE_GENERIC(fd, int, -EBADF)
  |  |  ------------------
  |  |  |  |  380|    570|        ({                                                       \
  |  |  |  |  381|    570|                type *_pvar_ = &(var);                           \
  |  |  |  |  382|    570|                type _var_ = *_pvar_;                            \
  |  |  |  |  383|    570|                type _nullvalue_ = nullvalue;                    \
  |  |  |  |  384|    570|                *_pvar_ = _nullvalue_;                           \
  |  |  |  |  385|    570|                _var_;                                           \
  |  |  |  |  386|    570|        })
  |  |  ------------------
  ------------------
  139|    570|}
log.c:log_open_console:
   96|    570|static int log_open_console(void) {
   97|       |
   98|    570|        if (!always_reopen_console) {
  ------------------
  |  Branch (98:13): [True: 570, False: 0]
  ------------------
   99|    570|                console_fd = STDERR_FILENO;
  100|    570|                console_fd_is_tty = -1;
  101|    570|                return 0;
  102|    570|        }
  103|       |
  104|      0|        if (console_fd < 3) {
  ------------------
  |  Branch (104:13): [True: 0, False: 0]
  ------------------
  105|      0|                int fd;
  106|       |
  107|      0|                fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY|O_CLOEXEC);
  108|      0|                if (fd < 0)
  ------------------
  |  Branch (108:21): [True: 0, False: 0]
  ------------------
  109|      0|                        return fd;
  110|       |
  111|      0|                console_fd = fd_move_above_stdio(fd);
  112|      0|                console_fd_is_tty = true;
  113|      0|        }
  114|       |
  115|      0|        return 0;
  116|      0|}
log.c:should_parse_proc_cmdline:
 1312|    570|static bool should_parse_proc_cmdline(void) {
 1313|       |        /* PID1 always reads the kernel command line. */
 1314|    570|        if (getpid_cached() == 1)
  ------------------
  |  Branch (1314:13): [True: 0, False: 570]
  ------------------
 1315|      0|                return true;
 1316|       |
 1317|       |        /* Otherwise, parse the command line if invoked directly by systemd. */
 1318|    570|        return invoked_by_systemd();
 1319|    570|}

string-util.c:ALIGN_POWER2:
   59|    610|static inline unsigned long ALIGN_POWER2(unsigned long u) {
   60|       |
   61|       |        /* Avoid subtraction overflow */
   62|    610|        if (u == 0)
  ------------------
  |  Branch (62:13): [True: 0, False: 610]
  ------------------
   63|      0|                return 0;
   64|       |
   65|       |        /* clz(0) is undefined */
   66|    610|        if (u == 1)
  ------------------
  |  Branch (66:13): [True: 0, False: 610]
  ------------------
   67|      0|                return 1;
   68|       |
   69|       |        /* left-shift overflow is undefined */
   70|    610|        if (__builtin_clzl(u - 1UL) < 1)
  ------------------
  |  Branch (70:13): [True: 0, False: 610]
  ------------------
   71|      0|                return 0;
   72|       |
   73|    610|        return 1UL << (sizeof(u) * 8 - __builtin_clzl(u - 1UL));
   74|    610|}

alloc-util.c:memcpy_safe:
   18|    570|static inline void* memcpy_safe(void *dst, const void *src, size_t n) {
   19|    570|        if (n == 0)
  ------------------
  |  Branch (19:13): [True: 0, False: 570]
  ------------------
   20|      0|                return dst;
   21|    570|        assert(src);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   22|    570|        return memcpy(dst, src, n);
   23|    570|}

sd-event.c:origin_id_query:
   22|  1.14k|static uint64_t origin_id_query(void) {                               \
   23|  1.14k|        static pthread_once_t once = PTHREAD_ONCE_INIT;               \
   24|  1.14k|        assert_se(pthread_once(&once, origin_id_initialize) == 0);    \
  ------------------
  |  |   65|  1.14k|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  1.14k|        do {                                                            \
  |  |  |  |   59|  1.14k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  1.14k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 1.14k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  1.14k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  1.14k|        } while (false)
  |  |  ------------------
  ------------------
   25|  1.14k|        return origin_id ^ getpid_cached();                           \
   26|  1.14k|}                                                                     \
sd-event.c:origin_id_initialize:
   18|      1|static void origin_id_initialize(void) {                              \
   19|      1|        origin_id = random_u64();                                     \
   20|      1|}                                                                     \
sd-event.c:event_origin_changed:
   28|    570|scope bool name##_origin_changed(type *p) {                           \
   29|    570|        assert(p);                                                    \
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   30|    570|        return p->origin_id != origin_id_query();                     \
   31|    570|}

prioq_new:
   27|    570|Prioq* prioq_new(compare_func_t compare_func) {
   28|    570|        Prioq *q;
   29|       |
   30|    570|        q = new(Prioq, 1);
  ------------------
  |  |   17|    570|#define new(t, n) ((t*) malloc_multiply(n, sizeof(t)))
  ------------------
   31|    570|        if (!q)
  ------------------
  |  Branch (31:13): [True: 0, False: 570]
  ------------------
   32|      0|                return q;
   33|       |
   34|    570|        *q = (Prioq) {
   35|    570|                .compare_func = compare_func,
   36|    570|        };
   37|       |
   38|    570|        return q;
   39|    570|}
prioq_free:
   41|  9.12k|Prioq* prioq_free(Prioq *q) {
   42|  9.12k|        if (!q)
  ------------------
  |  Branch (42:13): [True: 8.55k, False: 570]
  ------------------
   43|  8.55k|                return NULL;
   44|       |
   45|       |        /* Invalidate the index fields of any remaining objects */
   46|    570|        FOREACH_ARRAY(item, q->items, q->n_items)
  ------------------
  |  |  463|    570|        _FOREACH_ARRAY(i, array, num, UNIQ_T(m, UNIQ), UNIQ_T(end, UNIQ))
  |  |  ------------------
  |  |  |  |  457|    570|        for (typeof(array[0]) *i = (array), *end = ({                   \
  |  |  |  |  458|    570|                                typeof(num) m = (num);                  \
  |  |  |  |  459|    570|                                (i && m > 0) ? i + m : NULL;            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (459:34): [True: 0, False: 570]
  |  |  |  |  |  Branch (459:39): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  460|    570|                        }); end && i < end; i++)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:29): [True: 0, False: 570]
  |  |  |  |  |  Branch (460:36): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   47|      0|                if (item->idx)
  ------------------
  |  Branch (47:21): [True: 0, False: 0]
  ------------------
   48|      0|                        *(item->idx) = PRIOQ_IDX_NULL;
  ------------------
  |  |    8|    570|#define PRIOQ_IDX_NULL (UINT_MAX)
  ------------------
   49|       |
   50|    570|        free(q->items);
   51|    570|        return mfree(q);
  ------------------
  |  |  404|    570|        ({                                      \
  |  |  405|    570|                free(memory);                   \
  |  |  406|    570|                (typeof(memory)) NULL;          \
  |  |  407|    570|        })
  ------------------
   52|  9.12k|}
prioq_ensure_allocated:
   54|    570|int prioq_ensure_allocated(Prioq **q, compare_func_t compare_func) {
   55|    570|        assert(q);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   56|       |
   57|    570|        if (*q) {
  ------------------
  |  Branch (57:13): [True: 0, False: 570]
  ------------------
   58|      0|                assert((*q)->compare_func == compare_func);
  ------------------
  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
   59|      0|                return 0;
   60|      0|        }
   61|       |
   62|    570|        *q = prioq_new(compare_func);
   63|    570|        if (!*q)
  ------------------
  |  Branch (63:13): [True: 0, False: 570]
  ------------------
   64|      0|                return -ENOMEM;
   65|       |
   66|    570|        return 0;
   67|    570|}
prioq_peek_by_index:
  270|  1.14k|void* prioq_peek_by_index(Prioq *q, unsigned idx) {
  271|  1.14k|        if (!q)
  ------------------
  |  Branch (271:13): [True: 1.14k, False: 0]
  ------------------
  272|  1.14k|                return NULL;
  273|       |
  274|      0|        if (idx >= q->n_items)
  ------------------
  |  Branch (274:13): [True: 0, False: 0]
  ------------------
  275|      0|                return NULL;
  276|       |
  277|      0|        return q->items[idx].data;
  278|      0|}
prioq_size:
  294|    570|unsigned prioq_size(Prioq *q) {
  295|       |
  296|    570|        if (!q)
  ------------------
  |  Branch (296:13): [True: 570, False: 0]
  ------------------
  297|    570|                return 0;
  298|       |
  299|      0|        return q->n_items;
  300|    570|}
prioq_isempty:
  302|    570|bool prioq_isempty(Prioq *q) {
  303|       |
  304|    570|        if (!q)
  ------------------
  |  Branch (304:13): [True: 570, False: 0]
  ------------------
  305|    570|                return true;
  306|       |
  307|      0|        return q->n_items <= 0;
  308|    570|}

journald-manager.c:prioq_peek:
   27|  1.14k|static inline void *prioq_peek(Prioq *q) {
   28|  1.14k|        return prioq_peek_by_index(q, 0);
   29|  1.14k|}

getpid_cached:
 1387|  2.28k|pid_t getpid_cached(void) {
 1388|  2.28k|        static bool installed = false;
 1389|  2.28k|        pid_t current_value = CACHED_PID_UNSET;
  ------------------
  |  | 1377|  2.28k|#define CACHED_PID_UNSET ((pid_t) 0)
  ------------------
 1390|       |
 1391|       |        /* getpid_cached() is much like getpid(), but caches the value in local memory, to avoid having to invoke a
 1392|       |         * system call each time. This restores glibc behaviour from before 2.24, when getpid() was unconditionally
 1393|       |         * cached. Starting with 2.24 getpid() started to become prohibitively expensive when used for detecting when
 1394|       |         * objects were used across fork()s. With this caching the old behaviour is somewhat restored.
 1395|       |         *
 1396|       |         * https://bugzilla.redhat.com/show_bug.cgi?id=1443976
 1397|       |         * https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c579f48edba88380635ab98cb612030e3ed8691e
 1398|       |         */
 1399|       |
 1400|  2.28k|        (void) __atomic_compare_exchange_n(
 1401|  2.28k|                        &cached_pid,
 1402|  2.28k|                        &current_value,
 1403|  2.28k|                        CACHED_PID_BUSY,
  ------------------
  |  | 1378|  2.28k|#define CACHED_PID_BUSY ((pid_t) -1)
  ------------------
 1404|  2.28k|                        false,
 1405|  2.28k|                        __ATOMIC_SEQ_CST,
 1406|  2.28k|                        __ATOMIC_SEQ_CST);
 1407|       |
 1408|  2.28k|        switch (current_value) {
 1409|       |
 1410|      1|        case CACHED_PID_UNSET: { /* Not initialized yet, then do so now */
  ------------------
  |  | 1377|      1|#define CACHED_PID_UNSET ((pid_t) 0)
  ------------------
  |  Branch (1410:9): [True: 1, False: 2.27k]
  ------------------
 1411|      1|                pid_t new_pid;
 1412|       |
 1413|      1|                new_pid = getpid();
 1414|       |
 1415|      1|                if (!installed) {
  ------------------
  |  Branch (1415:21): [True: 1, False: 0]
  ------------------
 1416|       |                        /* __register_atfork() either returns 0 or -ENOMEM, in its glibc implementation. Since it's
 1417|       |                         * only half-documented (glibc doesn't document it but LSB does — though only superficially)
 1418|       |                         * we'll check for errors only in the most generic fashion possible. */
 1419|       |
 1420|      1|                        if (pthread_atfork(NULL, NULL, reset_cached_pid) != 0) {
  ------------------
  |  Branch (1420:29): [True: 0, False: 1]
  ------------------
 1421|       |                                /* OOM? Let's try again later */
 1422|      0|                                cached_pid = CACHED_PID_UNSET;
  ------------------
  |  | 1377|      0|#define CACHED_PID_UNSET ((pid_t) 0)
  ------------------
 1423|      0|                                return new_pid;
 1424|      0|                        }
 1425|       |
 1426|      1|                        installed = true;
 1427|      1|                }
 1428|       |
 1429|      1|                cached_pid = new_pid;
 1430|      1|                return new_pid;
 1431|      1|        }
 1432|       |
 1433|      0|        case CACHED_PID_BUSY: /* Somebody else is currently initializing */
  ------------------
  |  | 1378|      0|#define CACHED_PID_BUSY ((pid_t) -1)
  ------------------
  |  Branch (1433:9): [True: 0, False: 2.28k]
  ------------------
 1434|      0|                return getpid();
 1435|       |
 1436|  2.27k|        default: /* Properly initialized */
  ------------------
  |  Branch (1436:9): [True: 2.27k, False: 1]
  ------------------
 1437|  2.27k|                return current_value;
 1438|  2.28k|        }
 1439|  2.28k|}

random_bytes:
   69|      1|void random_bytes(void *p, size_t n) {
   70|      1|        static bool have_grndinsecure = true;
   71|       |
   72|      1|        assert(p || n == 0);
  ------------------
  |  |   72|      1|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      1|        do {                                                            \
  |  |  |  |   59|      1|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      1|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 1]
  |  |  |  |  |  |  |  Branch (95:44): [True: 1, False: 0]
  |  |  |  |  |  |  |  Branch (95:44): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      1|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      1|        } while (false)
  |  |  ------------------
  ------------------
   73|       |
   74|      1|        if (n == 0)
  ------------------
  |  Branch (74:13): [True: 0, False: 1]
  ------------------
   75|      0|                return;
   76|       |
   77|      1|        for (;;) {
   78|      1|                ssize_t l;
   79|       |
   80|      1|                l = getrandom(p, n, have_grndinsecure ? GRND_INSECURE : GRND_NONBLOCK);
  ------------------
  |  Branch (80:37): [True: 1, False: 0]
  ------------------
   81|      1|                if (l < 0 && errno == EINVAL && have_grndinsecure) {
  ------------------
  |  Branch (81:21): [True: 0, False: 1]
  |  Branch (81:30): [True: 0, False: 0]
  |  Branch (81:49): [True: 0, False: 0]
  ------------------
   82|       |                        /* No GRND_INSECURE; fallback to GRND_NONBLOCK. */
   83|      0|                        have_grndinsecure = false;
   84|      0|                        continue;
   85|      0|                }
   86|      1|                if (l <= 0)
  ------------------
  |  Branch (86:21): [True: 0, False: 1]
  ------------------
   87|      0|                        break; /* Will block (with GRND_NONBLOCK), or unexpected error. Give up and fallback
   88|       |                                  to /dev/urandom. */
   89|       |
   90|      1|                if ((size_t) l == n)
  ------------------
  |  Branch (90:21): [True: 1, False: 0]
  ------------------
   91|      1|                        return; /* Done reading, success. */
   92|       |
   93|      0|                p = (uint8_t *) p + l;
   94|      0|                n -= l;
   95|       |                /* Interrupted by a signal; keep going. */
   96|      0|        }
   97|       |
   98|      0|        _cleanup_close_ int fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC|O_NOCTTY);
  ------------------
  |  |   60|      0|#define _cleanup_close_ _cleanup_(closep)
  |  |  ------------------
  |  |  |  |   78|      0|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
   99|      0|        if (fd >= 0 && loop_read_exact(fd, p, n, false) >= 0)
  ------------------
  |  Branch (99:13): [True: 0, False: 0]
  |  Branch (99:24): [True: 0, False: 0]
  ------------------
  100|      0|                return;
  101|       |
  102|       |        /* This is a terrible fallback. Oh well. */
  103|      0|        fallback_random_bytes(p, n);
  104|      0|}

sd-event.c:random_u64:
   10|      1|static inline uint64_t random_u64(void) {
   11|      1|        uint64_t u;
   12|      1|        random_bytes(&u, sizeof(u));
   13|      1|        return u;
   14|      1|}

journald-manager.c:set_free:
   12|    570|static inline Set* set_free(Set *s) {
   13|    570|        return (Set*) _hashmap_free(HASHMAP_BASE(s));
  ------------------
  |  |   46|    570|        __builtin_choose_expr(PTR_COMPATIBLE_WITH_HASHMAP_BASE(h), \
  |  |  ------------------
  |  |  |  |   36|    570|        (__builtin_types_compatible_p(typeof(h), HashmapBase*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   37|    570|         __builtin_types_compatible_p(typeof(h), Hashmap*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (37:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   38|    570|         __builtin_types_compatible_p(typeof(h), OrderedHashmap*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   39|    570|         __builtin_types_compatible_p(typeof(h), Set*))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|    570|                (HashmapBase*)(h), \
  |  |   48|    570|                (void)0)
  ------------------
   14|    570|}
sd-event.c:set_free:
   12|    570|static inline Set* set_free(Set *s) {
   13|    570|        return (Set*) _hashmap_free(HASHMAP_BASE(s));
  ------------------
  |  |   46|    570|        __builtin_choose_expr(PTR_COMPATIBLE_WITH_HASHMAP_BASE(h), \
  |  |  ------------------
  |  |  |  |   36|    570|        (__builtin_types_compatible_p(typeof(h), HashmapBase*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   37|    570|         __builtin_types_compatible_p(typeof(h), Hashmap*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (37:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   38|    570|         __builtin_types_compatible_p(typeof(h), OrderedHashmap*) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  |   39|    570|         __builtin_types_compatible_p(typeof(h), Set*))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:10): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|    570|                (HashmapBase*)(h), \
  |  |   48|    570|                (void)0)
  ------------------
   14|    570|}

journald-syslog.c:snprintf_ok:
   10|  1.11k|static inline char* snprintf_ok(char *buf, size_t len, const char *format, ...) {
   11|  1.11k|        va_list ap;
   12|  1.11k|        int r;
   13|       |
   14|  1.11k|        va_start(ap, format);
   15|  1.11k|        r = vsnprintf(buf, len, format, ap);
   16|  1.11k|        va_end(ap);
   17|       |
   18|  1.11k|        return r >= 0 && (size_t) r < len ? buf : NULL;
  ------------------
  |  Branch (18:16): [True: 1.11k, False: 0]
  |  Branch (18:26): [True: 1.11k, False: 0]
  ------------------
   19|  1.11k|}

strextend_with_separator_internal:
  796|    610|char* strextend_with_separator_internal(char **x, const char *separator, ...) {
  797|    610|        _cleanup_free_ char *buffer = NULL;
  ------------------
  |  |   82|    610|#define _cleanup_free_ _cleanup_(freep)
  |  |  ------------------
  |  |  |  |   78|    610|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
  798|    610|        size_t f, l, l_separator;
  799|    610|        bool need_separator;
  800|    610|        char *nr, *p;
  801|    610|        va_list ap;
  802|       |
  803|    610|        if (!x)
  ------------------
  |  Branch (803:13): [True: 610, False: 0]
  ------------------
  804|    610|                x = &buffer;
  805|       |
  806|    610|        l = f = strlen_ptr(*x);
  807|       |
  808|    610|        need_separator = !isempty(*x);
  809|    610|        l_separator = strlen_ptr(separator);
  810|       |
  811|    610|        va_start(ap, separator);
  812|  1.87k|        for (const char *t;;) {
  813|  1.87k|                size_t n;
  814|       |
  815|  1.87k|                t = va_arg(ap, const char *);
  816|  1.87k|                if (!t)
  ------------------
  |  Branch (816:21): [True: 610, False: 1.26k]
  ------------------
  817|    610|                        break;
  818|  1.26k|                if (t == POINTER_MAX)
  ------------------
  |  |  159|  1.26k|#define POINTER_MAX ((void*) UINTPTR_MAX)
  ------------------
  |  Branch (818:21): [True: 0, False: 1.26k]
  ------------------
  819|      0|                        continue;
  820|       |
  821|  1.26k|                n = strlen(t);
  822|       |
  823|  1.26k|                if (need_separator)
  ------------------
  |  Branch (823:21): [True: 650, False: 610]
  ------------------
  824|    650|                        n += l_separator;
  825|       |
  826|  1.26k|                if (n >= SIZE_MAX - l) {
  ------------------
  |  Branch (826:21): [True: 0, False: 1.26k]
  ------------------
  827|      0|                        va_end(ap);
  828|      0|                        return NULL;
  829|      0|                }
  830|       |
  831|  1.26k|                l += n;
  832|  1.26k|                need_separator = true;
  833|  1.26k|        }
  834|    610|        va_end(ap);
  835|       |
  836|    610|        need_separator = !isempty(*x);
  837|       |
  838|    610|        nr = realloc(*x, GREEDY_ALLOC_ROUND_UP(l+1));
  839|    610|        if (!nr)
  ------------------
  |  Branch (839:13): [True: 0, False: 610]
  ------------------
  840|      0|                return NULL;
  841|       |
  842|    610|        *x = nr;
  843|    610|        p = nr + f;
  844|       |
  845|    610|        va_start(ap, separator);
  846|  1.87k|        for (;;) {
  847|  1.87k|                const char *t;
  848|       |
  849|  1.87k|                t = va_arg(ap, const char *);
  850|  1.87k|                if (!t)
  ------------------
  |  Branch (850:21): [True: 610, False: 1.26k]
  ------------------
  851|    610|                        break;
  852|  1.26k|                if (t == POINTER_MAX)
  ------------------
  |  |  159|  1.26k|#define POINTER_MAX ((void*) UINTPTR_MAX)
  ------------------
  |  Branch (852:21): [True: 0, False: 1.26k]
  ------------------
  853|      0|                        continue;
  854|       |
  855|  1.26k|                if (need_separator && separator)
  ------------------
  |  Branch (855:21): [True: 650, False: 610]
  |  Branch (855:39): [True: 0, False: 650]
  ------------------
  856|      0|                        p = stpcpy(p, separator);
  857|       |
  858|  1.26k|                p = stpcpy(p, t);
  859|       |
  860|  1.26k|                need_separator = true;
  861|  1.26k|        }
  862|    610|        va_end(ap);
  863|       |
  864|    610|        assert(p == nr + l);
  ------------------
  |  |   72|    610|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    610|        do {                                                            \
  |  |  |  |   59|    610|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    610|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 610]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    610|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    610|        } while (false)
  |  |  ------------------
  ------------------
  865|    610|        *p = 0;
  866|       |
  867|       |        /* If no buffer to extend was passed in return the start of the buffer */
  868|    610|        if (buffer)
  ------------------
  |  Branch (868:13): [True: 610, False: 0]
  ------------------
  869|    610|                return TAKE_PTR(buffer);
  ------------------
  |  |  388|    610|#define TAKE_PTR(ptr) TAKE_PTR_TYPE(ptr, typeof(ptr))
  |  |  ------------------
  |  |  |  |  387|    610|#define TAKE_PTR_TYPE(ptr, type) TAKE_GENERIC(ptr, type, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|    610|        ({                                                       \
  |  |  |  |  |  |  381|    610|                type *_pvar_ = &(var);                           \
  |  |  |  |  |  |  382|    610|                type _var_ = *_pvar_;                            \
  |  |  |  |  |  |  383|    610|                type _nullvalue_ = nullvalue;                    \
  |  |  |  |  |  |  384|    610|                *_pvar_ = _nullvalue_;                           \
  |  |  |  |  |  |  385|    610|                _var_;                                           \
  |  |  |  |  |  |  386|    610|        })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  870|       |
  871|       |        /* Otherwise we extended the buffer: return the end */
  872|      0|        return p;
  873|    610|}

syslog_parse_priority:
   15|    570|int syslog_parse_priority(const char **p, int *priority, bool with_facility) {
   16|    570|        int a = 0, b = 0, c = 0;
   17|    570|        const char *end;
   18|    570|        size_t k;
   19|       |
   20|    570|        assert(p);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   21|    570|        assert(*p);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   22|    570|        assert(priority);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   23|       |
   24|    570|        if ((*p)[0] != '<')
  ------------------
  |  Branch (24:13): [True: 357, False: 213]
  ------------------
   25|    357|                return 0;
   26|       |
   27|    213|        end = strchr(*p, '>');
   28|    213|        if (!end)
  ------------------
  |  Branch (28:13): [True: 10, False: 203]
  ------------------
   29|     10|                return 0;
   30|       |
   31|    203|        k = end - *p;
   32|    203|        assert(k > 0);
  ------------------
  |  |   72|    203|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    203|        do {                                                            \
  |  |  |  |   59|    203|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    203|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 203]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    203|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    203|        } while (false)
  |  |  ------------------
  ------------------
   33|       |
   34|    203|        if (k == 2)
  ------------------
  |  Branch (34:13): [True: 95, False: 108]
  ------------------
   35|     95|                c = undecchar((*p)[1]);
   36|    108|        else if (k == 3) {
  ------------------
  |  Branch (36:18): [True: 7, False: 101]
  ------------------
   37|      7|                b = undecchar((*p)[1]);
   38|      7|                c = undecchar((*p)[2]);
   39|    101|        } else if (k == 4) {
  ------------------
  |  Branch (39:20): [True: 7, False: 94]
  ------------------
   40|      7|                a = undecchar((*p)[1]);
   41|      7|                b = undecchar((*p)[2]);
   42|      7|                c = undecchar((*p)[3]);
   43|      7|        } else
   44|     94|                return 0;
   45|       |
   46|    109|        if (a < 0 || b < 0 || c < 0 ||
  ------------------
  |  Branch (46:13): [True: 2, False: 107]
  |  Branch (46:22): [True: 2, False: 105]
  |  Branch (46:31): [True: 15, False: 90]
  ------------------
   47|    109|            (!with_facility && (a || b || c > 7)))
  ------------------
  |  Branch (47:14): [True: 0, False: 90]
  |  Branch (47:33): [True: 0, False: 0]
  |  Branch (47:38): [True: 0, False: 0]
  |  Branch (47:43): [True: 0, False: 0]
  ------------------
   48|     19|                return 0;
   49|       |
   50|     90|        if (with_facility)
  ------------------
  |  Branch (50:13): [True: 90, False: 0]
  ------------------
   51|     90|                *priority = a*100 + b*10 + c;
   52|      0|        else
   53|      0|                *priority = (*priority & LOG_FACMASK) | c;
   54|       |
   55|     90|        *p += k + 1;
   56|     90|        return 1;
   57|    109|}
log_level_is_valid:
  101|    570|bool log_level_is_valid(int level) {
  102|    570|        return level >= 0 && level <= LOG_DEBUG;
  ------------------
  |  Branch (102:16): [True: 570, False: 0]
  |  Branch (102:30): [True: 570, False: 0]
  ------------------
  103|    570|}

getttyname_malloc:
 1455|     81|int getttyname_malloc(int fd, char **ret) {
 1456|     81|        char path[PATH_MAX]; /* PATH_MAX is counted *with* the trailing NUL byte */
 1457|     81|        int r;
 1458|       |
 1459|     81|        assert(fd >= 0);
  ------------------
  |  |   72|     81|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     81|        do {                                                            \
  |  |  |  |   59|     81|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     81|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     81|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     81|        } while (false)
  |  |  ------------------
  ------------------
 1460|     81|        assert(ret);
  ------------------
  |  |   72|     81|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     81|        do {                                                            \
  |  |  |  |   59|     81|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     81|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     81|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     81|        } while (false)
  |  |  ------------------
  ------------------
 1461|       |
 1462|     81|        r = ttyname_r(fd, path, sizeof path); /* positive error */
 1463|     81|        assert(r >= 0);
  ------------------
  |  |   72|     81|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     81|        do {                                                            \
  |  |  |  |   59|     81|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     81|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     81|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     81|        } while (false)
  |  |  ------------------
  ------------------
 1464|     81|        if (r == ERANGE)
  ------------------
  |  Branch (1464:13): [True: 0, False: 81]
  ------------------
 1465|      0|                return -ENAMETOOLONG;
 1466|     81|        if (r > 0)
  ------------------
  |  Branch (1466:13): [True: 81, False: 0]
  ------------------
 1467|     81|                return -r;
 1468|       |
 1469|      0|        return strdup_to(ret, skip_dev_prefix(path));
 1470|     81|}
getttyname_harder:
 1472|     81|int getttyname_harder(int fd, char **ret) {
 1473|     81|        _cleanup_free_ char *s = NULL;
  ------------------
  |  |   82|     81|#define _cleanup_free_ _cleanup_(freep)
  |  |  ------------------
  |  |  |  |   78|     81|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
 1474|     81|        int r;
 1475|       |
 1476|     81|        r = getttyname_malloc(fd, &s);
 1477|     81|        if (r < 0)
  ------------------
  |  Branch (1477:13): [True: 81, False: 0]
  ------------------
 1478|     81|                return r;
 1479|       |
 1480|      0|        if (streq(s, "tty"))
  ------------------
  |  |   46|      0|#define streq(a,b) (strcmp((a),(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (46:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1481|      0|                return get_ctty(0, NULL, ret);
 1482|       |
 1483|      0|        *ret = TAKE_PTR(s);
  ------------------
  |  |  388|      0|#define TAKE_PTR(ptr) TAKE_PTR_TYPE(ptr, typeof(ptr))
  |  |  ------------------
  |  |  |  |  387|      0|#define TAKE_PTR_TYPE(ptr, type) TAKE_GENERIC(ptr, type, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|        ({                                                       \
  |  |  |  |  |  |  381|      0|                type *_pvar_ = &(var);                           \
  |  |  |  |  |  |  382|      0|                type _var_ = *_pvar_;                            \
  |  |  |  |  |  |  383|      0|                type _nullvalue_ = nullvalue;                    \
  |  |  |  |  |  |  384|      0|                *_pvar_ = _nullvalue_;                           \
  |  |  |  |  |  |  385|      0|                _var_;                                           \
  |  |  |  |  |  |  386|      0|        })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1484|      0|        return 0;
 1485|      0|}

now:
   47|    651|usec_t now(clockid_t clock_id) {
   48|    651|        struct timespec ts;
   49|       |
   50|    651|        assert_se(clock_gettime(map_clock_id(clock_id), &ts) == 0);
  ------------------
  |  |   65|    651|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    651|        do {                                                            \
  |  |  |  |   59|    651|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    651|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 651]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    651|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    651|        } while (false)
  |  |  ------------------
  ------------------
   51|       |
   52|    651|        return timespec_load(&ts);
   53|    651|}
timespec_load:
  224|    651|usec_t timespec_load(const struct timespec *ts) {
  225|    651|        assert(ts);
  ------------------
  |  |   72|    651|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    651|        do {                                                            \
  |  |  |  |   59|    651|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    651|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 651]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    651|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    651|        } while (false)
  |  |  ------------------
  ------------------
  226|       |
  227|    651|        if (ts->tv_sec < 0 || ts->tv_nsec < 0)
  ------------------
  |  Branch (227:13): [True: 0, False: 651]
  |  Branch (227:31): [True: 0, False: 651]
  ------------------
  228|      0|                return USEC_INFINITY;
  ------------------
  |  |   35|      0|#define USEC_INFINITY ((usec_t) UINT64_MAX)
  ------------------
  229|       |
  230|    651|        if ((usec_t) ts->tv_sec > (UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / USEC_PER_SEC)
  ------------------
  |  |   43|    651|#define NSEC_PER_USEC ((nsec_t) 1000ULL)
  ------------------
                      if ((usec_t) ts->tv_sec > (UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / USEC_PER_SEC)
  ------------------
  |  |   39|    651|#define USEC_PER_SEC  ((usec_t) 1000000ULL)
  ------------------
  |  Branch (230:13): [True: 0, False: 651]
  ------------------
  231|      0|                return USEC_INFINITY;
  ------------------
  |  |   35|      0|#define USEC_INFINITY ((usec_t) UINT64_MAX)
  ------------------
  232|       |
  233|    651|        return
  234|    651|                (usec_t) ts->tv_sec * USEC_PER_SEC +
  ------------------
  |  |   39|    651|#define USEC_PER_SEC  ((usec_t) 1000000ULL)
  ------------------
  235|    651|                (usec_t) ts->tv_nsec / NSEC_PER_USEC;
  ------------------
  |  |   43|    651|#define NSEC_PER_USEC ((nsec_t) 1000ULL)
  ------------------
  236|    651|}
format_timestamp_style:
  315|     81|                TimestampStyle style) {
  316|       |
  317|       |        /* The weekdays in non-localized (English) form. We use this instead of the localized form, so that
  318|       |         * our generated timestamps may be parsed with parse_timestamp(), and always read the same. */
  319|     81|        static const char * const weekdays[] = {
  320|     81|                [0] = "Sun",
  321|     81|                [1] = "Mon",
  322|     81|                [2] = "Tue",
  323|     81|                [3] = "Wed",
  324|     81|                [4] = "Thu",
  325|     81|                [5] = "Fri",
  326|     81|                [6] = "Sat",
  327|     81|        };
  328|       |
  329|     81|        struct tm tm;
  330|     81|        bool utc, us;
  331|     81|        size_t n;
  332|       |
  333|     81|        assert(buf);
  ------------------
  |  |   72|     81|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     81|        do {                                                            \
  |  |  |  |   59|     81|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     81|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     81|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     81|        } while (false)
  |  |  ------------------
  ------------------
  334|     81|        assert(style >= 0);
  ------------------
  |  |   72|     81|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     81|        do {                                                            \
  |  |  |  |   59|     81|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     81|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     81|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     81|        } while (false)
  |  |  ------------------
  ------------------
  335|     81|        assert(style < _TIMESTAMP_STYLE_MAX);
  ------------------
  |  |   72|     81|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     81|        do {                                                            \
  |  |  |  |   59|     81|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     81|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     81|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     81|        } while (false)
  |  |  ------------------
  ------------------
  336|       |
  337|     81|        if (!timestamp_is_set(t))
  ------------------
  |  Branch (337:13): [True: 0, False: 81]
  ------------------
  338|      0|                return NULL; /* Timestamp is unset */
  339|       |
  340|     81|        if (style == TIMESTAMP_UNIX) {
  ------------------
  |  Branch (340:13): [True: 0, False: 81]
  ------------------
  341|      0|                if (l < (size_t) (1 + 1 + 1))
  ------------------
  |  Branch (341:21): [True: 0, False: 0]
  ------------------
  342|      0|                        return NULL; /* not enough space for even the shortest of forms */
  343|       |
  344|      0|                return snprintf_ok(buf, l, "@" USEC_FMT, t / USEC_PER_SEC);  /* round down μs → s */
  ------------------
  |  |   11|      0|#define USEC_FMT "%" PRI_USEC
  |  |  ------------------
  |  |  |  |    9|      0|#define PRI_USEC PRIu64
  |  |  ------------------
  ------------------
                              return snprintf_ok(buf, l, "@" USEC_FMT, t / USEC_PER_SEC);  /* round down μs → s */
  ------------------
  |  |   39|      0|#define USEC_PER_SEC  ((usec_t) 1000000ULL)
  ------------------
  345|      0|        }
  346|       |
  347|     81|        utc = IN_SET(style, TIMESTAMP_UTC, TIMESTAMP_US_UTC, TIMESTAMP_DATE);
  ------------------
  |  |  361|     81|        ({                                                              \
  |  |  362|     81|                bool _found = false;                                    \
  |  |  363|     81|                /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
  |  |  364|     81|                 * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
  |  |  365|     81|                static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
  |  |  366|     81|                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
  |  |  ------------------
  |  |  |  |  142|     81|#define assert_cc(expr) _Static_assert(expr, #expr)
  |  |  ------------------
  |  |  367|     81|                switch (x) {                                            \
  |  |  368|      0|                FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
  |  |  ------------------
  |  |  |  |  356|      0|        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  335|      0|#define  CASE_F_3(X, ...) case X:  CASE_F_2( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  334|      0|#define  CASE_F_2(X, ...) case X:  CASE_F_1( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  333|      0|#define  CASE_F_1(X)      case X:
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (333:27): [True: 0, False: 81]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (334:27): [True: 0, False: 81]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (335:27): [True: 0, False: 81]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  358|      0|                   (__VA_ARGS__)
  |  |  ------------------
  |  |  369|      0|                        _found = true;                                  \
  |  |  370|      0|                        break;                                          \
  |  |  371|     81|                default:                                                \
  |  |  ------------------
  |  |  |  Branch (371:17): [True: 81, False: 0]
  |  |  ------------------
  |  |  372|     81|                        ;                                               \
  |  |  373|     81|                }                                                       \
  |  |  374|     81|                _found;                                                 \
  |  |  375|     81|        })
  ------------------
  348|     81|        us = IN_SET(style, TIMESTAMP_US, TIMESTAMP_US_UTC);
  ------------------
  |  |  361|     81|        ({                                                              \
  |  |  362|     81|                bool _found = false;                                    \
  |  |  363|     81|                /* If the build breaks in the line below, you need to extend the case macros. We use typeof(+x) \
  |  |  364|     81|                 * here to widen the type of x if it is a bit-field as this would otherwise be illegal. */      \
  |  |  365|     81|                static const typeof(+x) __assert_in_set[] _unused_ = { first, __VA_ARGS__ }; \
  |  |  366|     81|                assert_cc(ELEMENTSOF(__assert_in_set) <= 20);           \
  |  |  ------------------
  |  |  |  |  142|     81|#define assert_cc(expr) _Static_assert(expr, #expr)
  |  |  ------------------
  |  |  367|     81|                switch (x) {                                            \
  |  |  368|      0|                FOR_EACH_MAKE_CASE(first, __VA_ARGS__)                  \
  |  |  ------------------
  |  |  |  |  356|      0|        GET_CASE_F(__VA_ARGS__,CASE_F_20,CASE_F_19,CASE_F_18,CASE_F_17,CASE_F_16,CASE_F_15,CASE_F_14,CASE_F_13,CASE_F_12,CASE_F_11, \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define GET_CASE_F(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,NAME,...) NAME
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  334|      0|#define  CASE_F_2(X, ...) case X:  CASE_F_1( __VA_ARGS__)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  333|      0|#define  CASE_F_1(X)      case X:
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (333:27): [True: 0, False: 81]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (334:27): [True: 0, False: 81]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  357|      0|                               CASE_F_10,CASE_F_9,CASE_F_8,CASE_F_7,CASE_F_6,CASE_F_5,CASE_F_4,CASE_F_3,CASE_F_2,CASE_F_1) \
  |  |  |  |  358|      0|                   (__VA_ARGS__)
  |  |  ------------------
  |  |  369|      0|                        _found = true;                                  \
  |  |  370|      0|                        break;                                          \
  |  |  371|     81|                default:                                                \
  |  |  ------------------
  |  |  |  Branch (371:17): [True: 81, False: 0]
  |  |  ------------------
  |  |  372|     81|                        ;                                               \
  |  |  373|     81|                }                                                       \
  |  |  374|     81|                _found;                                                 \
  |  |  375|     81|        })
  ------------------
  349|       |
  350|     81|        if (l < (size_t) (3 +                   /* week day */
  ------------------
  |  Branch (350:13): [True: 0, False: 81]
  |  Branch (350:27): [True: 0, False: 81]
  ------------------
  351|     81|                          1 + 10 +              /* space and date */
  352|     81|                          style == TIMESTAMP_DATE ? 0 :
  353|     81|                          (1 + 8 +              /* space and time */
  354|     81|                           (us ? 1 + 6 : 0) +   /* "." and microsecond part */
  ------------------
  |  Branch (354:29): [True: 0, False: 81]
  ------------------
  355|     81|                           1 + (utc ? 3 : 1)) + /* space and shortest possible zone */
  ------------------
  |  Branch (355:33): [True: 0, False: 81]
  ------------------
  356|     81|                          1))
  357|      0|                return NULL; /* Not enough space even for the shortest form. */
  358|       |
  359|       |        /* Let's not format times with years > 9999 */
  360|     81|        if (t > USEC_TIMESTAMP_FORMATTABLE_MAX) {
  ------------------
  |  |  229|     81|#  define USEC_TIMESTAMP_FORMATTABLE_MAX USEC_TIMESTAMP_FORMATTABLE_MAX_64BIT
  |  |  ------------------
  |  |  |  |  223|     81|#define USEC_TIMESTAMP_FORMATTABLE_MAX_64BIT ((usec_t) 253402214399000000) /* Thu 9999-12-30 23:59:59 UTC */
  |  |  ------------------
  ------------------
  |  Branch (360:13): [True: 0, False: 81]
  ------------------
  361|      0|                static const char* const xxx[_TIMESTAMP_STYLE_MAX] = {
  362|      0|                        [TIMESTAMP_PRETTY] = "--- XXXX-XX-XX XX:XX:XX",
  363|      0|                        [TIMESTAMP_US]     = "--- XXXX-XX-XX XX:XX:XX.XXXXXX",
  364|      0|                        [TIMESTAMP_UTC]    = "--- XXXX-XX-XX XX:XX:XX UTC",
  365|      0|                        [TIMESTAMP_US_UTC] = "--- XXXX-XX-XX XX:XX:XX.XXXXXX UTC",
  366|      0|                        [TIMESTAMP_DATE]   = "--- XXXX-XX-XX",
  367|      0|                };
  368|       |
  369|      0|                assert(l >= strlen(xxx[style]) + 1);
  ------------------
  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
  370|      0|                return strcpy(buf, xxx[style]);
  371|      0|        }
  372|       |
  373|     81|        if (localtime_or_gmtime_usec(t, utc, &tm) < 0)
  ------------------
  |  Branch (373:13): [True: 0, False: 81]
  ------------------
  374|      0|                return NULL;
  375|       |
  376|       |        /* Start with the week day */
  377|     81|        assert((size_t) tm.tm_wday < ELEMENTSOF(weekdays));
  ------------------
  |  |   72|     81|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     81|        do {                                                            \
  |  |  |  |   59|     81|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     81|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     81|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     81|        } while (false)
  |  |  ------------------
  ------------------
  378|     81|        memcpy(buf, weekdays[tm.tm_wday], 4);
  379|       |
  380|     81|        if (style == TIMESTAMP_DATE) {
  ------------------
  |  Branch (380:13): [True: 0, False: 81]
  ------------------
  381|       |                /* Special format string if only date should be shown. */
  382|      0|                if (strftime(buf + 3, l - 3, " %Y-%m-%d", &tm) <= 0)
  ------------------
  |  Branch (382:21): [True: 0, False: 0]
  ------------------
  383|      0|                        return NULL; /* Doesn't fit */
  384|       |
  385|      0|                return buf;
  386|      0|        }
  387|       |
  388|       |        /* Add the main components */
  389|     81|        if (strftime(buf + 3, l - 3, " %Y-%m-%d %H:%M:%S", &tm) <= 0)
  ------------------
  |  Branch (389:13): [True: 0, False: 81]
  ------------------
  390|      0|                return NULL; /* Doesn't fit */
  391|       |
  392|       |        /* Append the microseconds part, if that's requested */
  393|     81|        if (us) {
  ------------------
  |  Branch (393:13): [True: 0, False: 81]
  ------------------
  394|      0|                n = strlen(buf);
  395|      0|                if (n + 8 > l)
  ------------------
  |  Branch (395:21): [True: 0, False: 0]
  ------------------
  396|      0|                        return NULL; /* Microseconds part doesn't fit. */
  397|       |
  398|      0|                sprintf(buf + n, ".%06"PRI_USEC, t % USEC_PER_SEC);
  ------------------
  |  |    9|      0|#define PRI_USEC PRIu64
  ------------------
                              sprintf(buf + n, ".%06"PRI_USEC, t % USEC_PER_SEC);
  ------------------
  |  |   39|      0|#define USEC_PER_SEC  ((usec_t) 1000000ULL)
  ------------------
  399|      0|        }
  400|       |
  401|       |        /* Append the timezone */
  402|     81|        n = strlen(buf);
  403|     81|        if (utc) {
  ------------------
  |  Branch (403:13): [True: 0, False: 81]
  ------------------
  404|       |                /* If this is UTC then let's explicitly use the "UTC" string here, because gmtime_r()
  405|       |                 * normally uses the obsolete "GMT" instead. */
  406|      0|                if (n + 5 > l)
  ------------------
  |  Branch (406:21): [True: 0, False: 0]
  ------------------
  407|      0|                        return NULL; /* "UTC" doesn't fit. */
  408|       |
  409|      0|                strcpy(buf + n, " UTC");
  410|       |
  411|     81|        } else if (!isempty(tm.tm_zone)) {
  ------------------
  |  Branch (411:20): [True: 81, False: 0]
  ------------------
  412|     81|                size_t tn;
  413|       |
  414|       |                /* An explicit timezone is specified, let's use it, if it fits */
  415|     81|                tn = strlen(tm.tm_zone);
  416|     81|                if (n + 1 + tn + 1 > l) {
  ------------------
  |  Branch (416:21): [True: 0, False: 81]
  ------------------
  417|       |                        /* The full time zone does not fit in. Yuck. */
  418|       |
  419|      0|                        if (n + 1 + _POSIX_TZNAME_MAX + 1 > l)
  ------------------
  |  Branch (419:29): [True: 0, False: 0]
  ------------------
  420|      0|                                return NULL; /* Not even enough space for the POSIX minimum (of 6)? In that
  421|       |                                              * case, complain that it doesn't fit. */
  422|       |
  423|       |                        /* So the time zone doesn't fit in fully, but the caller passed enough space for the
  424|       |                         * POSIX minimum time zone length. In this case suppress the timezone entirely, in
  425|       |                         * order not to dump an overly long, hard to read string on the user. This should be
  426|       |                         * safe, because the user will assume the local timezone anyway if none is shown. And
  427|       |                         * so does parse_timestamp(). */
  428|     81|                } else {
  429|     81|                        buf[n++] = ' ';
  430|     81|                        strcpy(buf + n, tm.tm_zone);
  431|     81|                }
  432|     81|        }
  433|       |
  434|     81|        return buf;
  435|     81|}
localtime_or_gmtime_usec:
 1659|     81|                struct tm *ret) {
 1660|       |
 1661|     81|        t /= USEC_PER_SEC; /* Round down */
  ------------------
  |  |   39|     81|#define USEC_PER_SEC  ((usec_t) 1000000ULL)
  ------------------
 1662|     81|        if (t > (usec_t) TIME_T_MAX)
  ------------------
  |  |   64|     81|#define TIME_T_MAX (time_t)((UINTMAX_C(1) << ((sizeof(time_t) << 3) - 1)) - 1)
  ------------------
  |  Branch (1662:13): [True: 0, False: 81]
  ------------------
 1663|      0|                return -ERANGE;
 1664|     81|        time_t sec = (time_t) t;
 1665|       |
 1666|     81|        struct tm buf = {};
 1667|     81|        if (!(utc ? gmtime_r(&sec, &buf) : localtime_r(&sec, &buf)))
  ------------------
  |  Branch (1667:13): [True: 0, False: 81]
  |  Branch (1667:15): [True: 0, False: 81]
  ------------------
 1668|      0|                return -EINVAL;
 1669|       |
 1670|     81|        if (ret)
  ------------------
  |  Branch (1670:13): [True: 81, False: 0]
  ------------------
 1671|     81|                *ret = buf;
 1672|       |
 1673|     81|        return 0;
 1674|     81|}
time-util.c:map_clock_id:
   27|    651|static clockid_t map_clock_id(clockid_t c) {
   28|       |
   29|       |        /* Some more exotic archs (s390, ppc, …) lack the "ALARM" flavour of the clocks. Thus,
   30|       |         * clock_gettime() will fail for them. Since they are essentially the same as their non-ALARM
   31|       |         * pendants (their only difference is when timers are set on them), let's just map them
   32|       |         * accordingly. This way, we can get the correct time even on those archs. */
   33|       |
   34|    651|        switch (c) {
   35|       |
   36|      0|        case CLOCK_BOOTTIME_ALARM:
  ------------------
  |  Branch (36:9): [True: 0, False: 651]
  ------------------
   37|      0|                return CLOCK_BOOTTIME;
   38|       |
   39|      0|        case CLOCK_REALTIME_ALARM:
  ------------------
  |  Branch (39:9): [True: 0, False: 651]
  ------------------
   40|      0|                return CLOCK_REALTIME;
   41|       |
   42|    651|        default:
  ------------------
  |  Branch (42:9): [True: 651, False: 0]
  ------------------
   43|    651|                return c;
   44|    651|        }
   45|    651|}

wall.c:format_timestamp:
  136|     81|static inline char* format_timestamp(char *buf, size_t l, usec_t t) {
  137|     81|        return format_timestamp_style(buf, l, t, TIMESTAMP_PRETTY);
  138|     81|}
time-util.c:timestamp_is_set:
   93|     81|static inline bool timestamp_is_set(usec_t timestamp) {
   94|     81|        return timestamp > 0 && timestamp != USEC_INFINITY;
  ------------------
  |  |   35|    162|#define USEC_INFINITY ((usec_t) UINT64_MAX)
  ------------------
  |  Branch (94:16): [True: 81, False: 0]
  |  Branch (94:33): [True: 81, False: 0]
  ------------------
   95|     81|}

journald-manager.c:manager_freep:
   15|    570|        static inline void func##p(type *p) {           \
   16|    570|                if (*p)                                 \
  ------------------
  |  Branch (16:21): [True: 0, False: 570]
  ------------------
   17|    570|                        *p = func(*p);                  \
   18|    570|        }
fuzz-journald.c:manager_freep:
   15|    570|        static inline void func##p(type *p) {           \
   16|    570|                if (*p)                                 \
  ------------------
  |  Branch (16:21): [True: 570, False: 0]
  ------------------
   17|    570|                        *p = func(*p);                  \
   18|    570|        }

journald-syslog.c:ascii_isdigit:
  123|    778|static inline bool ascii_isdigit(sd_char a) {
  124|       |        /* A pure ASCII, locale independent version of isdigit() */
  125|    778|        return a >= '0' && a <= '9';
  ------------------
  |  Branch (125:16): [True: 762, False: 16]
  |  Branch (125:28): [True: 753, False: 9]
  ------------------
  126|    778|}
journald-syslog.c:ascii_isalpha:
  132|    889|static inline bool ascii_isalpha(sd_char a) {
  133|       |        /* A pure ASCII, locale independent version of isalpha() */
  134|    889|        return (a >= 'a' && a <= 'z') || (a >= 'A' && a <= 'Z');
  ------------------
  |  Branch (134:17): [True: 225, False: 664]
  |  Branch (134:29): [True: 222, False: 3]
  |  Branch (134:43): [True: 393, False: 274]
  |  Branch (134:55): [True: 314, False: 79]
  ------------------
  135|    889|}
hostname-setup.c:isempty:
   85|     81|static inline bool isempty(const sd_char *a) {
   86|     81|        return !a || a[0] == '\0';
  ------------------
  |  Branch (86:16): [True: 0, False: 81]
  |  Branch (86:22): [True: 0, False: 81]
  ------------------
   87|     81|}
wall.c:strempty:
   89|     81|static inline const sd_char *strempty(const sd_char *s) {
   90|     81|        return s ?: STR_C("");
  ------------------
  |  |   42|     81|#  define STR_C(str)       (str)
  ------------------
  |  Branch (90:16): [True: 0, False: 81]
  ------------------
   91|     81|}
iovec-util.c:strlen_ptr:
   73|  2.61k|static inline size_t strlen_ptr(const sd_char *s) {
   74|  2.61k|        if (!s)
  ------------------
  |  Branch (74:13): [True: 0, False: 2.61k]
  ------------------
   75|      0|                return 0;
   76|       |
   77|  2.61k|        return strlen(s);
   78|  2.61k|}
string-util.c:isempty:
   85|  1.22k|static inline bool isempty(const sd_char *a) {
   86|  1.22k|        return !a || a[0] == '\0';
  ------------------
  |  Branch (86:16): [True: 1.22k, False: 0]
  |  Branch (86:22): [True: 0, False: 0]
  ------------------
   87|  1.22k|}
string-util.c:strlen_ptr:
   73|  1.22k|static inline size_t strlen_ptr(const sd_char *s) {
   74|  1.22k|        if (!s)
  ------------------
  |  Branch (74:13): [True: 1.22k, False: 0]
  ------------------
   75|  1.22k|                return 0;
   76|       |
   77|      0|        return strlen(s);
   78|  1.22k|}
time-util.c:isempty:
   85|     81|static inline bool isempty(const sd_char *a) {
   86|     81|        return !a || a[0] == '\0';
  ------------------
  |  Branch (86:16): [True: 0, False: 81]
  |  Branch (86:22): [True: 0, False: 81]
  ------------------
   87|     81|}

fuzz-journald-syslog.c:fuzz_setup_logging:
   32|    570|static inline void fuzz_setup_logging(void) {
   33|       |        /* We don't want to fill the logs and slow down stuff when running
   34|       |         * in a fuzzing mode, so disable most of the logging. */
   35|    570|        log_set_assert_return_is_critical(true);
   36|    570|        log_set_max_level(LOG_CRIT);
   37|    570|        log_setup();
   38|    570|}

LLVMFuzzerTestOneInput:
    7|    570|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    8|    570|        fuzz_setup_logging();
    9|       |
   10|    570|        fuzz_journald_processing_function(data, size, manager_process_syslog_message);
   11|    570|        return 0;
   12|    570|}

dummy_manager_init:
    9|    570|void dummy_manager_init(Manager *m, const uint8_t *buffer, size_t size) {
   10|    570|        assert(m);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   11|       |
   12|    570|        m->storage = STORAGE_NONE;
   13|    570|        assert_se(sd_event_default(&m->event) >= 0);
  ------------------
  |  |   65|    570|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   14|       |
   15|    570|        if (buffer) {
  ------------------
  |  Branch (15:13): [True: 570, False: 0]
  ------------------
   16|    570|                m->buffer = memdup_suffix0(buffer, size);
   17|    570|                assert_se(m->buffer);
  ------------------
  |  |   65|    570|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   18|    570|        }
   19|    570|}
fuzz_journald_processing_function:
   25|    570|        ) {
   26|       |
   27|    570|        _cleanup_(manager_freep) Manager *m = NULL;
  ------------------
  |  |   78|    570|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  ------------------
   28|    570|        char *label = NULL;
   29|    570|        size_t label_len = 0;
   30|    570|        struct ucred *ucred = NULL;
   31|    570|        struct timeval *tv = NULL;
   32|       |
   33|    570|        if (size == 0)
  ------------------
  |  Branch (33:13): [True: 0, False: 570]
  ------------------
   34|      0|                return;
   35|       |
   36|    570|        assert_se(manager_new(&m) >= 0);
  ------------------
  |  |   65|    570|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   37|    570|        dummy_manager_init(m, data, size);
   38|    570|        (*f)(m, m->buffer, size, ucred, tv, label, label_len);
   39|    570|}

client_context_check_keep_log:
  106|    570|int client_context_check_keep_log(ClientContext *c, const char *message, size_t len) {
  107|    570|        pcre2_code *regex;
  108|       |
  109|    570|        if (!c || !message)
  ------------------
  |  Branch (109:13): [True: 570, False: 0]
  |  Branch (109:19): [True: 0, False: 0]
  ------------------
  110|    570|                return true;
  111|       |
  112|      0|        SET_FOREACH(regex, c->log_filter_denied_patterns)
  ------------------
  |  |  112|      0|        _SET_FOREACH(e, s, UNIQ_T(i, UNIQ))
  |  |  ------------------
  |  |  |  |  110|      0|        for (Iterator i = ITERATOR_FIRST; set_iterate((s), &i, (void**)&(e)); )
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|      0|#define ITERATOR_FIRST ((Iterator) { .idx = _IDX_ITERATOR_FIRST, .next_key = NULL })
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   19|      0|#define _IDX_ITERATOR_FIRST (UINT_MAX - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|      0|                if (pattern_matches_and_log(regex, message, len, NULL) > 0)
  ------------------
  |  Branch (113:21): [True: 0, False: 0]
  ------------------
  114|      0|                        return false;
  115|       |
  116|      0|        SET_FOREACH(regex, c->log_filter_allowed_patterns)
  ------------------
  |  |  112|      0|        _SET_FOREACH(e, s, UNIQ_T(i, UNIQ))
  |  |  ------------------
  |  |  |  |  110|      0|        for (Iterator i = ITERATOR_FIRST; set_iterate((s), &i, (void**)&(e)); )
  |  |  |  |  ------------------
  |  |  |  |  |  |   20|      0|#define ITERATOR_FIRST ((Iterator) { .idx = _IDX_ITERATOR_FIRST, .next_key = NULL })
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   19|      0|#define _IDX_ITERATOR_FIRST (UINT_MAX - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  117|      0|                if (pattern_matches_and_log(regex, message, len, NULL) > 0)
  ------------------
  |  Branch (117:21): [True: 0, False: 0]
  ------------------
  118|      0|                        return true;
  119|       |
  120|      0|        return set_isempty(c->log_filter_allowed_patterns);
  121|      0|}

client_context_flush_regular:
  648|    570|void client_context_flush_regular(Manager *m) {
  649|    570|        client_context_try_shrink_to(m, 0);
  650|    570|}
client_context_flush_all:
  652|    570|void client_context_flush_all(Manager *m) {
  653|    570|        assert(m);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  654|       |
  655|       |        /* Flush out all remaining entries. This assumes all references are already dropped. */
  656|       |
  657|    570|        m->my_context = client_context_release(m, m->my_context);
  658|    570|        m->pid1_context = client_context_release(m, m->pid1_context);
  659|       |
  660|    570|        client_context_flush_regular(m);
  661|       |
  662|    570|        assert(prioq_isempty(m->client_contexts_lru));
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  663|    570|        assert(hashmap_isempty(m->client_contexts));
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  664|       |
  665|    570|        m->client_contexts_lru = prioq_free(m->client_contexts_lru);
  666|    570|        m->client_contexts = hashmap_free(m->client_contexts);
  667|    570|}
client_context_release:
  753|  1.14k|ClientContext *client_context_release(Manager *m, ClientContext *c) {
  754|  1.14k|        assert(m);
  ------------------
  |  |   72|  1.14k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  1.14k|        do {                                                            \
  |  |  |  |   59|  1.14k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  1.14k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 1.14k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  1.14k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  1.14k|        } while (false)
  |  |  ------------------
  ------------------
  755|       |
  756|  1.14k|        if (!c)
  ------------------
  |  Branch (756:13): [True: 1.14k, False: 0]
  ------------------
  757|  1.14k|                return NULL;
  758|       |
  759|      0|        assert(c->n_ref > 0);
  ------------------
  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
  760|      0|        assert(!c->in_lru);
  ------------------
  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
  761|       |
  762|      0|        c->n_ref--;
  763|      0|        if (c->n_ref > 0)
  ------------------
  |  Branch (763:13): [True: 0, False: 0]
  ------------------
  764|      0|                return NULL;
  765|       |
  766|       |        /* The entry is not pinned anymore, let's add it to the LRU prioq if we can. If we can't we'll drop it
  767|       |         * right-away */
  768|       |
  769|      0|        if (prioq_put(m->client_contexts_lru, c, &c->lru_index) < 0)
  ------------------
  |  Branch (769:13): [True: 0, False: 0]
  ------------------
  770|      0|                client_context_free(m, c);
  771|      0|        else
  772|      0|                c->in_lru = true;
  773|       |
  774|      0|        return NULL;
  775|      0|}
journald-context.c:client_context_try_shrink_to:
  601|    570|static void client_context_try_shrink_to(Manager *m, size_t limit) {
  602|    570|        ClientContext *c;
  603|    570|        usec_t t;
  604|       |
  605|    570|        assert(m);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  606|       |
  607|       |        /* Flush any cache entries for PIDs that have already moved on. Don't do this
  608|       |         * too often, since it's a slow process. */
  609|    570|        t = now(CLOCK_MONOTONIC);
  610|    570|        if (m->last_cache_pid_flush + MAX_USEC < t) {
  ------------------
  |  |   70|    570|#define MAX_USEC (5*USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   39|    570|#define USEC_PER_SEC  ((usec_t) 1000000ULL)
  |  |  ------------------
  ------------------
  |  Branch (610:13): [True: 570, False: 0]
  ------------------
  611|    570|                unsigned n = prioq_size(m->client_contexts_lru), idx = 0;
  612|       |
  613|       |                /* We do a number of iterations based on the initial size of the prioq.  When we remove an
  614|       |                 * item, a new item is moved into its places, and items to the right might be reshuffled.
  615|       |                 */
  616|    570|                for (unsigned i = 0; i < n; i++) {
  ------------------
  |  Branch (616:38): [True: 0, False: 570]
  ------------------
  617|      0|                        c = prioq_peek_by_index(m->client_contexts_lru, idx);
  618|       |
  619|      0|                        assert(c->n_ref == 0);
  ------------------
  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
  620|       |
  621|      0|                        if (pid_is_unwaited(c->pid) == 0)
  ------------------
  |  Branch (621:29): [True: 0, False: 0]
  ------------------
  622|      0|                                client_context_free(m, c);
  623|      0|                        else
  624|      0|                                idx++;
  625|      0|                }
  626|       |
  627|    570|                m->last_cache_pid_flush = t;
  628|    570|        }
  629|       |
  630|       |        /* Bring the number of cache entries below the indicated limit, so that we can create a new entry without
  631|       |         * breaching the limit. Note that we only flush out entries that aren't pinned here. This means the number of
  632|       |         * cache entries may very well grow beyond the limit, if all entries stored remain pinned. */
  633|       |
  634|    570|        while (hashmap_size(m->client_contexts) > limit) {
  ------------------
  |  Branch (634:16): [True: 0, False: 570]
  ------------------
  635|      0|                c = prioq_pop(m->client_contexts_lru);
  636|      0|                if (!c)
  ------------------
  |  Branch (636:21): [True: 0, False: 0]
  ------------------
  637|      0|                        break; /* All remaining entries are pinned, give up */
  638|       |
  639|      0|                assert(c->in_lru);
  ------------------
  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
  640|      0|                assert(c->n_ref == 0);
  ------------------
  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
  641|       |
  642|      0|                c->in_lru = false;
  643|       |
  644|      0|                client_context_free(m, c);
  645|      0|        }
  646|    570|}

journald-syslog.c:client_context_test_priority:
   92|    570|static inline bool client_context_test_priority(const ClientContext *c, int priority) {
   93|    570|        if (!c)
  ------------------
  |  Branch (93:13): [True: 570, False: 0]
  ------------------
   94|    570|                return true;
   95|       |
   96|      0|        if (c->log_level_max < 0)
  ------------------
  |  Branch (96:13): [True: 0, False: 0]
  ------------------
   97|      0|                return true;
   98|       |
   99|      0|        return LOG_PRI(priority) <= c->log_level_max;
  100|      0|}
journald-syslog.c:client_context_extra_fields_n_iovec:
   88|    570|static inline size_t client_context_extra_fields_n_iovec(const ClientContext *c) {
   89|    570|        return c ? c->extra_fields_n_iovec : 0;
  ------------------
  |  Branch (89:16): [True: 0, False: 570]
  ------------------
   90|    570|}

manager_dispatch_message:
 1270|    570|                pid_t object_pid) {
 1271|       |
 1272|    570|        uint64_t available = 0;
 1273|    570|        int rl;
 1274|       |
 1275|    570|        assert(m);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
 1276|    570|        assert(iovec || n == 0);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  |  Branch (95:44): [True: 570, False: 0]
  |  |  |  |  |  |  |  Branch (95:44): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
 1277|       |
 1278|    570|        if (n == 0)
  ------------------
  |  Branch (1278:13): [True: 0, False: 570]
  ------------------
 1279|      0|                return;
 1280|       |
 1281|    570|        if (LOG_PRI(priority) > m->max_level_store)
  ------------------
  |  Branch (1281:13): [True: 0, False: 570]
  ------------------
 1282|      0|                return;
 1283|       |
 1284|       |        /* Stop early in case the information will not be stored
 1285|       |         * in a journal. */
 1286|    570|        if (m->storage == STORAGE_NONE)
  ------------------
  |  Branch (1286:13): [True: 570, False: 0]
  ------------------
 1287|    570|                return;
 1288|       |
 1289|      0|        if (c && c->unit) {
  ------------------
  |  Branch (1289:13): [True: 0, False: 0]
  |  Branch (1289:18): [True: 0, False: 0]
  ------------------
 1290|      0|                (void) manager_determine_space(m, &available, /* limit= */ NULL);
 1291|       |
 1292|      0|                rl = journal_ratelimit_test(
 1293|      0|                                &m->ratelimit_groups_by_id,
 1294|      0|                                c->unit,
 1295|      0|                                c->log_ratelimit_interval,
 1296|      0|                                c->log_ratelimit_burst,
 1297|      0|                                LOG_PRI(priority),
 1298|      0|                                available);
 1299|      0|                if (rl == 0)
  ------------------
  |  Branch (1299:21): [True: 0, False: 0]
  ------------------
 1300|      0|                        return;
 1301|       |
 1302|       |                /* Write a suppression message if we suppressed something */
 1303|      0|                if (rl > 1)
  ------------------
  |  Branch (1303:21): [True: 0, False: 0]
  ------------------
 1304|      0|                        manager_driver_message(m, c->pid,
  ------------------
  |  |  210|      0|#define manager_driver_message(...) manager_driver_message_internal(__VA_ARGS__, NULL)
  ------------------
 1305|      0|                                              LOG_MESSAGE_ID(SD_MESSAGE_JOURNAL_DROPPED_STR),
 1306|      0|                                              LOG_MESSAGE("Suppressed %i messages from %s", rl - 1, c->unit),
 1307|      0|                                              LOG_ITEM("N_DROPPED=%i", rl - 1));
 1308|      0|        }
 1309|       |
 1310|      0|        manager_dispatch_message_real(m, iovec, n, mm, c, tv, priority, object_pid);
 1311|      0|}
manager_new:
 2415|    570|int manager_new(Manager **ret) {
 2416|    570|        _cleanup_(manager_freep) Manager *m = NULL;
  ------------------
  |  |   78|    570|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  ------------------
 2417|       |
 2418|    570|        assert(ret);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
 2419|       |
 2420|    570|        m = new(Manager, 1);
  ------------------
  |  |   17|    570|#define new(t, n) ((t*) malloc_multiply(n, sizeof(t)))
  ------------------
 2421|    570|        if (!m)
  ------------------
  |  Branch (2421:13): [True: 0, False: 570]
  ------------------
 2422|      0|                return -ENOMEM;
 2423|       |
 2424|    570|        *m = (Manager) {
 2425|    570|                .syslog_fd = -EBADF,
 2426|    570|                .native_fd = -EBADF,
 2427|    570|                .stdout_fd = -EBADF,
 2428|    570|                .dev_kmsg_fd = -EBADF,
 2429|    570|                .audit_fd = -EBADF,
 2430|    570|                .hostname_fd = -EBADF,
 2431|    570|                .notify_fd = -EBADF,
 2432|    570|                .forward_socket_fd = -EBADF,
 2433|       |
 2434|    570|                .compress.enabled = true,
 2435|    570|                .compress.threshold_bytes = UINT64_MAX,
 2436|    570|                .seal = true,
 2437|       |
 2438|    570|                .set_audit = true,
 2439|       |
 2440|    570|                .watchdog_usec = USEC_INFINITY,
  ------------------
  |  |   35|    570|#define USEC_INFINITY ((usec_t) UINT64_MAX)
  ------------------
 2441|       |
 2442|    570|                .sync_interval_usec = DEFAULT_SYNC_INTERVAL_USEC,
  ------------------
  |  |   75|    570|#define DEFAULT_SYNC_INTERVAL_USEC (5*USEC_PER_MINUTE)
  |  |  ------------------
  |  |  |  |   45|    570|#define USEC_PER_MINUTE ((usec_t) (60ULL*USEC_PER_SEC))
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|    570|#define USEC_PER_SEC  ((usec_t) 1000000ULL)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2443|    570|                .sync_scheduled = false,
 2444|       |
 2445|    570|                .ratelimit_interval = DEFAULT_RATE_LIMIT_INTERVAL,
  ------------------
  |  |   76|    570|#define DEFAULT_RATE_LIMIT_INTERVAL (30*USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   39|    570|#define USEC_PER_SEC  ((usec_t) 1000000ULL)
  |  |  ------------------
  ------------------
 2446|    570|                .ratelimit_burst = DEFAULT_RATE_LIMIT_BURST,
  ------------------
  |  |   77|    570|#define DEFAULT_RATE_LIMIT_BURST 10000
  ------------------
 2447|       |
 2448|    570|                .forward_to_wall = true,
 2449|    570|                .forward_to_socket = { .sockaddr.sa.sa_family = AF_UNSPEC },
 2450|       |
 2451|    570|                .max_file_usec = DEFAULT_MAX_FILE_USEC,
  ------------------
  |  |   78|    570|#define DEFAULT_MAX_FILE_USEC USEC_PER_MONTH
  |  |  ------------------
  |  |  |  |   53|    570|#define USEC_PER_MONTH ((usec_t) (2629800ULL*USEC_PER_SEC))
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|    570|#define USEC_PER_SEC  ((usec_t) 1000000ULL)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2452|       |
 2453|    570|                .max_level_store = LOG_DEBUG,
 2454|    570|                .max_level_syslog = LOG_DEBUG,
 2455|    570|                .max_level_kmsg = LOG_NOTICE,
 2456|    570|                .max_level_console = LOG_INFO,
 2457|    570|                .max_level_wall = LOG_EMERG,
 2458|    570|                .max_level_socket = LOG_DEBUG,
 2459|       |
 2460|    570|                .line_max = DEFAULT_LINE_MAX,
  ------------------
  |  |   92|    570|#define DEFAULT_LINE_MAX (48*1024)
  ------------------
 2461|       |
 2462|    570|                .runtime_storage.name = "Runtime Journal",
 2463|    570|                .system_storage.name = "System Journal",
 2464|       |
 2465|    570|                .kmsg_own_ratelimit = {
 2466|    570|                        .interval = DEFAULT_KMSG_OWN_INTERVAL,
  ------------------
  |  |   80|    570|#define DEFAULT_KMSG_OWN_INTERVAL (5 * USEC_PER_SEC)
  |  |  ------------------
  |  |  |  |   39|    570|#define USEC_PER_SEC  ((usec_t) 1000000ULL)
  |  |  ------------------
  ------------------
 2467|    570|                        .burst = DEFAULT_KMSG_OWN_BURST,
  ------------------
  |  |   81|    570|#define DEFAULT_KMSG_OWN_BURST 50
  ------------------
 2468|    570|                },
 2469|       |
 2470|    570|                .sigrtmin18_info.memory_pressure_handler = manager_memory_pressure,
 2471|    570|                .sigrtmin18_info.memory_pressure_userdata = m,
 2472|    570|        };
 2473|       |
 2474|    570|        *ret = TAKE_PTR(m);
  ------------------
  |  |  388|    570|#define TAKE_PTR(ptr) TAKE_PTR_TYPE(ptr, typeof(ptr))
  |  |  ------------------
  |  |  |  |  387|    570|#define TAKE_PTR_TYPE(ptr, type) TAKE_GENERIC(ptr, type, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|    570|        ({                                                       \
  |  |  |  |  |  |  381|    570|                type *_pvar_ = &(var);                           \
  |  |  |  |  |  |  382|    570|                type _var_ = *_pvar_;                            \
  |  |  |  |  |  |  383|    570|                type _nullvalue_ = nullvalue;                    \
  |  |  |  |  |  |  384|    570|                *_pvar_ = _nullvalue_;                           \
  |  |  |  |  |  |  385|    570|                _var_;                                           \
  |  |  |  |  |  |  386|    570|        })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2475|    570|        return 0;
 2476|    570|}
manager_free:
 2723|    570|Manager* manager_free(Manager *m) {
 2724|    570|        if (!m)
  ------------------
  |  Branch (2724:13): [True: 0, False: 570]
  ------------------
 2725|      0|                return NULL;
 2726|       |
 2727|    570|        free(m->namespace);
 2728|    570|        free(m->namespace_field);
 2729|       |
 2730|    570|        set_free(m->deferred_closes);
 2731|       |
 2732|    570|        while (m->stdout_streams)
  ------------------
  |  Branch (2732:16): [True: 0, False: 570]
  ------------------
 2733|      0|                stdout_stream_free(m->stdout_streams);
 2734|       |
 2735|    570|        client_context_flush_all(m);
 2736|       |
 2737|    570|        (void) journal_file_offline_close(m->system_journal);
 2738|    570|        (void) journal_file_offline_close(m->runtime_journal);
 2739|       |
 2740|    570|        ordered_hashmap_free(m->user_journals);
 2741|       |
 2742|    570|        sd_varlink_server_unref(m->varlink_server);
 2743|       |
 2744|    570|        sd_event_source_unref(m->syslog_event_source);
 2745|    570|        sd_event_source_unref(m->native_event_source);
 2746|    570|        sd_event_source_unref(m->stdout_event_source);
 2747|    570|        sd_event_source_unref(m->dev_kmsg_event_source);
 2748|    570|        sd_event_source_unref(m->audit_event_source);
 2749|    570|        sd_event_source_unref(m->sync_event_source);
 2750|    570|        sd_event_source_unref(m->sigusr1_event_source);
 2751|    570|        sd_event_source_unref(m->sigusr2_event_source);
 2752|    570|        sd_event_source_unref(m->sigterm_event_source);
 2753|    570|        sd_event_source_unref(m->sigint_event_source);
 2754|    570|        sd_event_source_unref(m->sigrtmin1_event_source);
 2755|    570|        sd_event_source_unref(m->hostname_event_source);
 2756|    570|        sd_event_source_unref(m->notify_event_source);
 2757|    570|        sd_event_source_unref(m->watchdog_event_source);
 2758|    570|        sd_event_source_unref(m->idle_event_source);
 2759|    570|        sd_event_unref(m->event);
 2760|       |
 2761|    570|        safe_close(m->syslog_fd);
 2762|    570|        safe_close(m->native_fd);
 2763|    570|        safe_close(m->stdout_fd);
 2764|    570|        safe_close(m->dev_kmsg_fd);
 2765|    570|        safe_close(m->audit_fd);
 2766|    570|        safe_close(m->hostname_fd);
 2767|    570|        safe_close(m->notify_fd);
 2768|    570|        safe_close(m->forward_socket_fd);
 2769|       |
 2770|    570|        ordered_hashmap_free(m->ratelimit_groups_by_id);
 2771|       |
 2772|    570|        manager_unmap_seqnum_file(m->seqnum, sizeof(*m->seqnum));
 2773|    570|        manager_unmap_seqnum_file(m->kernel_seqnum, sizeof(*m->kernel_seqnum));
 2774|       |
 2775|    570|        free(m->buffer);
 2776|    570|        free(m->tty_path);
 2777|    570|        free(m->cgroup_root);
 2778|    570|        free(m->hostname_field);
 2779|    570|        free(m->runtime_storage.path);
 2780|    570|        free(m->system_storage.path);
 2781|    570|        free(m->runtime_directory);
 2782|       |
 2783|    570|        mmap_cache_unref(m->mmap);
 2784|       |
 2785|    570|        SyncReq *req;
 2786|    570|        while ((req = prioq_peek(m->sync_req_realtime_prioq)))
  ------------------
  |  Branch (2786:16): [True: 0, False: 570]
  ------------------
 2787|      0|                sync_req_free(req);
 2788|    570|        prioq_free(m->sync_req_realtime_prioq);
 2789|       |
 2790|    570|        while ((req = prioq_peek(m->sync_req_boottime_prioq)))
  ------------------
  |  Branch (2790:16): [True: 0, False: 570]
  ------------------
 2791|      0|                sync_req_free(req);
 2792|    570|        prioq_free(m->sync_req_boottime_prioq);
 2793|       |
 2794|    570|        return mfree(m);
  ------------------
  |  |  404|    570|        ({                                      \
  |  |  405|    570|                free(memory);                   \
  |  |  406|    570|                (typeof(memory)) NULL;          \
  |  |  407|    570|        })
  ------------------
 2795|    570|}
journald-manager.c:manager_unmap_seqnum_file:
 2244|  1.14k|static void manager_unmap_seqnum_file(void *p, size_t size) {
 2245|  1.14k|        assert(size > 0);
  ------------------
  |  |   72|  1.14k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  1.14k|        do {                                                            \
  |  |  |  |   59|  1.14k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  1.14k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 1.14k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  1.14k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  1.14k|        } while (false)
  |  |  ------------------
  ------------------
 2246|       |
 2247|  1.14k|        if (!p)
  ------------------
  |  Branch (2247:13): [True: 1.14k, False: 0]
  ------------------
 2248|  1.14k|                return;
 2249|       |
 2250|      0|        assert_se(munmap(p, size) >= 0);
  ------------------
  |  |   65|      0|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
 2251|      0|}

syslog_parse_identifier:
  203|    570|size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid) {
  204|    570|        const char *p;
  205|    570|        char *t;
  206|    570|        size_t l, e;
  207|       |
  208|    570|        assert(buf);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  209|    570|        assert(identifier);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  210|    570|        assert(pid);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  211|       |
  212|    570|        p = *buf;
  213|       |
  214|    570|        p += strspn(p, WHITESPACE);
  ------------------
  |  |   15|    570|#define WHITESPACE          " \t\n\r"
  ------------------
  215|    570|        l = strcspn(p, WHITESPACE);
  ------------------
  |  |   15|    570|#define WHITESPACE          " \t\n\r"
  ------------------
  216|       |
  217|    570|        if (l <= 0 ||
  ------------------
  |  Branch (217:13): [True: 33, False: 537]
  ------------------
  218|    570|            p[l-1] != ':')
  ------------------
  |  Branch (218:13): [True: 306, False: 231]
  ------------------
  219|    339|                return 0;
  220|       |
  221|    231|        e = l;
  222|    231|        l--;
  223|       |
  224|    231|        if (l > 0 && p[l-1] == ']') {
  ------------------
  |  Branch (224:13): [True: 224, False: 7]
  |  Branch (224:22): [True: 154, False: 70]
  ------------------
  225|    154|                size_t k = l-1;
  226|       |
  227|  5.34M|                for (;;) {
  228|       |
  229|  5.34M|                        if (p[k] == '[') {
  ------------------
  |  Branch (229:29): [True: 126, False: 5.34M]
  ------------------
  230|    126|                                t = strndup(p+k+1, l-k-2);
  231|    126|                                if (t)
  ------------------
  |  Branch (231:37): [True: 126, False: 0]
  ------------------
  232|    126|                                        *pid = t;
  233|       |
  234|    126|                                l = k;
  235|    126|                                break;
  236|    126|                        }
  237|       |
  238|  5.34M|                        if (k == 0)
  ------------------
  |  Branch (238:29): [True: 28, False: 5.34M]
  ------------------
  239|     28|                                break;
  240|       |
  241|  5.34M|                        k--;
  242|  5.34M|                }
  243|    154|        }
  244|       |
  245|    231|        t = strndup(p, l);
  246|    231|        if (t)
  ------------------
  |  Branch (246:13): [True: 231, False: 0]
  ------------------
  247|    231|                *identifier = t;
  248|       |
  249|       |        /* Single space is used as separator */
  250|    231|        if (p[e] != '\0' && strchr(WHITESPACE, p[e]))
  ------------------
  |  |   15|     10|#define WHITESPACE          " \t\n\r"
  ------------------
  |  Branch (250:13): [True: 10, False: 221]
  |  Branch (250:29): [True: 10, False: 0]
  ------------------
  251|     10|                e++;
  252|       |
  253|    231|        l = (p - *buf) + e;
  254|    231|        *buf = p + e;
  255|    231|        return l;
  256|    570|}
manager_process_syslog_message:
  332|    570|                size_t label_len) {
  333|       |
  334|    570|        char *t, syslog_priority[STRLEN("PRIORITY=") + DECIMAL_STR_MAX(int)],
  335|    570|                 syslog_facility[STRLEN("SYSLOG_FACILITY=") + DECIMAL_STR_MAX(int)];
  336|    570|        const char *msg, *syslog_ts, *a;
  337|    570|        _cleanup_free_ char *identifier = NULL, *pid = NULL,
  ------------------
  |  |   82|    570|#define _cleanup_free_ _cleanup_(freep)
  |  |  ------------------
  |  |  |  |   78|    570|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
  338|    570|                *dummy = NULL, *msg_msg = NULL, *msg_raw = NULL;
  339|    570|        int priority = LOG_USER | LOG_INFO, r;
  340|    570|        ClientContext *context = NULL;
  341|    570|        struct iovec *iovec;
  342|    570|        size_t n = 0, mm, i, leading_ws, syslog_ts_len;
  343|    570|        bool store_raw;
  344|       |
  345|    570|        assert(m);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  346|    570|        assert(buf);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  347|       |        /* The message cannot be empty. */
  348|    570|        assert(raw_len > 0);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  349|       |        /* The buffer NUL-terminated and can be used a string. raw_len is the length
  350|       |         * without the terminating NUL byte, the buffer is actually one bigger. */
  351|    570|        assert(buf[raw_len] == '\0');
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  352|       |
  353|    570|        if (ucred && pid_is_valid(ucred->pid)) {
  ------------------
  |  Branch (353:13): [True: 0, False: 570]
  |  Branch (353:22): [True: 0, False: 0]
  ------------------
  354|      0|                r = client_context_get(m, ucred->pid, ucred, label, label_len, NULL, &context);
  355|      0|                if (r < 0)
  ------------------
  |  Branch (355:21): [True: 0, False: 0]
  ------------------
  356|      0|                        log_ratelimit_warning_errno(r, JOURNAL_LOG_RATELIMIT,
  ------------------
  |  |   55|      0|#define log_ratelimit_warning_errno(error, ...)   log_ratelimit_full_errno(LOG_WARNING, error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   34|      0|        ({                                                              \
  |  |  |  |   35|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |   36|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (36:22): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   37|      0|                        ? log_ratelimit_internal(_level, _e, _ratelimit, PROJECT_FILE, __LINE__, __func__, format, ##__VA_ARGS__) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   13|      0|#define log_ratelimit_internal(_level, _error, _ratelimit, _file, _line, _func, _format, ...)        \
  |  |  |  |  |  |   14|      0|({                                                                              \
  |  |  |  |  |  |   15|      0|        int _log_ratelimit_error = (_error);                                    \
  |  |  |  |  |  |   16|      0|        int _log_ratelimit_level = (_level);                                    \
  |  |  |  |  |  |   17|      0|        static LogRateLimit _log_ratelimit = {                                  \
  |  |  |  |  |  |   18|      0|                .ratelimit = (_ratelimit),                                      \
  |  |  |  |  |  |   19|      0|        };                                                                      \
  |  |  |  |  |  |   20|      0|        unsigned _num_dropped_errors = ratelimit_num_dropped(&_log_ratelimit.ratelimit); \
  |  |  |  |  |  |   21|      0|        if (_log_ratelimit_error != _log_ratelimit.error || _log_ratelimit_level != _log_ratelimit.level) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (21:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (21:61): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      0|                ratelimit_reset(&_log_ratelimit.ratelimit);                     \
  |  |  |  |  |  |   23|      0|                _log_ratelimit.error = _log_ratelimit_error;                    \
  |  |  |  |  |  |   24|      0|                _log_ratelimit.level = _log_ratelimit_level;                    \
  |  |  |  |  |  |   25|      0|        }                                                                       \
  |  |  |  |  |  |   26|      0|        if (log_get_max_level() == LOG_DEBUG || ratelimit_below(&_log_ratelimit.ratelimit)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (26:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (26:49): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|                _log_ratelimit_error = _num_dropped_errors > 0                  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (27:40): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      0|                ? log_internal(_log_ratelimit_level, _log_ratelimit_error, _file, _line, _func, _format " (Dropped %u similar message(s))", ##__VA_ARGS__, _num_dropped_errors) \
  |  |  |  |  |  |   29|      0|                : log_internal(_log_ratelimit_level, _log_ratelimit_error, _file, _line, _func, _format, ##__VA_ARGS__); \
  |  |  |  |  |  |   30|      0|        _log_ratelimit_error;                                                   \
  |  |  |  |  |  |   31|      0|})
  |  |  |  |  ------------------
  |  |  |  |   38|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   39|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   40|      0|        })
  |  |  ------------------
  ------------------
  357|      0|                                                    "Failed to retrieve credentials for PID " PID_FMT ", ignoring: %m",
  358|      0|                                                    ucred->pid);
  359|      0|        }
  360|       |
  361|       |        /* We are creating a copy of the message because we want to forward the original message
  362|       |           verbatim to the legacy syslog implementation */
  363|   832k|        for (i = raw_len; i > 0; i--)
  ------------------
  |  Branch (363:27): [True: 832k, False: 11]
  ------------------
  364|   832k|                if (!strchr(WHITESPACE, buf[i-1]))
  ------------------
  |  |   15|   832k|#define WHITESPACE          " \t\n\r"
  ------------------
  |  Branch (364:21): [True: 559, False: 832k]
  ------------------
  365|    559|                        break;
  366|       |
  367|    570|        leading_ws = strspn(buf, WHITESPACE);
  ------------------
  |  |   15|    570|#define WHITESPACE          " \t\n\r"
  ------------------
  368|       |
  369|    570|        if (i == 0)
  ------------------
  |  Branch (369:13): [True: 11, False: 559]
  ------------------
  370|       |                /* The message contains only whitespaces */
  371|     11|                msg = buf + raw_len;
  372|    559|        else if (i == raw_len)
  ------------------
  |  Branch (372:18): [True: 503, False: 56]
  ------------------
  373|       |                /* Nice! No need to strip anything on the end, let's optimize this a bit */
  374|    503|                msg = buf + leading_ws;
  375|     56|        else {
  376|     56|                msg = dummy = new(char, i - leading_ws + 1);
  ------------------
  |  |   17|     56|#define new(t, n) ((t*) malloc_multiply(n, sizeof(t)))
  ------------------
  377|     56|                if (!dummy) {
  ------------------
  |  Branch (377:21): [True: 0, False: 56]
  ------------------
  378|      0|                        log_oom();
  ------------------
  |  |  280|      0|#define log_oom()           log_oom_full(LOG_ERR)
  |  |  ------------------
  |  |  |  |  279|      0|#define log_oom_full(level) log_oom_internal(level, PROJECT_FILE, __LINE__, __func__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  379|      0|                        return;
  380|      0|                }
  381|       |
  382|     56|                memcpy(dummy, buf + leading_ws, i - leading_ws);
  383|     56|                dummy[i - leading_ws] = 0;
  384|     56|        }
  385|       |
  386|       |        /* We will add the SYSLOG_RAW= field when we stripped anything
  387|       |         * _or_ if the input message contained NUL bytes. */
  388|    570|        store_raw = msg != buf || strlen(msg) != raw_len;
  ------------------
  |  Branch (388:21): [True: 68, False: 502]
  |  Branch (388:35): [True: 27, False: 475]
  ------------------
  389|       |
  390|    570|        syslog_parse_priority(&msg, &priority, true);
  391|       |
  392|    570|        if (!client_context_test_priority(context, priority))
  ------------------
  |  Branch (392:13): [True: 0, False: 570]
  ------------------
  393|      0|                return;
  394|       |
  395|    570|        if (client_context_check_keep_log(context, msg, strlen(msg)) <= 0)
  ------------------
  |  Branch (395:13): [True: 0, False: 570]
  ------------------
  396|      0|                return;
  397|       |
  398|    570|        syslog_ts = msg;
  399|    570|        syslog_ts_len = syslog_skip_timestamp(&msg);
  400|    570|        if (syslog_ts_len == 0)
  ------------------
  |  Branch (400:13): [True: 488, False: 82]
  ------------------
  401|       |                /* We failed to parse the full timestamp, store the raw message too */
  402|    488|                store_raw = true;
  403|       |
  404|    570|        syslog_parse_identifier(&msg, &identifier, &pid);
  405|       |
  406|    570|        if (m->forward_to_syslog)
  ------------------
  |  Branch (406:13): [True: 0, False: 570]
  ------------------
  407|      0|                forward_syslog_raw(m, priority, buf, raw_len, ucred, tv);
  408|       |
  409|    570|        if (m->forward_to_kmsg)
  ------------------
  |  Branch (409:13): [True: 0, False: 570]
  ------------------
  410|      0|                manager_forward_kmsg(m, priority, identifier, msg, ucred);
  411|       |
  412|    570|        if (m->forward_to_console)
  ------------------
  |  Branch (412:13): [True: 0, False: 570]
  ------------------
  413|      0|                manager_forward_console(m, priority, identifier, msg, ucred);
  414|       |
  415|    570|        if (m->forward_to_wall)
  ------------------
  |  Branch (415:13): [True: 570, False: 0]
  ------------------
  416|    570|                manager_forward_wall(m, priority, identifier, msg, ucred);
  417|       |
  418|    570|        mm = N_IOVEC_META_FIELDS + 8 + client_context_extra_fields_n_iovec(context);
  ------------------
  |  |  191|    570|#define N_IOVEC_META_FIELDS 24
  ------------------
  419|    570|        iovec = newa(struct iovec, mm);
  ------------------
  |  |   29|    570|        ({                                                              \
  |  |   30|    570|                size_t _n_ = (n);                                       \
  |  |   31|    570|                assert_se(MUL_ASSIGN_SAFE(&_n_, sizeof(t)));            \
  |  |  ------------------
  |  |  |  |   65|    570|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  |  |  ------------------
  |  |  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   61|    570|        } while (false)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   32|    570|                (t*) alloca_safe(_n_);                                  \
  |  |  ------------------
  |  |  |  |   22|    570|        ({                                                              \
  |  |  |  |   23|    570|                size_t _nn_ = (n);                                      \
  |  |  |  |   24|    570|                assert(_nn_ <= ALLOCA_MAX);                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|    570|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   25|    570|                alloca(_nn_ == 0 ? 1 : _nn_);                           \
  |  |  |  |   26|    570|        })                                                              \
  |  |  ------------------
  |  |   33|    570|        })
  ------------------
  420|       |
  421|    570|        iovec[n++] = IOVEC_MAKE_STRING("_TRANSPORT=syslog");
  ------------------
  |  |   19|    570|        *iovec_make_string(&(struct iovec) {}, s)
  ------------------
  422|       |
  423|    570|        xsprintf(syslog_priority, "PRIORITY=%i", LOG_PRI(priority));
  ------------------
  |  |   22|    570|        assert_message_se(snprintf_ok(buf, ELEMENTSOF(buf), fmt, ##__VA_ARGS__), "xsprintf: " #buf "[] must be big enough")
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  424|    570|        iovec[n++] = IOVEC_MAKE_STRING(syslog_priority);
  ------------------
  |  |   19|    570|        *iovec_make_string(&(struct iovec) {}, s)
  ------------------
  425|       |
  426|    570|        if (LOG_FAC(priority) != 0) {
  ------------------
  |  Branch (426:13): [True: 543, False: 27]
  ------------------
  427|    543|                xsprintf(syslog_facility, "SYSLOG_FACILITY=%i", LOG_FAC(priority));
  ------------------
  |  |   22|    543|        assert_message_se(snprintf_ok(buf, ELEMENTSOF(buf), fmt, ##__VA_ARGS__), "xsprintf: " #buf "[] must be big enough")
  |  |  ------------------
  |  |  |  |   58|    543|        do {                                                            \
  |  |  |  |   59|    543|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    543|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 543]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    543|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    543|        } while (false)
  |  |  ------------------
  ------------------
  428|    543|                iovec[n++] = IOVEC_MAKE_STRING(syslog_facility);
  ------------------
  |  |   19|    543|        *iovec_make_string(&(struct iovec) {}, s)
  ------------------
  429|    543|        }
  430|       |
  431|    570|        if (identifier) {
  ------------------
  |  Branch (431:13): [True: 231, False: 339]
  ------------------
  432|    231|                a = strjoina("SYSLOG_IDENTIFIER=", identifier);
  ------------------
  |  |   94|    231|        ({                                                              \
  |  |   95|    231|                const char *_appendees_[] = { a, __VA_ARGS__ };         \
  |  |   96|    231|                char *_d_, *_p_;                                        \
  |  |   97|    231|                size_t _len_ = 0;                                       \
  |  |   98|    231|                size_t _i_;                                             \
  |  |   99|    693|                for (_i_ = 0; _i_ < ELEMENTSOF(_appendees_) && _appendees_[_i_]; _i_++) \
  |  |  ------------------
  |  |  |  |  134|  1.38k|        (__builtin_choose_expr(                                         \
  |  |  |  |  135|  1.38k|                !__builtin_types_compatible_p(typeof(x), typeof(&*(x))), \
  |  |  |  |  136|  1.38k|                sizeof(x)/sizeof((x)[0]),                               \
  |  |  |  |  137|  1.38k|                VOID_0))
  |  |  |  |  ------------------
  |  |  |  |  |  |  128|    693|#  define VOID_0 ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (99:31): [True: 462, False: 231]
  |  |  |  Branch (99:64): [True: 462, False: 0]
  |  |  ------------------
  |  |  100|    462|                        _len_ += strlen(_appendees_[_i_]);              \
  |  |  101|    231|                _p_ = _d_ = newa(char, _len_ + 1);                      \
  |  |  ------------------
  |  |  |  |   29|    231|        ({                                                              \
  |  |  |  |   30|    231|                size_t _n_ = (n);                                       \
  |  |  |  |   31|    231|                assert_se(MUL_ASSIGN_SAFE(&_n_, sizeof(t)));            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|    231|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|    231|        do {                                                            \
  |  |  |  |  |  |  |  |   59|    231|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|    231|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 231]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|    231|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|    231|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   32|    231|                (t*) alloca_safe(_n_);                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    231|        ({                                                              \
  |  |  |  |  |  |   23|    231|                size_t _nn_ = (n);                                      \
  |  |  |  |  |  |   24|    231|                assert(_nn_ <= ALLOCA_MAX);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|    231|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   58|    231|        do {                                                            \
  |  |  |  |  |  |  |  |  |  |   59|    231|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|    231|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 231]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   60|    231|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   61|    231|        } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   25|    231|                alloca(_nn_ == 0 ? 1 : _nn_);                           \
  |  |  |  |  |  |   26|    231|        })                                                              \
  |  |  |  |  ------------------
  |  |  |  |   33|    231|        })
  |  |  ------------------
  |  |  102|    693|                for (_i_ = 0; _i_ < ELEMENTSOF(_appendees_) && _appendees_[_i_]; _i_++) \
  |  |  ------------------
  |  |  |  |  134|  1.38k|        (__builtin_choose_expr(                                         \
  |  |  |  |  135|  1.38k|                !__builtin_types_compatible_p(typeof(x), typeof(&*(x))), \
  |  |  |  |  136|  1.38k|                sizeof(x)/sizeof((x)[0]),                               \
  |  |  |  |  137|  1.38k|                VOID_0))
  |  |  |  |  ------------------
  |  |  |  |  |  |  128|    693|#  define VOID_0 ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (102:31): [True: 462, False: 231]
  |  |  |  Branch (102:64): [True: 462, False: 0]
  |  |  ------------------
  |  |  103|    462|                        _p_ = stpcpy(_p_, _appendees_[_i_]);            \
  |  |  104|    231|                *_p_ = 0;                                               \
  |  |  105|    231|                _d_;                                                    \
  |  |  106|    231|        })
  ------------------
  433|    231|                iovec[n++] = IOVEC_MAKE_STRING(a);
  ------------------
  |  |   19|    231|        *iovec_make_string(&(struct iovec) {}, s)
  ------------------
  434|    231|        }
  435|       |
  436|    570|        if (pid) {
  ------------------
  |  Branch (436:13): [True: 126, False: 444]
  ------------------
  437|    126|                a = strjoina("SYSLOG_PID=", pid);
  ------------------
  |  |   94|    126|        ({                                                              \
  |  |   95|    126|                const char *_appendees_[] = { a, __VA_ARGS__ };         \
  |  |   96|    126|                char *_d_, *_p_;                                        \
  |  |   97|    126|                size_t _len_ = 0;                                       \
  |  |   98|    126|                size_t _i_;                                             \
  |  |   99|    378|                for (_i_ = 0; _i_ < ELEMENTSOF(_appendees_) && _appendees_[_i_]; _i_++) \
  |  |  ------------------
  |  |  |  |  134|    756|        (__builtin_choose_expr(                                         \
  |  |  |  |  135|    756|                !__builtin_types_compatible_p(typeof(x), typeof(&*(x))), \
  |  |  |  |  136|    756|                sizeof(x)/sizeof((x)[0]),                               \
  |  |  |  |  137|    756|                VOID_0))
  |  |  |  |  ------------------
  |  |  |  |  |  |  128|    378|#  define VOID_0 ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (99:31): [True: 252, False: 126]
  |  |  |  Branch (99:64): [True: 252, False: 0]
  |  |  ------------------
  |  |  100|    252|                        _len_ += strlen(_appendees_[_i_]);              \
  |  |  101|    126|                _p_ = _d_ = newa(char, _len_ + 1);                      \
  |  |  ------------------
  |  |  |  |   29|    126|        ({                                                              \
  |  |  |  |   30|    126|                size_t _n_ = (n);                                       \
  |  |  |  |   31|    126|                assert_se(MUL_ASSIGN_SAFE(&_n_, sizeof(t)));            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|    126|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|    126|        do {                                                            \
  |  |  |  |  |  |  |  |   59|    126|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|    126|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 126]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|    126|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|    126|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   32|    126|                (t*) alloca_safe(_n_);                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    126|        ({                                                              \
  |  |  |  |  |  |   23|    126|                size_t _nn_ = (n);                                      \
  |  |  |  |  |  |   24|    126|                assert(_nn_ <= ALLOCA_MAX);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|    126|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   58|    126|        do {                                                            \
  |  |  |  |  |  |  |  |  |  |   59|    126|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|    126|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 126]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   60|    126|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   61|    126|        } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   25|    126|                alloca(_nn_ == 0 ? 1 : _nn_);                           \
  |  |  |  |  |  |   26|    126|        })                                                              \
  |  |  |  |  ------------------
  |  |  |  |   33|    126|        })
  |  |  ------------------
  |  |  102|    378|                for (_i_ = 0; _i_ < ELEMENTSOF(_appendees_) && _appendees_[_i_]; _i_++) \
  |  |  ------------------
  |  |  |  |  134|    756|        (__builtin_choose_expr(                                         \
  |  |  |  |  135|    756|                !__builtin_types_compatible_p(typeof(x), typeof(&*(x))), \
  |  |  |  |  136|    756|                sizeof(x)/sizeof((x)[0]),                               \
  |  |  |  |  137|    756|                VOID_0))
  |  |  |  |  ------------------
  |  |  |  |  |  |  128|    378|#  define VOID_0 ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (102:31): [True: 252, False: 126]
  |  |  |  Branch (102:64): [True: 252, False: 0]
  |  |  ------------------
  |  |  103|    252|                        _p_ = stpcpy(_p_, _appendees_[_i_]);            \
  |  |  104|    126|                *_p_ = 0;                                               \
  |  |  105|    126|                _d_;                                                    \
  |  |  106|    126|        })
  ------------------
  438|    126|                iovec[n++] = IOVEC_MAKE_STRING(a);
  ------------------
  |  |   19|    126|        *iovec_make_string(&(struct iovec) {}, s)
  ------------------
  439|    126|        }
  440|       |
  441|    570|        if (syslog_ts_len > 0) {
  ------------------
  |  Branch (441:13): [True: 82, False: 488]
  ------------------
  442|     82|                const size_t hlen = STRLEN("SYSLOG_TIMESTAMP=");
  ------------------
  |  |  397|     82|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  ------------------
  443|       |
  444|     82|                t = newa(char, hlen + syslog_ts_len);
  ------------------
  |  |   29|     82|        ({                                                              \
  |  |   30|     82|                size_t _n_ = (n);                                       \
  |  |   31|     82|                assert_se(MUL_ASSIGN_SAFE(&_n_, sizeof(t)));            \
  |  |  ------------------
  |  |  |  |   65|     82|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  |  |  ------------------
  |  |  |  |  |  |   58|     82|        do {                                                            \
  |  |  |  |  |  |   59|     82|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|     82|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 82]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   60|     82|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   61|     82|        } while (false)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   32|     82|                (t*) alloca_safe(_n_);                                  \
  |  |  ------------------
  |  |  |  |   22|     82|        ({                                                              \
  |  |  |  |   23|     82|                size_t _nn_ = (n);                                      \
  |  |  |  |   24|     82|                assert(_nn_ <= ALLOCA_MAX);                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|     82|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|     82|        do {                                                            \
  |  |  |  |  |  |  |  |   59|     82|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|     82|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 82]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|     82|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|     82|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   25|     82|                alloca(_nn_ == 0 ? 1 : _nn_);                           \
  |  |  |  |   26|     82|        })                                                              \
  |  |  ------------------
  |  |   33|     82|        })
  ------------------
  445|     82|                memcpy(t, "SYSLOG_TIMESTAMP=", hlen);
  446|     82|                memcpy(t + hlen, syslog_ts, syslog_ts_len);
  447|       |
  448|     82|                iovec[n++] = IOVEC_MAKE(t, hlen + syslog_ts_len);
  ------------------
  |  |   21|     82|        (struct iovec) {                                                \
  |  |   22|     82|                .iov_base = (void*) (base),                             \
  |  |   23|     82|                .iov_len = (len),                                       \
  |  |   24|     82|        }
  ------------------
  449|     82|        }
  450|       |
  451|    570|        msg_msg = strjoin("MESSAGE=", msg);
  ------------------
  |  |   91|    570|#define strjoin(a, ...) strextend_with_separator_internal(NULL, NULL, a, __VA_ARGS__, NULL)
  ------------------
  452|    570|        if (!msg_msg) {
  ------------------
  |  Branch (452:13): [True: 0, False: 570]
  ------------------
  453|      0|                log_oom();
  ------------------
  |  |  280|      0|#define log_oom()           log_oom_full(LOG_ERR)
  |  |  ------------------
  |  |  |  |  279|      0|#define log_oom_full(level) log_oom_internal(level, PROJECT_FILE, __LINE__, __func__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  454|      0|                return;
  455|      0|        }
  456|    570|        iovec[n++] = IOVEC_MAKE_STRING(msg_msg);
  ------------------
  |  |   19|    570|        *iovec_make_string(&(struct iovec) {}, s)
  ------------------
  457|       |
  458|    570|        if (store_raw) {
  ------------------
  |  Branch (458:13): [True: 488, False: 82]
  ------------------
  459|    488|                const size_t hlen = STRLEN("SYSLOG_RAW=");
  ------------------
  |  |  397|    488|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  ------------------
  460|       |
  461|    488|                msg_raw = new(char, hlen + raw_len);
  ------------------
  |  |   17|    488|#define new(t, n) ((t*) malloc_multiply(n, sizeof(t)))
  ------------------
  462|    488|                if (!msg_raw) {
  ------------------
  |  Branch (462:21): [True: 0, False: 488]
  ------------------
  463|      0|                        log_oom();
  ------------------
  |  |  280|      0|#define log_oom()           log_oom_full(LOG_ERR)
  |  |  ------------------
  |  |  |  |  279|      0|#define log_oom_full(level) log_oom_internal(level, PROJECT_FILE, __LINE__, __func__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  464|      0|                        return;
  465|      0|                }
  466|       |
  467|    488|                memcpy(msg_raw, "SYSLOG_RAW=", hlen);
  468|    488|                memcpy(msg_raw + hlen, buf, raw_len);
  469|       |
  470|    488|                iovec[n++] = IOVEC_MAKE(msg_raw, hlen + raw_len);
  ------------------
  |  |   21|    488|        (struct iovec) {                                                \
  |  |   22|    488|                .iov_base = (void*) (base),                             \
  |  |   23|    488|                .iov_len = (len),                                       \
  |  |   24|    488|        }
  ------------------
  471|    488|        }
  472|       |
  473|    570|        manager_dispatch_message(m, iovec, n, mm, context, tv, priority, 0);
  474|    570|}
journald-syslog.c:syslog_skip_timestamp:
  258|    570|static int syslog_skip_timestamp(const char **buf) {
  259|    570|        enum {
  260|    570|                LETTER,
  261|    570|                SPACE,
  262|    570|                NUMBER,
  263|    570|                SPACE_OR_NUMBER,
  264|    570|                COLON
  265|    570|        } sequence[] = {
  266|    570|                LETTER, LETTER, LETTER,
  267|    570|                SPACE,
  268|    570|                SPACE_OR_NUMBER, NUMBER,
  269|    570|                SPACE,
  270|    570|                SPACE_OR_NUMBER, NUMBER,
  271|    570|                COLON,
  272|    570|                SPACE_OR_NUMBER, NUMBER,
  273|    570|                COLON,
  274|    570|                SPACE_OR_NUMBER, NUMBER,
  275|    570|                SPACE
  276|    570|        };
  277|       |
  278|    570|        const char *p, *t;
  279|    570|        unsigned i;
  280|       |
  281|    570|        assert(buf);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  282|    570|        assert(*buf);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  283|       |
  284|  2.37k|        for (i = 0, p = *buf; i < ELEMENTSOF(sequence); i++, p++) {
  ------------------
  |  |  134|  2.37k|        (__builtin_choose_expr(                                         \
  |  |  135|  2.37k|                !__builtin_types_compatible_p(typeof(x), typeof(&*(x))), \
  |  |  136|  2.37k|                sizeof(x)/sizeof((x)[0]),                               \
  |  |  137|  2.37k|                VOID_0))
  |  |  ------------------
  |  |  |  |  128|  2.37k|#  define VOID_0 ((void)0)
  |  |  ------------------
  ------------------
  |  Branch (284:31): [True: 2.29k, False: 82]
  ------------------
  285|  2.29k|                if (!*p)
  ------------------
  |  Branch (285:21): [True: 71, False: 2.22k]
  ------------------
  286|     71|                        return 0;
  287|       |
  288|  2.22k|                switch (sequence[i]) {
  ------------------
  |  Branch (288:25): [True: 0, False: 2.22k]
  ------------------
  289|       |
  290|    348|                case SPACE:
  ------------------
  |  Branch (290:17): [True: 348, False: 1.87k]
  ------------------
  291|    348|                        if (*p != ' ')
  ------------------
  |  Branch (291:29): [True: 27, False: 321]
  ------------------
  292|     27|                                return 0;
  293|    321|                        break;
  294|       |
  295|    412|                case SPACE_OR_NUMBER:
  ------------------
  |  Branch (295:17): [True: 412, False: 1.80k]
  ------------------
  296|    412|                        if (*p == ' ')
  ------------------
  |  Branch (296:29): [True: 18, False: 394]
  ------------------
  297|     18|                                break;
  298|       |
  299|    394|                        _fallthrough_;
  ------------------
  |  |  111|    394|#  define _fallthrough_ __attribute__((__fallthrough__))
  ------------------
  300|    778|                case NUMBER:
  ------------------
  |  Branch (300:17): [True: 384, False: 1.83k]
  ------------------
  301|    778|                        if (!ascii_isdigit(*p))
  ------------------
  |  Branch (301:29): [True: 25, False: 753]
  ------------------
  302|     25|                                return 0;
  303|       |
  304|    753|                        break;
  305|       |
  306|    889|                case LETTER:
  ------------------
  |  Branch (306:17): [True: 889, False: 1.33k]
  ------------------
  307|    889|                        if (!ascii_isalpha(*p))
  ------------------
  |  Branch (307:29): [True: 353, False: 536]
  ------------------
  308|    353|                                return 0;
  309|       |
  310|    536|                        break;
  311|       |
  312|    536|                case COLON:
  ------------------
  |  Branch (312:17): [True: 187, False: 2.03k]
  ------------------
  313|    187|                        if (*p != ':')
  ------------------
  |  Branch (313:29): [True: 12, False: 175]
  ------------------
  314|     12|                                return 0;
  315|    175|                        break;
  316|       |
  317|  2.22k|                }
  318|  2.22k|        }
  319|       |
  320|     82|        t = *buf;
  321|     82|        *buf = p;
  322|     82|        return p - t;
  323|    570|}

manager_forward_wall:
   17|    570|                const struct ucred *ucred) {
   18|       |
   19|    570|        _cleanup_free_ char *ident_buf = NULL, *l_buf = NULL;
  ------------------
  |  |   82|    570|#define _cleanup_free_ _cleanup_(freep)
  |  |  ------------------
  |  |  |  |   78|    570|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
   20|    570|        const char *l;
   21|    570|        int r;
   22|       |
   23|    570|        assert(m);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   24|    570|        assert(message);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
   25|       |
   26|    570|        if (LOG_PRI(priority) > m->max_level_wall)
  ------------------
  |  Branch (26:13): [True: 489, False: 81]
  ------------------
   27|    489|                return;
   28|       |
   29|     81|        if (ucred) {
  ------------------
  |  Branch (29:13): [True: 0, False: 81]
  ------------------
   30|      0|                if (!identifier) {
  ------------------
  |  Branch (30:21): [True: 0, False: 0]
  ------------------
   31|      0|                        (void) pid_get_comm(ucred->pid, &ident_buf);
   32|      0|                        identifier = ident_buf;
   33|      0|                }
   34|       |
   35|      0|                if (asprintf(&l_buf, "%s["PID_FMT"]: %s", strempty(identifier), ucred->pid, message) < 0) {
  ------------------
  |  Branch (35:21): [True: 0, False: 0]
  ------------------
   36|      0|                        log_oom();
  ------------------
  |  |  280|      0|#define log_oom()           log_oom_full(LOG_ERR)
  |  |  ------------------
  |  |  |  |  279|      0|#define log_oom_full(level) log_oom_internal(level, PROJECT_FILE, __LINE__, __func__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   37|      0|                        return;
   38|      0|                }
   39|       |
   40|      0|                l = l_buf;
   41|       |
   42|     81|        } else if (identifier) {
  ------------------
  |  Branch (42:20): [True: 40, False: 41]
  ------------------
   43|       |
   44|     40|                l = l_buf = strjoin(identifier, ": ", message);
  ------------------
  |  |   91|     40|#define strjoin(a, ...) strextend_with_separator_internal(NULL, NULL, a, __VA_ARGS__, NULL)
  ------------------
   45|     40|                if (!l_buf) {
  ------------------
  |  Branch (45:21): [True: 0, False: 40]
  ------------------
   46|      0|                        log_oom();
  ------------------
  |  |  280|      0|#define log_oom()           log_oom_full(LOG_ERR)
  |  |  ------------------
  |  |  |  |  279|      0|#define log_oom_full(level) log_oom_internal(level, PROJECT_FILE, __LINE__, __func__)
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   47|      0|                        return;
   48|      0|                }
   49|     40|        } else
   50|     41|                l = message;
   51|       |
   52|     81|        r = wall(l, "systemd-journald", NULL, NULL, NULL);
   53|     81|        if (r < 0)
  ------------------
  |  Branch (53:13): [True: 0, False: 81]
  ------------------
   54|     81|                log_debug_errno(r, "Failed to send wall message: %m");
  ------------------
  |  |  228|      0|#define log_debug_errno(error, ...)     log_full_errno(LOG_DEBUG,   error, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  204|      0|        ({                                                              \
  |  |  |  |  205|      0|                int _error = (error);                                   \
  |  |  |  |  206|      0|                ASSERT_NON_ZERO(_error);                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  198|      0|#  define ASSERT_NON_ZERO(x) assert((x) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  207|      0|                log_full_errno_zerook(level, _error, __VA_ARGS__);      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  208|      0|        })
  |  |  ------------------
  ------------------
   55|     81|}

sd_event_new:
  388|    570|_public_ int sd_event_new(sd_event** ret) {
  389|    570|        sd_event *e;
  390|    570|        int r;
  391|       |
  392|    570|        assert_return(ret, -EINVAL);
  ------------------
  |  |   18|    570|        do {                                                            \
  |  |   19|    570|                if (!assert_log(expr, #expr))                           \
  |  |  ------------------
  |  |  |  |   13|    570|#define assert_log(expr, message) ((_likely_(expr))                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    570|#define _likely_(x) (__builtin_expect(!!(x), 1))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (13:36): [True: 570, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   14|    570|        ? (true)                                                        \
  |  |  |  |   15|    570|        : (log_assert_failed_return(message, PROJECT_FILE, __LINE__, __func__), false))
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (19:21): [True: 0, False: 570]
  |  |  ------------------
  |  |   20|    570|                        return (r);                                     \
  |  |   21|    570|        } while (false)
  ------------------
  393|       |
  394|    570|        e = new(sd_event, 1);
  ------------------
  |  |   17|    570|#define new(t, n) ((t*) malloc_multiply(n, sizeof(t)))
  ------------------
  395|    570|        if (!e)
  ------------------
  |  Branch (395:13): [True: 0, False: 570]
  ------------------
  396|      0|                return -ENOMEM;
  397|       |
  398|    570|        *e = (sd_event) {
  399|    570|                .n_ref = 1,
  400|    570|                .epoll_fd = -EBADF,
  401|    570|                .watchdog_fd = -EBADF,
  402|    570|                .realtime.wakeup = WAKEUP_CLOCK_DATA,
  403|    570|                .realtime.fd = -EBADF,
  404|    570|                .realtime.next = USEC_INFINITY,
  ------------------
  |  |   35|    570|#define USEC_INFINITY ((usec_t) UINT64_MAX)
  ------------------
  405|    570|                .boottime.wakeup = WAKEUP_CLOCK_DATA,
  406|    570|                .boottime.fd = -EBADF,
  407|    570|                .boottime.next = USEC_INFINITY,
  ------------------
  |  |   35|    570|#define USEC_INFINITY ((usec_t) UINT64_MAX)
  ------------------
  408|    570|                .monotonic.wakeup = WAKEUP_CLOCK_DATA,
  409|    570|                .monotonic.fd = -EBADF,
  410|    570|                .monotonic.next = USEC_INFINITY,
  ------------------
  |  |   35|    570|#define USEC_INFINITY ((usec_t) UINT64_MAX)
  ------------------
  411|    570|                .realtime_alarm.wakeup = WAKEUP_CLOCK_DATA,
  412|    570|                .realtime_alarm.fd = -EBADF,
  413|    570|                .realtime_alarm.next = USEC_INFINITY,
  ------------------
  |  |   35|    570|#define USEC_INFINITY ((usec_t) UINT64_MAX)
  ------------------
  414|    570|                .boottime_alarm.wakeup = WAKEUP_CLOCK_DATA,
  415|    570|                .boottime_alarm.fd = -EBADF,
  416|    570|                .boottime_alarm.next = USEC_INFINITY,
  ------------------
  |  |   35|    570|#define USEC_INFINITY ((usec_t) UINT64_MAX)
  ------------------
  417|    570|                .perturb = USEC_INFINITY,
  ------------------
  |  |   35|    570|#define USEC_INFINITY ((usec_t) UINT64_MAX)
  ------------------
  418|    570|                .origin_id = origin_id_query(),
  419|    570|        };
  420|       |
  421|    570|        r = prioq_ensure_allocated(&e->pending, pending_prioq_compare);
  422|    570|        if (r < 0)
  ------------------
  |  Branch (422:13): [True: 0, False: 570]
  ------------------
  423|      0|                goto fail;
  424|       |
  425|    570|        e->epoll_fd = epoll_create1(EPOLL_CLOEXEC);
  426|    570|        if (e->epoll_fd < 0) {
  ------------------
  |  Branch (426:13): [True: 0, False: 570]
  ------------------
  427|      0|                r = -errno;
  428|      0|                goto fail;
  429|      0|        }
  430|       |
  431|    570|        e->epoll_fd = fd_move_above_stdio(e->epoll_fd);
  432|       |
  433|    570|        if (secure_getenv("SD_EVENT_PROFILE_DELAYS")) {
  ------------------
  |  Branch (433:13): [True: 0, False: 570]
  ------------------
  434|      0|                log_debug("Event loop profiling enabled. Logarithmic histogram of event loop iterations in the range 2^0 %s 2^63 us will be logged every 5s.",
  ------------------
  |  |  220|      0|#define log_debug(...)     log_full(LOG_DEBUG,   __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  211|      0|        ({                                                             \
  |  |  |  |  212|      0|                if (BUILD_MODE_DEVELOPER)                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define BUILD_MODE_DEVELOPER 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (23:30): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  213|      0|                        assert(!strstr(fmt, "%m"));                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|      0|        } while (false)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  214|      0|                (void) log_full_errno_zerook(level, 0, fmt, ##__VA_ARGS__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|        ({                                                              \
  |  |  |  |  |  |  190|      0|                int _level = (level), _e = (error);                     \
  |  |  |  |  |  |  191|      0|                _e = (log_get_max_level() >= LOG_PRI(_level))           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (191:22): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|                        ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|                        : -ERRNO_VALUE(_e);                             \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define ERRNO_VALUE(val)                    (ABS(val) & ~(1 << 30))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  172|      0|#  define ABS(a) __builtin_llabs(a)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  194|      0|                _e < 0 ? _e : -ESTRPIPE;                                \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (194:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  195|      0|        })
  |  |  |  |  ------------------
  |  |  |  |  215|      0|        })
  |  |  ------------------
  ------------------
  435|      0|                          glyph(GLYPH_ELLIPSIS));
  436|      0|                e->profile_delays = true;
  437|      0|        }
  438|       |
  439|    570|        *ret = e;
  440|    570|        return 0;
  441|       |
  442|      0|fail:
  443|      0|        event_free(e);
  444|      0|        return r;
  445|    570|}
sd_event_unref:
  459|    570|_public_ sd_event* sd_event_unref(sd_event *e) {
  460|    570|        if (!e)
  ------------------
  |  Branch (460:13): [True: 0, False: 570]
  ------------------
  461|      0|                return NULL;
  462|    570|        if (event_origin_changed(e))
  ------------------
  |  Branch (462:13): [True: 0, False: 570]
  ------------------
  463|      0|                return NULL;
  464|       |
  465|    570|        assert(e->n_ref > 0);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  466|    570|        if (--e->n_ref > 0)
  ------------------
  |  Branch (466:13): [True: 0, False: 570]
  ------------------
  467|      0|                return NULL;
  468|       |
  469|    570|        return event_free(e);
  470|    570|}
sd_event_default:
 4951|    570|_public_ int sd_event_default(sd_event **ret) {
 4952|    570|        sd_event *e = NULL;
 4953|    570|        int r;
 4954|       |
 4955|    570|        if (!ret)
  ------------------
  |  Branch (4955:13): [True: 0, False: 570]
  ------------------
 4956|      0|                return !!default_event;
 4957|       |
 4958|    570|        if (default_event) {
  ------------------
  |  Branch (4958:13): [True: 0, False: 570]
  ------------------
 4959|      0|                *ret = sd_event_ref(default_event);
 4960|      0|                return 0;
 4961|      0|        }
 4962|       |
 4963|    570|        r = sd_event_new(&e);
 4964|    570|        if (r < 0)
  ------------------
  |  Branch (4964:13): [True: 0, False: 570]
  ------------------
 4965|      0|                return r;
 4966|       |
 4967|    570|        e->default_event_ptr = &default_event;
 4968|    570|        e->tid = gettid();
 4969|    570|        default_event = e;
 4970|       |
 4971|    570|        *ret = e;
 4972|    570|        return 1;
 4973|    570|}
sd-event.c:event_free:
  343|    570|static sd_event* event_free(sd_event *e) {
  344|    570|        sd_event_source *s;
  345|       |
  346|    570|        assert(e);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  347|       |
  348|    570|        e->sigterm_event_source = sd_event_source_unref(e->sigterm_event_source);
  349|    570|        e->sigint_event_source = sd_event_source_unref(e->sigint_event_source);
  350|       |
  351|    570|        while ((s = e->sources)) {
  ------------------
  |  Branch (351:16): [True: 0, False: 570]
  ------------------
  352|      0|                assert(s->floating);
  ------------------
  |  |   72|      0|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|      0|        do {                                                            \
  |  |  |  |   59|      0|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|      0|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|      0|        } while (false)
  |  |  ------------------
  ------------------
  353|      0|                source_disconnect(s);
  354|      0|                sd_event_source_unref(s);
  355|      0|        }
  356|       |
  357|    570|        assert(e->n_sources == 0);
  ------------------
  |  |   72|    570|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|    570|        do {                                                            \
  |  |  |  |   59|    570|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    570|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 570]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|    570|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|    570|        } while (false)
  |  |  ------------------
  ------------------
  358|       |
  359|    570|        if (e->default_event_ptr)
  ------------------
  |  Branch (359:13): [True: 570, False: 0]
  ------------------
  360|    570|                *(e->default_event_ptr) = NULL;
  361|       |
  362|    570|        safe_close(e->epoll_fd);
  363|    570|        safe_close(e->watchdog_fd);
  364|       |
  365|    570|        free_clock_data(&e->realtime);
  366|    570|        free_clock_data(&e->boottime);
  367|    570|        free_clock_data(&e->monotonic);
  368|    570|        free_clock_data(&e->realtime_alarm);
  369|    570|        free_clock_data(&e->boottime_alarm);
  370|       |
  371|    570|        prioq_free(e->pending);
  372|    570|        prioq_free(e->prepare);
  373|    570|        prioq_free(e->exit);
  374|       |
  375|    570|        free(e->signal_sources);
  376|    570|        hashmap_free(e->signal_data);
  377|       |
  378|    570|        hashmap_free(e->inotify_data);
  379|       |
  380|    570|        hashmap_free(e->child_sources);
  381|    570|        set_free(e->post_sources);
  382|       |
  383|    570|        free(e->event_queue);
  384|       |
  385|    570|        return mfree(e);
  ------------------
  |  |  404|    570|        ({                                      \
  |  |  405|    570|                free(memory);                   \
  |  |  406|    570|                (typeof(memory)) NULL;          \
  |  |  407|    570|        })
  ------------------
  386|    570|}
sd-event.c:free_clock_data:
  334|  2.85k|static void free_clock_data(struct clock_data *d) {
  335|  2.85k|        assert(d);
  ------------------
  |  |   72|  2.85k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  2.85k|        do {                                                            \
  |  |  |  |   59|  2.85k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  2.85k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 2.85k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  2.85k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  2.85k|        } while (false)
  |  |  ------------------
  ------------------
  336|  2.85k|        assert(d->wakeup == WAKEUP_CLOCK_DATA);
  ------------------
  |  |   72|  2.85k|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|  2.85k|        do {                                                            \
  |  |  |  |   59|  2.85k|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  2.85k|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 2.85k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|  2.85k|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|  2.85k|        } while (false)
  |  |  ------------------
  ------------------
  337|       |
  338|  2.85k|        safe_close(d->fd);
  339|  2.85k|        prioq_free(d->earliest);
  340|  2.85k|        prioq_free(d->latest);
  341|  2.85k|}

gethostname_full:
  312|     81|int gethostname_full(GetHostnameFlags flags, char **ret) {
  313|     81|        _cleanup_free_ char *buf = NULL, *fallback = NULL;
  ------------------
  |  |   82|     81|#define _cleanup_free_ _cleanup_(freep)
  |  |  ------------------
  |  |  |  |   78|     81|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
  314|     81|        struct utsname u;
  315|     81|        const char *s;
  316|       |
  317|     81|        assert(ret);
  ------------------
  |  |   72|     81|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     81|        do {                                                            \
  |  |  |  |   59|     81|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     81|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     81|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     81|        } while (false)
  |  |  ------------------
  ------------------
  318|       |
  319|     81|        assert_se(uname(&u) >= 0);
  ------------------
  |  |   65|     81|#define assert_se(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     81|        do {                                                            \
  |  |  |  |   59|     81|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     81|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     81|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     81|        } while (false)
  |  |  ------------------
  ------------------
  320|       |
  321|     81|        s = u.nodename;
  322|     81|        if (isempty(s) || streq(s, "(none)") ||
  ------------------
  |  |   46|    162|#define streq(a,b) (strcmp((a),(b)) == 0)
  |  |  ------------------
  |  |  |  Branch (46:20): [True: 0, False: 81]
  |  |  ------------------
  ------------------
  |  Branch (322:13): [True: 0, False: 81]
  ------------------
  323|     81|            (!FLAGS_SET(flags, GET_HOSTNAME_ALLOW_LOCALHOST) && is_localhost(s)) ||
  ------------------
  |  |  414|    162|        ((~(v) & (flags)) == 0)
  ------------------
  |  Branch (323:14): [True: 0, False: 81]
  |  Branch (323:65): [True: 0, False: 0]
  ------------------
  324|     81|            (FLAGS_SET(flags, GET_HOSTNAME_SHORT) && s[0] == '.')) {
  ------------------
  |  |  414|    162|        ((~(v) & (flags)) == 0)
  |  |  ------------------
  |  |  |  Branch (414:9): [True: 0, False: 81]
  |  |  ------------------
  ------------------
  |  Branch (324:54): [True: 0, False: 0]
  ------------------
  325|      0|                if (!FLAGS_SET(flags, GET_HOSTNAME_FALLBACK_DEFAULT))
  ------------------
  |  |  414|      0|        ((~(v) & (flags)) == 0)
  ------------------
  |  Branch (325:21): [True: 0, False: 0]
  ------------------
  326|      0|                        return -ENXIO;
  327|       |
  328|      0|                s = fallback = get_default_hostname();
  329|      0|                if (!s)
  ------------------
  |  Branch (329:21): [True: 0, False: 0]
  ------------------
  330|      0|                        return -ENOMEM;
  331|       |
  332|      0|                if (FLAGS_SET(flags, GET_HOSTNAME_SHORT) && s[0] == '.')
  ------------------
  |  |  414|      0|        ((~(v) & (flags)) == 0)
  |  |  ------------------
  |  |  |  Branch (414:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (332:61): [True: 0, False: 0]
  ------------------
  333|      0|                        return -ENXIO;
  334|      0|        }
  335|       |
  336|     81|        if (FLAGS_SET(flags, GET_HOSTNAME_SHORT))
  ------------------
  |  |  414|     81|        ((~(v) & (flags)) == 0)
  |  |  ------------------
  |  |  |  Branch (414:9): [True: 0, False: 81]
  |  |  ------------------
  ------------------
  337|      0|                buf = strdupcspn(s, ".");
  338|     81|        else
  339|     81|                buf = strdup(s);
  340|     81|        if (!buf)
  ------------------
  |  Branch (340:13): [True: 0, False: 81]
  ------------------
  341|      0|                return -ENOMEM;
  342|       |
  343|     81|        *ret = TAKE_PTR(buf);
  ------------------
  |  |  388|     81|#define TAKE_PTR(ptr) TAKE_PTR_TYPE(ptr, typeof(ptr))
  |  |  ------------------
  |  |  |  |  387|     81|#define TAKE_PTR_TYPE(ptr, type) TAKE_GENERIC(ptr, type, NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|     81|        ({                                                       \
  |  |  |  |  |  |  381|     81|                type *_pvar_ = &(var);                           \
  |  |  |  |  |  |  382|     81|                type _var_ = *_pvar_;                            \
  |  |  |  |  |  |  383|     81|                type _nullvalue_ = nullvalue;                    \
  |  |  |  |  |  |  384|     81|                *_pvar_ = _nullvalue_;                           \
  |  |  |  |  |  |  385|     81|                _var_;                                           \
  |  |  |  |  |  |  386|     81|        })
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  344|     81|        return 0;
  345|     81|}

wall.c:gethostname_malloc:
   42|     81|static inline char* gethostname_malloc(void) {
   43|     81|        char *s;
   44|       |
   45|     81|        if (gethostname_full(GET_HOSTNAME_ALLOW_LOCALHOST | GET_HOSTNAME_FALLBACK_DEFAULT, &s) < 0)
  ------------------
  |  Branch (45:13): [True: 0, False: 81]
  ------------------
   46|      0|                return NULL;
   47|       |
   48|     81|        return s;
   49|     81|}

journal_file_offline_close:
  398|  1.14k|JournalFile* journal_file_offline_close(JournalFile *f) {
  399|  1.14k|        if (!f)
  ------------------
  |  Branch (399:13): [True: 1.14k, False: 0]
  ------------------
  400|  1.14k|                return NULL;
  401|       |
  402|      0|        journal_file_write_final_tag(f);
  403|       |
  404|      0|        if (sd_event_source_get_enabled(f->post_change_timer, NULL) > 0)
  ------------------
  |  Branch (404:13): [True: 0, False: 0]
  ------------------
  405|      0|                journal_file_post_change(f);
  406|      0|        f->post_change_timer = sd_event_source_disable_unref(f->post_change_timer);
  407|       |
  408|      0|        journal_file_set_offline(f, true);
  409|       |
  410|      0|        return journal_file_close(f);
  411|  1.14k|}

wall.c:utxent_cleanup:
   22|     81|static inline void utxent_cleanup(bool *initialized) {
   23|     81|        assert(initialized);
  ------------------
  |  |   72|     81|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     81|        do {                                                            \
  |  |  |  |   59|     81|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     81|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     81|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     81|        } while (false)
  |  |  ------------------
  ------------------
   24|     81|        if (*initialized)
  ------------------
  |  Branch (24:13): [True: 81, False: 0]
  ------------------
   25|     81|                endutxent();
   26|     81|}
wall.c:utxent_start:
   18|     81|static inline bool utxent_start(void) {
   19|     81|        setutxent();
   20|     81|        return true;
   21|     81|}

wall:
  148|     81|        void *userdata) {
  149|       |
  150|     81|        _cleanup_free_ char *text = NULL, *hostname = NULL, *username_alloc = NULL, *stdin_tty = NULL;
  ------------------
  |  |   82|     81|#define _cleanup_free_ _cleanup_(freep)
  |  |  ------------------
  |  |  |  |   78|     81|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
  151|     81|        int r;
  152|       |
  153|     81|        assert(message);
  ------------------
  |  |   72|     81|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     81|        do {                                                            \
  |  |  |  |   59|     81|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     81|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     81|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     81|        } while (false)
  |  |  ------------------
  ------------------
  154|       |
  155|     81|        hostname = gethostname_malloc();
  156|     81|        if (!hostname)
  ------------------
  |  Branch (156:13): [True: 0, False: 81]
  ------------------
  157|      0|                return -ENOMEM;
  158|       |
  159|     81|        if (!username) {
  ------------------
  |  Branch (159:13): [True: 0, False: 81]
  ------------------
  160|      0|                username_alloc = getlogname_malloc();
  161|      0|                if (!username_alloc)
  ------------------
  |  Branch (161:21): [True: 0, False: 0]
  ------------------
  162|      0|                        return -ENOMEM;
  163|       |
  164|      0|                username = username_alloc;
  165|      0|        }
  166|       |
  167|     81|        if (!origin_tty) {
  ------------------
  |  Branch (167:13): [True: 81, False: 0]
  ------------------
  168|     81|                (void) getttyname_harder(STDIN_FILENO, &stdin_tty);
  169|     81|                origin_tty = stdin_tty;
  170|     81|        }
  171|       |
  172|     81|        if (asprintf(&text,
  ------------------
  |  Branch (172:13): [True: 0, False: 81]
  ------------------
  173|     81|                     "\r\n"
  174|     81|                     "Broadcast message from %s@%s%s%s (%s):\r\n\r\n"
  175|     81|                     "%s\r\n\r\n",
  176|     81|                     username, hostname,
  177|     81|                     origin_tty ? " on " : "", strempty(origin_tty),
  ------------------
  |  Branch (177:22): [True: 0, False: 81]
  ------------------
  178|     81|                     FORMAT_TIMESTAMP(now(CLOCK_REALTIME)),
  ------------------
  |  |  143|     81|#define FORMAT_TIMESTAMP(t) format_timestamp((char[FORMAT_TIMESTAMP_MAX]){}, FORMAT_TIMESTAMP_MAX, t)
  |  |  ------------------
  |  |  |  |   60|     81|#define FORMAT_TIMESTAMP_MAX (3U+1U+10U+1U+8U+1U+6U+1U+6U+1U)
  |  |  ------------------
  ------------------
  179|     81|                     message) < 0)
  180|      0|                return -ENOMEM;
  181|       |
  182|     81|        r = wall_utmp(text, match_tty, userdata);
  183|     81|        if (r == -ENOPROTOOPT)
  ------------------
  |  Branch (183:13): [True: 0, False: 81]
  ------------------
  184|      0|                r = wall_logind(text, match_tty, userdata);
  185|       |
  186|     81|        return r == -ENOPROTOOPT ? 0 : r;
  ------------------
  |  Branch (186:16): [True: 0, False: 81]
  ------------------
  187|     81|}
wall.c:wall_utmp:
   44|     81|        void *userdata) {
   45|       |
   46|     81|#if ENABLE_UTMP
   47|     81|        _unused_ _cleanup_(utxent_cleanup) bool utmpx = false;
  ------------------
  |  |   96|     81|#define _unused_ __attribute__((__unused__))
  ------------------
   48|     81|        struct utmpx *u;
   49|     81|        int r = 0;
   50|       |
   51|     81|        assert(message);
  ------------------
  |  |   72|     81|#define assert(expr) assert_message_se(expr, #expr)
  |  |  ------------------
  |  |  |  |   58|     81|        do {                                                            \
  |  |  |  |   59|     81|                if (_unlikely_(!(expr)))                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     81|#define _unlikely_(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (95:23): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   60|     81|                        log_assert_failed(message, PROJECT_FILE, __LINE__, __func__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  472|      0|#define PROJECT_FILE (&__FILE__[STRLEN(RELATIVE_SOURCE_PATH) + 1])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  397|      0|#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   61|     81|        } while (false)
  |  |  ------------------
  ------------------
   52|       |
   53|       |        /* libc's setutxent() unfortunately doesn't inform us about success, i.e. whether /var/run/utmp
   54|       |         * exists. Hence we have to check manually first. */
   55|     81|        if (access(UTMPX_FILE, F_OK) < 0) {
  ------------------
  |  Branch (55:13): [True: 0, False: 81]
  ------------------
   56|      0|                if (errno == ENOENT)
  ------------------
  |  Branch (56:21): [True: 0, False: 0]
  ------------------
   57|      0|                        return -ENOPROTOOPT;
   58|       |
   59|      0|                return -errno;
   60|      0|        }
   61|       |
   62|     81|        utmpx = utxent_start();
   63|       |
   64|     81|        while ((u = getutxent())) {
  ------------------
  |  Branch (64:16): [True: 0, False: 81]
  ------------------
   65|      0|                _cleanup_free_ char *p = NULL;
  ------------------
  |  |   82|      0|#define _cleanup_free_ _cleanup_(freep)
  |  |  ------------------
  |  |  |  |   78|      0|#define _cleanup_(x) __attribute__((__cleanup__(x)))
  |  |  ------------------
  ------------------
   66|      0|                const char *tty_path;
   67|      0|                bool is_local;
   68|       |
   69|      0|                if (u->ut_type != USER_PROCESS || isempty(u->ut_user))
  ------------------
  |  Branch (69:21): [True: 0, False: 0]
  |  Branch (69:51): [True: 0, False: 0]
  ------------------
   70|      0|                        continue;
   71|       |
   72|       |                /* This access is fine, because strlen("/dev/") < 32 (UT_LINESIZE) */
   73|      0|                if (path_startswith(u->ut_line, "/dev/"))
  ------------------
  |  Branch (73:21): [True: 0, False: 0]
  ------------------
   74|      0|                        tty_path = u->ut_line;
   75|      0|                else {
   76|      0|                        if (asprintf(&p, "/dev/%.*s", (int) sizeof(u->ut_line), u->ut_line) < 0)
  ------------------
  |  Branch (76:29): [True: 0, False: 0]
  ------------------
   77|      0|                                return -ENOMEM;
   78|       |
   79|      0|                        tty_path = p;
   80|      0|                }
   81|       |
   82|       |                /* It seems that the address field is always set for remote logins. For local logins and
   83|       |                 * other local entries, we get [0,0,0,0]. */
   84|      0|                is_local = eqzero(u->ut_addr_v6);
  ------------------
  |  |   64|      0|#define eqzero(x) memeqzero(x, sizeof(x))
  |  |  ------------------
  |  |  |  |   62|      0|#define memeqzero(data, length) memeqbyte(0x00, data, length)
  |  |  ------------------
  ------------------
   85|       |
   86|      0|                if (!match_tty || match_tty(tty_path, is_local, userdata))
  ------------------
  |  Branch (86:21): [True: 0, False: 0]
  |  Branch (86:35): [True: 0, False: 0]
  ------------------
   87|      0|                        RET_GATHER(r, write_to_terminal(tty_path, message));
  ------------------
  |  |   84|      0|        ({                                      \
  |  |   85|      0|                int *__a = &(acc), __e = (err); \
  |  |   86|      0|                if (*__a >= 0 && __e < 0)       \
  |  |  ------------------
  |  |  |  Branch (86:21): [True: 0, False: 0]
  |  |  |  Branch (86:34): [True: 0, False: 0]
  |  |  ------------------
  |  |   87|      0|                        *__a = __e;             \
  |  |   88|      0|                *__a;                           \
  |  |   89|      0|        })
  ------------------
   88|      0|        }
   89|       |
   90|     81|        return r;
   91|       |
   92|       |#else
   93|       |        return -ENOPROTOOPT;
   94|       |#endif
   95|     81|}

