History

timekeeping: Replace read_boot_clock64() with read_persistent_wall_and_boot_offset()

If architecture does not support exact boot time, it is challenging to estimate boot time without having a reference to the current persistent clock value. Yet, it cannot read the persistent clock time again, because this may lead to math discrepancies with the caller of read_boot_clock64() who have read the persistent clock at a different time. This is why it is better to provide two values simultaneously: the persistent clock value, and the boot time. Replace read_boot_clock64() with: read_persistent_wall_and_boot_offset(wall_time, boot_offset) Where wall_time is returned by read_persistent_clock() And boot_offset is wall_time - boot time, which defaults to 0.

Pavel Tatashin committed 8 years ago

Commit 3eca9931 parent be2e0e42 files · +32 −30Browse files

Showing the changes to include (1 of 2 files). Show all

Unified · Split

include/linux/timekeeping.h+2−1
@@ -243,7 +243,8 @@ extern void ktime_get_snapshot(struct system_time_snapshot *systime_snapshot); · 242 unmodified lines
243extern int persistent_clock_is_local;243extern int persistent_clock_is_local;
244 244
245extern void read_persistent_clock64(struct timespec64 *ts);245extern void read_persistent_clock64(struct timespec64 *ts);
246extern void read_boot_clock64(struct timespec64 *ts);246void read_persistent_clock_and_boot_offset(struct timespec64 *wall_clock,
247 struct timespec64 *boot_offset);
247extern int update_persistent_clock64(struct timespec64 now);248extern int update_persistent_clock64(struct timespec64 now);
248 249
249/*250/*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t