summaryrefslogtreecommitdiffstats
path: root/src/journal
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-06-24 15:34:16 +0200
committerGitHub <noreply@github.com>2024-06-24 15:34:16 +0200
commitc53580bf2e5c36f20968feed7db8d10ea9f02962 (patch)
tree5ed12cec09069ace5c54606f21417621b78e2d7c /src/journal
parentMerge pull request #33456 from yuwata/terminal-util (diff)
parentman: drop reference to _SOURCE_MONOTONIC_TIMESTAMP= (diff)
downloadsystemd-c53580bf2e5c36f20968feed7db8d10ea9f02962.tar.xz
systemd-c53580bf2e5c36f20968feed7db8d10ea9f02962.zip
Merge pull request #33401 from yuwata/journal-revert-source-boottime-timestamp
journal: partially revert recent changes
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journald-kmsg.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c
index 4123fda5f9..95135decaa 100644
--- a/src/journal/journald-kmsg.c
+++ b/src/journal/journald-kmsg.c
@@ -258,11 +258,9 @@ void dev_kmsg_record(Server *s, char *p, size_t l) {
iovec[n++] = IOVEC_MAKE_STRING(source_boot_time);
/* Historically, we stored the timestamp 'usec' as _SOURCE_MONOTONIC_TIMESTAMP, so we cannot remove
- * the field as it is already used in other projects. So, let's store the correct timestamp here by
- * mapping the boottime to monotonic. Then, the existence of _SOURCE_BOOTTIME_TIMESTAMP indicates
- * the reliability of _SOURCE_MONOTONIC_TIMESTAMP field. */
+ * the field as it is already used in other projects. This is for backward compatibility. */
char source_monotonic_time[STRLEN("_SOURCE_MONOTONIC_TIMESTAMP=") + DECIMAL_STR_MAX(unsigned long long)];
- xsprintf(source_monotonic_time, "_SOURCE_MONOTONIC_TIMESTAMP="USEC_FMT, map_clock_usec(usec, CLOCK_BOOTTIME, CLOCK_MONOTONIC));
+ xsprintf(source_monotonic_time, "_SOURCE_MONOTONIC_TIMESTAMP=%llu", usec);
iovec[n++] = IOVEC_MAKE_STRING(source_monotonic_time);
iovec[n++] = IOVEC_MAKE_STRING("_TRANSPORT=kernel");