Home
last modified time | relevance | path

Searched refs:ts (Results 1 – 25 of 77) sorted by relevance

1234

/systemd-251/src/basic/
Dtime-util.c51 struct timespec ts; in now() local
53 assert_se(clock_gettime(map_clock_id(clock_id), &ts) == 0); in now()
55 return timespec_load(&ts); in now()
59 struct timespec ts; in now_nsec() local
61 assert_se(clock_gettime(map_clock_id(clock_id), &ts) == 0); in now_nsec()
63 return timespec_load_nsec(&ts); in now_nsec()
66 dual_timestamp* dual_timestamp_get(dual_timestamp *ts) { in dual_timestamp_get() argument
67 assert(ts); in dual_timestamp_get()
69 ts->realtime = now(CLOCK_REALTIME); in dual_timestamp_get()
70 ts->monotonic = now(CLOCK_MONOTONIC); in dual_timestamp_get()
[all …]
Dtime-util.h82 dual_timestamp* dual_timestamp_get(dual_timestamp *ts);
83 dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u);
84 dual_timestamp* dual_timestamp_from_monotonic(dual_timestamp *ts, usec_t u);
85 dual_timestamp* dual_timestamp_from_boottime(dual_timestamp *ts, usec_t u);
87 triple_timestamp* triple_timestamp_get(triple_timestamp *ts);
88 triple_timestamp* triple_timestamp_from_realtime(triple_timestamp *ts, usec_t u);
100 static inline bool dual_timestamp_is_set(const dual_timestamp *ts) { in dual_timestamp_is_set() argument
101 return timestamp_is_set(ts->realtime) || in dual_timestamp_is_set()
102 timestamp_is_set(ts->monotonic); in dual_timestamp_is_set()
105 static inline bool triple_timestamp_is_set(const triple_timestamp *ts) { in triple_timestamp_is_set() argument
[all …]
Dratelimit.c12 usec_t ts; in ratelimit_below() local
19 ts = now(CLOCK_MONOTONIC); in ratelimit_below()
22 usec_sub_unsigned(ts, r->begin) > r->interval) { in ratelimit_below()
23 r->begin = ts; in ratelimit_below()
Dfileio.c134 const struct timespec *ts) { in write_string_stream_ts() argument
145 if (ts) { in write_string_stream_ts()
201 if (ts) { in write_string_stream_ts()
202 const struct timespec twice[2] = {*ts, *ts}; in write_string_stream_ts()
216 const struct timespec *ts) { in write_string_file_atomic() argument
232 r = write_string_stream_ts(f, line, flags, ts); in write_string_file_atomic()
263 const struct timespec *ts) { in write_string_file_ts() argument
283 r = write_string_file_atomic(fn, line, flags, ts); in write_string_file_ts()
289 assert(!ts); in write_string_file_ts()
312 r = write_string_stream_ts(f, line, flags, ts); in write_string_file_ts()
Dfs-util.c305 int futimens_opath(int fd, const struct timespec ts[2]) { in futimens_opath()
308 if (utimensat(AT_FDCWD, FORMAT_PROC_FD_PATH(fd), ts, 0) < 0) { in futimens_opath()
388 struct timespec ts[2]; in touch_file() local
390 timespec_store(&ts[0], stamp); in touch_file()
391 ts[1] = ts[0]; in touch_file()
392 r = futimens_opath(fd, ts); in touch_file()
/systemd-251/src/journal/
Djournald-rate-limit.c102 static bool journal_ratelimit_group_expired(JournalRateLimitGroup *g, usec_t ts) { in journal_ratelimit_group_expired() argument
108 if (g->pools[i].begin + g->interval >= ts) in journal_ratelimit_group_expired()
114 static void journal_ratelimit_vacuum(JournalRateLimit *r, usec_t ts) { in journal_ratelimit_vacuum() argument
121 (r->lru_tail && journal_ratelimit_group_expired(r->lru_tail, ts))) in journal_ratelimit_vacuum()
125 …oup* journal_ratelimit_group_new(JournalRateLimit *r, const char *id, usec_t interval, usec_t ts) { in journal_ratelimit_group_new() argument
143 journal_ratelimit_vacuum(r, ts); in journal_ratelimit_group_new()
192 usec_t ts; in journal_ratelimit_test() local
206 ts = now(CLOCK_MONOTONIC); in journal_ratelimit_test()
218 found = journal_ratelimit_group_new(r, id, rl_interval, ts); in journal_ratelimit_test()
234 p->begin = ts; in journal_ratelimit_test()
[all …]
Dtest-journal-stream.c86 dual_timestamp ts; in run_test() local
89 dual_timestamp_get(&ts); in run_test()
91 if (ts.monotonic <= previous_ts.monotonic) in run_test()
92 ts.monotonic = previous_ts.monotonic + 1; in run_test()
94 if (ts.realtime <= previous_ts.realtime) in run_test()
95 ts.realtime = previous_ts.realtime + 1; in run_test()
97 previous_ts = ts; in run_test()
107 … assert_se(journal_file_append_entry(three->file, &ts, NULL, iovec, 2, NULL, NULL, NULL) == 0); in run_test()
110 … assert_se(journal_file_append_entry(two->file, &ts, NULL, iovec, 2, NULL, NULL, NULL) == 0); in run_test()
112 … assert_se(journal_file_append_entry(one->file, &ts, NULL, iovec, 2, NULL, NULL, NULL) == 0); in run_test()
Djournald-console.c42 struct timespec ts; in server_forward_console() local
43 char tbuf[STRLEN("[] ") + DECIMAL_STR_MAX(ts.tv_sec) + DECIMAL_STR_MAX(ts.tv_nsec)-3 + 1]; in server_forward_console()
58 assert_se(clock_gettime(CLOCK_MONOTONIC, &ts) == 0); in server_forward_console()
60 ts.tv_sec, in server_forward_console()
61 (nsec_t)ts.tv_nsec / 1000); in server_forward_console()
Dtest-journal-interleaving.c53 dual_timestamp ts; in append_number() local
57 dual_timestamp_get(&ts); in append_number()
59 if (ts.monotonic <= previous_ts.monotonic) in append_number()
60 ts.monotonic = previous_ts.monotonic + 1; in append_number()
62 if (ts.realtime <= previous_ts.realtime) in append_number()
63 ts.realtime = previous_ts.realtime + 1; in append_number()
65 previous_ts = ts; in append_number()
69 assert_ret(journal_file_append_entry(f->file, &ts, NULL, iovec, 1, seqnum, NULL, NULL)); in append_number()
Dtest-journal.c28 dual_timestamp ts; in TEST() local
44 assert_se(dual_timestamp_get(&ts)); in TEST()
48 assert_se(journal_file_append_entry(f->file, &ts, NULL, &iovec, 1, NULL, NULL, NULL) == 0); in TEST()
51 assert_se(journal_file_append_entry(f->file, &ts, NULL, &iovec, 1, NULL, NULL, NULL) == 0); in TEST()
54 …assert_se(journal_file_append_entry(f->file, &ts, &fake_boot_id, &iovec, 1, NULL, NULL, NULL) == 0… in TEST()
164 dual_timestamp ts; in check_compressed() local
183 dual_timestamp_get(&ts); in check_compressed()
186 assert_se(journal_file_append_entry(f->file, &ts, NULL, &iovec, 1, NULL, NULL, NULL) == 0); in check_compressed()
Dtest-journal-verify.c89 struct dual_timestamp ts; in main() local
92 dual_timestamp_get(&ts); in main()
98 … assert_se(journal_file_append_entry(df->file, &ts, NULL, &iovec, 1, NULL, NULL, NULL) == 0); in main()
/systemd-251/man/
Djournal-iterate-poll.c16 struct timespec ts; in wait_for_changes() local
18 clock_gettime(CLOCK_MONOTONIC, &ts); in wait_for_changes()
19 n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000; in wait_for_changes()
/systemd-251/src/timedate/
Dtimedated.c712 struct timespec ts; in method_set_timezone() local
716 assert_se(clock_gettime(CLOCK_REALTIME, &ts) == 0); in method_set_timezone()
717 assert_se(localtime_r(&ts.tv_sec, &tm)); in method_set_timezone()
741 struct timespec ts; in method_set_local_rtc() local
785 assert_se(clock_gettime(CLOCK_REALTIME, &ts) == 0); in method_set_local_rtc()
791 localtime_or_gmtime_r(&ts.tv_sec, &tm, !c->local_rtc); in method_set_local_rtc()
799 ts.tv_sec = mktime_or_timegm(&tm, !c->local_rtc); in method_set_local_rtc()
801 if (clock_settime(CLOCK_REALTIME, &ts) < 0) in method_set_local_rtc()
809 localtime_or_gmtime_r(&ts.tv_sec, &tm, !c->local_rtc); in method_set_local_rtc()
831 struct timespec ts; in method_set_time() local
[all …]
/systemd-251/src/timesync/
Dtimesyncd-bus.c158 static usec_t ntp_ts_short_to_usec(const struct ntp_ts_short *ts) { in ntp_ts_short_to_usec() argument
159 … return be16toh(ts->sec) * USEC_PER_SEC + (be16toh(ts->frac) * USEC_PER_SEC) / (usec_t) 0x10000ULL; in ntp_ts_short_to_usec()
162 static usec_t ntp_ts_to_usec(const struct ntp_ts *ts) { in ntp_ts_to_usec() argument
163 …return (be32toh(ts->sec) - OFFSET_1900_1970) * USEC_PER_SEC + (be32toh(ts->frac) * USEC_PER_SEC) /… in ntp_ts_to_usec()
/systemd-251/src/update-done/
Dupdate-done.c17 static int apply_timestamp(const char *path, struct timespec *ts) { in apply_timestamp() argument
29 timespec_load_nsec(ts)) < 0) in apply_timestamp()
32 r = write_string_file_atomic_label_ts(path, message, ts); in apply_timestamp()
/systemd-251/src/shared/
Dkillall.c121 struct timespec ts; in wait_for_children() local
174 timespec_store(&ts, MIN(until - n, date_log_child - n)); in wait_for_children()
176 timespec_store(&ts, until - n); in wait_for_children()
178 k = sigtimedwait(mask, NULL, &ts); in wait_for_children()
Dclock-util.c97 struct timespec ts; in clock_set_timezone() local
102 assert_se(clock_gettime(CLOCK_REALTIME, &ts) == 0); in clock_set_timezone()
103 assert_se(localtime_r(&ts.tv_sec, &tm)); in clock_set_timezone()
Dfileio-label.c9 int write_string_file_atomic_label_ts(const char *fn, const char *line, struct timespec *ts) { in write_string_file_atomic_label_ts() argument
16 r = write_string_file_ts(fn, line, WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC, ts); in write_string_file_atomic_label_ts()
/systemd-251/src/udev/
Dudevadm-monitor.c33 struct timespec ts; in device_monitor_handler() local
42 assert_se(clock_gettime(CLOCK_MONOTONIC, &ts) == 0); in device_monitor_handler()
46 ts.tv_sec, (nsec_t)ts.tv_nsec/1000, in device_monitor_handler()
/systemd-251/src/core/
Dtimer.c374 triple_timestamp ts; in timer_enter_waiting() local
387 triple_timestamp_get(&ts); in timer_enter_waiting()
408 b = ts.realtime; in timer_enter_waiting()
440 base = ts.monotonic; in timer_enter_waiting()
479 … v->next_elapse < triple_timestamp_by_clock(&ts, TIMER_MONOTONIC_CLOCK(t)) && in timer_enter_waiting()
506 …_unsigned(t->next_elapse_monotonic_or_boottime, triple_timestamp_by_clock(&ts, TIMER_MONOTONIC_CLO… in timer_enter_waiting()
805 usec_t ts; in timer_time_change() local
816 ts = now(CLOCK_REALTIME); in timer_time_change()
817 if (t->last_trigger.realtime > ts) in timer_time_change()
818 t->last_trigger.realtime = ts; in timer_time_change()
/systemd-251/src/login/
Dlogind-seat.c592 dual_timestamp ts = DUAL_TIMESTAMP_NULL; in seat_get_idle_hint() local
606 if (k.monotonic > ts.monotonic) in seat_get_idle_hint()
607 ts = k; in seat_get_idle_hint()
610 ts = k; in seat_get_idle_hint()
614 if (k.monotonic > ts.monotonic) in seat_get_idle_hint()
615 ts = k; in seat_get_idle_hint()
620 *t = ts; in seat_get_idle_hint()
Dlogind-core.c402 dual_timestamp ts = DUAL_TIMESTAMP_NULL; in manager_get_idle_hint() local
418 if (k.monotonic < ts.monotonic) in manager_get_idle_hint()
419 ts = k; in manager_get_idle_hint()
422 ts = k; in manager_get_idle_hint()
426 if (k.monotonic > ts.monotonic) in manager_get_idle_hint()
427 ts = k; in manager_get_idle_hint()
432 *t = ts; in manager_get_idle_hint()
/systemd-251/src/journal-remote/
Djournal-remote-write.c63 const dual_timestamp *ts, in writer_write() argument
80 r = journal_file_append_entry(w->journal->file, ts, boot_id, in writer_write()
98 r = journal_file_append_entry(w->journal->file, ts, boot_id, in writer_write()
/systemd-251/src/resolve/
Dresolved-etc-hosts.c294 usec_t ts; in manager_etc_hosts_read() local
297 assert_se(sd_event_now(m->event, CLOCK_BOOTTIME, &ts) >= 0); in manager_etc_hosts_read()
300 if (m->etc_hosts_last != USEC_INFINITY && m->etc_hosts_last + ETC_HOSTS_RECHECK_USEC > ts) in manager_etc_hosts_read()
303 m->etc_hosts_last = ts; in manager_etc_hosts_read()
339 m->etc_hosts_last = ts; in manager_etc_hosts_read()
/systemd-251/src/libsystemd/sd-bus/
Dbus-dump.c59 usec_t ts = m->realtime; in sd_bus_message_dump() local
61 if (ts == 0) in sd_bus_message_dump()
62 ts = now(CLOCK_REALTIME); in sd_bus_message_dump()
90 … fprintf(f, " Timestamp=\"%s\"\n", strna(FORMAT_TIMESTAMP_STYLE(ts, TIMESTAMP_US_UTC))); in sd_bus_message_dump()
594 uint64_t ts; in bus_message_pcap_frame() local
605 ts = m->realtime ?: now(CLOCK_REALTIME); in bus_message_pcap_frame()
618 .timestamp_hi = (uint32_t)(ts >> 32), in bus_message_pcap_frame()
619 .timestamp_lo = (uint32_t)ts, in bus_message_pcap_frame()

1234