Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 1 | From d52ab4b9a71a4bef535dadb8e7062112ac5c0c88 Mon Sep 17 00:00:00 2001 |
| 2 | From: Kienan Stewart <kstewart@efficios.com> |
| 3 | Date: Mon, 22 Jan 2024 11:33:39 -0500 |
| 4 | Subject: [PATCH 2/5] Fix: timer_start changed in linux 6.8.0-rc1 |
| 5 | |
| 6 | See upstream commit |
| 7 | |
| 8 | commit dbcdcb62b59db2cf6a24113873b90da15c6f0b19 |
| 9 | Author: Anna-Maria Behnsen <anna-maria@linutronix.de> |
| 10 | Date: Fri Dec 1 10:26:26 2023 +0100 |
| 11 | |
| 12 | tracing/timers: Enhance timer_start tracepoint |
| 13 | |
| 14 | For starting a timer, the timer is enqueued into a bucket of the timer |
| 15 | wheel. The bucket expiry is the defacto expiry of the timer but it is not |
| 16 | equal the timer expiry because of increasing granularity when bucket is in |
| 17 | a higher level of the wheel. To be able to figure out in a trace whether a |
| 18 | timer expired in time or not, the bucket expiry time is required as well. |
| 19 | |
| 20 | Add bucket expiry time to the timer_start tracepoint and thereby simplify |
| 21 | the arguments. |
| 22 | |
| 23 | Upstream-Status: Backport [Uhttps://review.lttng.org/c/lttng-modules/+/11700] |
| 24 | |
| 25 | Change-Id: I4868092765745b1efd0c48f13c0b837f2007dcb6 |
| 26 | Signed-off-by: Kienan Stewart <kstewart@efficios.com> |
| 27 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> |
| 28 | --- |
| 29 | include/instrumentation/events/timer.h | 24 +++++++++++++----------- |
| 30 | 1 file changed, 13 insertions(+), 11 deletions(-) |
| 31 | |
| 32 | diff --git a/include/instrumentation/events/timer.h b/include/instrumentation/events/timer.h |
| 33 | index 91a2cd9..ce571f5 100644 |
| 34 | --- a/include/instrumentation/events/timer.h |
| 35 | +++ b/include/instrumentation/events/timer.h |
| 36 | @@ -45,8 +45,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(timer_class, timer_init, |
| 37 | TP_ARGS(timer) |
| 38 | ) |
| 39 | |
| 40 | -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0) || \ |
| 41 | - LTTNG_RHEL_KERNEL_RANGE(3,10,0,957,0,0, 3,11,0,0,0,0)) |
| 42 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,8,0)) |
| 43 | /** |
| 44 | * timer_start - called when the timer is started |
| 45 | * @timer: pointer to struct timer_list |
| 46 | @@ -55,39 +54,42 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(timer_class, timer_init, |
| 47 | */ |
| 48 | LTTNG_TRACEPOINT_EVENT(timer_start, |
| 49 | |
| 50 | - TP_PROTO(struct timer_list *timer, unsigned long expires, |
| 51 | - unsigned int flags), |
| 52 | + TP_PROTO(struct timer_list *timer, unsigned long bucket_expiry), |
| 53 | |
| 54 | - TP_ARGS(timer, expires, flags), |
| 55 | + TP_ARGS(timer, bucket_expiry), |
| 56 | |
| 57 | TP_FIELDS( |
| 58 | ctf_integer_hex(void *, timer, timer) |
| 59 | ctf_integer_hex(void *, function, timer->function) |
| 60 | - ctf_integer(unsigned long, expires, expires) |
| 61 | + ctf_integer(unsigned long, expires, timer->expires) |
| 62 | + ctf_integer(unsigned long, bucket_expiry, bucket_expiry) |
| 63 | ctf_integer(unsigned long, now, jiffies) |
| 64 | - ctf_integer(unsigned int, flags, flags) |
| 65 | + ctf_integer(unsigned int, flags, timer->flags) |
| 66 | ) |
| 67 | ) |
| 68 | -#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */ |
| 69 | +#else |
| 70 | /** |
| 71 | * timer_start - called when the timer is started |
| 72 | * @timer: pointer to struct timer_list |
| 73 | * @expires: the timers expiry time |
| 74 | + * @flags: the timers expiry time |
| 75 | */ |
| 76 | LTTNG_TRACEPOINT_EVENT(timer_start, |
| 77 | |
| 78 | - TP_PROTO(struct timer_list *timer, unsigned long expires), |
| 79 | + TP_PROTO(struct timer_list *timer, unsigned long expires, |
| 80 | + unsigned int flags), |
| 81 | |
| 82 | - TP_ARGS(timer, expires), |
| 83 | + TP_ARGS(timer, expires, flags), |
| 84 | |
| 85 | TP_FIELDS( |
| 86 | ctf_integer_hex(void *, timer, timer) |
| 87 | ctf_integer_hex(void *, function, timer->function) |
| 88 | ctf_integer(unsigned long, expires, expires) |
| 89 | ctf_integer(unsigned long, now, jiffies) |
| 90 | + ctf_integer(unsigned int, flags, flags) |
| 91 | ) |
| 92 | ) |
| 93 | -#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */ |
| 94 | +#endif |
| 95 | |
| 96 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0) || \ |
| 97 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,193,0,0, 4,19,0,0,0,0)) |
| 98 | -- |
| 99 | 2.39.2 |
| 100 | |