From: Michael Jeanson Date: Tue, 10 Dec 2019 16:41:11 +0000 (-0500) Subject: fix: y2038: itimer: change implementation to timespec64 (v5.5) X-Git-Tag: v2.12.0-pre~14 X-Git-Url: http://git.lttng.org/?p=lttng-modules.git;a=commitdiff_plain;h=7c1dd1200ff7ee8e77ba24872206e3970b84a582 fix: y2038: itimer: change implementation to timespec64 (v5.5) See upstream commit: commit bd40a175769d411b2a37e1c087082ac7ee2c15bb Author: Arnd Bergmann Date: Thu Nov 7 15:27:39 2019 +0100 y2038: itimer: change implementation to timespec64 There is no 64-bit version of getitimer/setitimer since that is not actually needed. However, the implementation is built around the deprecated 'struct timeval' type. Change the code to use timespec64 internally to reduce the dependencies on timeval and associated helper functions. Minor adjustments in the code are needed to make the native and compat version work the same way, and to keep the range check working after the conversion. Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/instrumentation/events/lttng-module/timer.h b/instrumentation/events/lttng-module/timer.h index 997084ff..1a45d82b 100644 --- a/instrumentation/events/lttng-module/timer.h +++ b/instrumentation/events/lttng-module/timer.h @@ -294,7 +294,26 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(timer_hrtimer_class, hrtimer_cancel, * zero, otherwise it is started * @expires: the itimers expiry time */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) +LTTNG_TRACEPOINT_EVENT_MAP(itimer_state, + + timer_itimer_state, + + TP_PROTO(int which, const struct itimerspec64 *const value, + unsigned long long expires), + + TP_ARGS(which, value, expires), + + TP_FIELDS( + ctf_integer(int, which, which) + ctf_integer(unsigned long long, expires, expires) + ctf_integer(long, value_sec, value->it_value.tv_sec) + ctf_integer(long, value_nsec, value->it_value.tv_nsec) + ctf_integer(long, interval_sec, value->it_interval.tv_sec) + ctf_integer(long, interval_nsec, value->it_interval.tv_nsec) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) LTTNG_TRACEPOINT_EVENT_MAP(itimer_state, timer_itimer_state,