Loading include/linux/alarmtimer.h +3 −3 Original line number Diff line number Diff line Loading @@ -26,10 +26,10 @@ enum alarmtimer_restart { * struct alarm - Alarm timer structure * @node: timerqueue node for adding to the event list this value * also includes the expiration time. * @period: Period for recuring alarms * @timer: hrtimer used to schedule events while running * @function: Function pointer to be executed when the timer fires. * @type: Alarm type (BOOTTIME/REALTIME) * @enabled: Flag that represents if the alarm is set to fire or not * @type: Alarm type (BOOTTIME/REALTIME). * @state: Flag that represents if the alarm is set to fire or not. * @data: Internal data value. */ struct alarm { Loading include/linux/time.h +14 −1 Original line number Diff line number Diff line Loading @@ -205,7 +205,20 @@ struct tm { int tm_yday; }; void time_to_tm(time_t totalsecs, int offset, struct tm *result); void time64_to_tm(time64_t totalsecs, int offset, struct tm *result); /** * time_to_tm - converts the calendar time to local broken-down time * * @totalsecs the number of seconds elapsed since 00:00:00 on January 1, 1970, * Coordinated Universal Time (UTC). * @offset offset seconds adding to totalsecs. * @result pointer to struct tm variable to receive broken-down time */ static inline void time_to_tm(time_t totalsecs, int offset, struct tm *result) { time64_to_tm(totalsecs, offset, result); } /** * timespec_to_ns - Convert timespec to nanoseconds Loading kernel/time/alarmtimer.c +0 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ * struct alarm_base - Alarm timer bases * @lock: Lock for syncrhonized access to the base * @timerqueue: Timerqueue head managing the list of events * @timer: hrtimer used to schedule events while running * @gettime: Function to read the time correlating to the base * @base_clockid: clockid for the base */ Loading kernel/time/clocksource.c +5 −3 Original line number Diff line number Diff line Loading @@ -669,10 +669,12 @@ static void clocksource_enqueue(struct clocksource *cs) struct list_head *entry = &clocksource_list; struct clocksource *tmp; list_for_each_entry(tmp, &clocksource_list, list) list_for_each_entry(tmp, &clocksource_list, list) { /* Keep track of the place, where to insert */ if (tmp->rating >= cs->rating) if (tmp->rating < cs->rating) break; entry = &tmp->list; } list_add(&cs->list, entry); } Loading kernel/time/test_udelay.c +8 −8 Original line number Diff line number Diff line Loading @@ -43,13 +43,13 @@ static int udelay_test_single(struct seq_file *s, int usecs, uint32_t iters) int allowed_error_ns = usecs * 5; for (i = 0; i < iters; ++i) { struct timespec ts1, ts2; s64 kt1, kt2; int time_passed; ktime_get_ts(&ts1); kt1 = ktime_get_ns(); udelay(usecs); ktime_get_ts(&ts2); time_passed = timespec_to_ns(&ts2) - timespec_to_ns(&ts1); kt2 = ktime_get_ns(); time_passed = kt2 - kt1; if (i == 0 || time_passed < min) min = time_passed; Loading Loading @@ -87,11 +87,11 @@ static int udelay_test_show(struct seq_file *s, void *v) if (usecs > 0 && iters > 0) { return udelay_test_single(s, usecs, iters); } else if (usecs == 0) { struct timespec ts; struct timespec64 ts; ktime_get_ts(&ts); seq_printf(s, "udelay() test (lpj=%ld kt=%ld.%09ld)\n", loops_per_jiffy, ts.tv_sec, ts.tv_nsec); ktime_get_ts64(&ts); seq_printf(s, "udelay() test (lpj=%ld kt=%lld.%09ld)\n", loops_per_jiffy, (s64)ts.tv_sec, ts.tv_nsec); seq_puts(s, "usage:\n"); seq_puts(s, "echo USECS [ITERS] > " DEBUGFS_FILENAME "\n"); seq_puts(s, "cat " DEBUGFS_FILENAME "\n"); Loading Loading
include/linux/alarmtimer.h +3 −3 Original line number Diff line number Diff line Loading @@ -26,10 +26,10 @@ enum alarmtimer_restart { * struct alarm - Alarm timer structure * @node: timerqueue node for adding to the event list this value * also includes the expiration time. * @period: Period for recuring alarms * @timer: hrtimer used to schedule events while running * @function: Function pointer to be executed when the timer fires. * @type: Alarm type (BOOTTIME/REALTIME) * @enabled: Flag that represents if the alarm is set to fire or not * @type: Alarm type (BOOTTIME/REALTIME). * @state: Flag that represents if the alarm is set to fire or not. * @data: Internal data value. */ struct alarm { Loading
include/linux/time.h +14 −1 Original line number Diff line number Diff line Loading @@ -205,7 +205,20 @@ struct tm { int tm_yday; }; void time_to_tm(time_t totalsecs, int offset, struct tm *result); void time64_to_tm(time64_t totalsecs, int offset, struct tm *result); /** * time_to_tm - converts the calendar time to local broken-down time * * @totalsecs the number of seconds elapsed since 00:00:00 on January 1, 1970, * Coordinated Universal Time (UTC). * @offset offset seconds adding to totalsecs. * @result pointer to struct tm variable to receive broken-down time */ static inline void time_to_tm(time_t totalsecs, int offset, struct tm *result) { time64_to_tm(totalsecs, offset, result); } /** * timespec_to_ns - Convert timespec to nanoseconds Loading
kernel/time/alarmtimer.c +0 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ * struct alarm_base - Alarm timer bases * @lock: Lock for syncrhonized access to the base * @timerqueue: Timerqueue head managing the list of events * @timer: hrtimer used to schedule events while running * @gettime: Function to read the time correlating to the base * @base_clockid: clockid for the base */ Loading
kernel/time/clocksource.c +5 −3 Original line number Diff line number Diff line Loading @@ -669,10 +669,12 @@ static void clocksource_enqueue(struct clocksource *cs) struct list_head *entry = &clocksource_list; struct clocksource *tmp; list_for_each_entry(tmp, &clocksource_list, list) list_for_each_entry(tmp, &clocksource_list, list) { /* Keep track of the place, where to insert */ if (tmp->rating >= cs->rating) if (tmp->rating < cs->rating) break; entry = &tmp->list; } list_add(&cs->list, entry); } Loading
kernel/time/test_udelay.c +8 −8 Original line number Diff line number Diff line Loading @@ -43,13 +43,13 @@ static int udelay_test_single(struct seq_file *s, int usecs, uint32_t iters) int allowed_error_ns = usecs * 5; for (i = 0; i < iters; ++i) { struct timespec ts1, ts2; s64 kt1, kt2; int time_passed; ktime_get_ts(&ts1); kt1 = ktime_get_ns(); udelay(usecs); ktime_get_ts(&ts2); time_passed = timespec_to_ns(&ts2) - timespec_to_ns(&ts1); kt2 = ktime_get_ns(); time_passed = kt2 - kt1; if (i == 0 || time_passed < min) min = time_passed; Loading Loading @@ -87,11 +87,11 @@ static int udelay_test_show(struct seq_file *s, void *v) if (usecs > 0 && iters > 0) { return udelay_test_single(s, usecs, iters); } else if (usecs == 0) { struct timespec ts; struct timespec64 ts; ktime_get_ts(&ts); seq_printf(s, "udelay() test (lpj=%ld kt=%ld.%09ld)\n", loops_per_jiffy, ts.tv_sec, ts.tv_nsec); ktime_get_ts64(&ts); seq_printf(s, "udelay() test (lpj=%ld kt=%lld.%09ld)\n", loops_per_jiffy, (s64)ts.tv_sec, ts.tv_nsec); seq_puts(s, "usage:\n"); seq_puts(s, "echo USECS [ITERS] > " DEBUGFS_FILENAME "\n"); seq_puts(s, "cat " DEBUGFS_FILENAME "\n"); Loading