All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH lttng-modules] Fix: Add support for 4.6.4-rt8 kernel
       [not found] <1469803967-1071-1-git-send-email-mjeanson@efficios.com>
@ 2016-07-29 22:01 ` Mathieu Desnoyers
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers @ 2016-07-29 22:01 UTC (permalink / raw)
  To: Michael Jeanson; +Cc: lttng-dev

Merged into master and stable-2.8, thanks!

Mathieu

----- On Jul 29, 2016, at 10:52 AM, Michael Jeanson mjeanson@efficios.com wrote:

> Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
> ---
> lib/ringbuffer/ring_buffer_frontend.c | 18 +++++++++---
> wrapper/timer.h                       | 55 +++++++++++++++++++++++++++++++++++
> 2 files changed, 69 insertions(+), 4 deletions(-)
> create mode 100644 wrapper/timer.h
> 
> diff --git a/lib/ringbuffer/ring_buffer_frontend.c
> b/lib/ringbuffer/ring_buffer_frontend.c
> index 379bf95..89eefe9 100644
> --- a/lib/ringbuffer/ring_buffer_frontend.c
> +++ b/lib/ringbuffer/ring_buffer_frontend.c
> @@ -63,6 +63,7 @@
> #include <wrapper/atomic.h>
> #include <wrapper/kref.h>
> #include <wrapper/percpu-defs.h>
> +#include <wrapper/timer.h>
> 
> /*
>  * Internal structure representing offsets to use at a sub-buffer switch.
> @@ -281,7 +282,7 @@ static void switch_buffer_timer(unsigned long data)
> 		lib_ring_buffer_switch_slow(buf, SWITCH_ACTIVE);
> 
> 	if (config->alloc == RING_BUFFER_ALLOC_PER_CPU)
> -		mod_timer_pinned(&buf->switch_timer,
> +		lttng_mod_timer_pinned(&buf->switch_timer,
> 				 jiffies + chan->switch_timer_interval);
> 	else
> 		mod_timer(&buf->switch_timer,
> @@ -298,7 +299,12 @@ static void lib_ring_buffer_start_switch_timer(struct
> lib_ring_buffer *buf)
> 
> 	if (!chan->switch_timer_interval || buf->switch_timer_enabled)
> 		return;
> -	init_timer(&buf->switch_timer);
> +
> +	if (config->alloc == RING_BUFFER_ALLOC_PER_CPU)
> +		lttng_init_timer_pinned(&buf->switch_timer);
> +	else
> +		init_timer(&buf->switch_timer);
> +
> 	buf->switch_timer.function = switch_buffer_timer;
> 	buf->switch_timer.expires = jiffies + chan->switch_timer_interval;
> 	buf->switch_timer.data = (unsigned long)buf;
> @@ -341,7 +347,7 @@ static void read_buffer_timer(unsigned long data)
> 	}
> 
> 	if (config->alloc == RING_BUFFER_ALLOC_PER_CPU)
> -		mod_timer_pinned(&buf->read_timer,
> +		lttng_mod_timer_pinned(&buf->read_timer,
> 				 jiffies + chan->read_timer_interval);
> 	else
> 		mod_timer(&buf->read_timer,
> @@ -361,7 +367,11 @@ static void lib_ring_buffer_start_read_timer(struct
> lib_ring_buffer *buf)
> 	    || buf->read_timer_enabled)
> 		return;
> 
> -	init_timer(&buf->read_timer);
> +	if (config->alloc == RING_BUFFER_ALLOC_PER_CPU)
> +		lttng_init_timer_pinned(&buf->read_timer);
> +	else
> +		init_timer(&buf->read_timer);
> +
> 	buf->read_timer.function = read_buffer_timer;
> 	buf->read_timer.expires = jiffies + chan->read_timer_interval;
> 	buf->read_timer.data = (unsigned long)buf;
> diff --git a/wrapper/timer.h b/wrapper/timer.h
> new file mode 100644
> index 0000000..441a017
> --- /dev/null
> +++ b/wrapper/timer.h
> @@ -0,0 +1,55 @@
> +#ifndef _LTTNG_WRAPPER_TIMER_H
> +#define _LTTNG_WRAPPER_TIMER_H
> +
> +/*
> + * wrapper/timer.h
> + *
> + * wrapper around linux/timer.h.
> + *
> + * Copyright (C) 2016 Michael Jeanson <mjeanson@efficios.com>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; only
> + * version 2.1 of the License.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#include <linux/version.h>
> +#include <linux/timer.h>
> +#include <lttng-kernel-version.h>
> +
> +
> +#if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8))
> +
> +#define lttng_init_timer_pinned(timer)					\
> +	init_timer_pinned(timer)
> +
> +static inline int lttng_mod_timer_pinned(struct timer_list *timer,
> +		unsigned long expires)
> +{
> +	return mod_timer(timer, expires);
> +}
> +
> +#else /* #if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8)) */
> +
> +#define lttng_init_timer_pinned(timer)					\
> +	init_timer(timer)
> +
> +static inline int lttng_mod_timer_pinned(struct timer_list *timer,
> +		unsigned long expires)
> +{
> +	return mod_timer_pinned(timer, expires);
> +}
> +
> +#endif /* #else #if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8))
> */
> +
> +#endif /* _LTTNG_WRAPPER_TIMER_H */
> --
> 2.7.4

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH lttng-modules] Fix: Add support for 4.6.4-rt8 kernel
@ 2016-07-29 14:52 Michael Jeanson
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Jeanson @ 2016-07-29 14:52 UTC (permalink / raw)
  To: lttng-dev

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
---
 lib/ringbuffer/ring_buffer_frontend.c | 18 +++++++++---
 wrapper/timer.h                       | 55 +++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+), 4 deletions(-)
 create mode 100644 wrapper/timer.h

diff --git a/lib/ringbuffer/ring_buffer_frontend.c b/lib/ringbuffer/ring_buffer_frontend.c
index 379bf95..89eefe9 100644
--- a/lib/ringbuffer/ring_buffer_frontend.c
+++ b/lib/ringbuffer/ring_buffer_frontend.c
@@ -63,6 +63,7 @@
 #include <wrapper/atomic.h>
 #include <wrapper/kref.h>
 #include <wrapper/percpu-defs.h>
+#include <wrapper/timer.h>
 
 /*
  * Internal structure representing offsets to use at a sub-buffer switch.
@@ -281,7 +282,7 @@ static void switch_buffer_timer(unsigned long data)
 		lib_ring_buffer_switch_slow(buf, SWITCH_ACTIVE);
 
 	if (config->alloc == RING_BUFFER_ALLOC_PER_CPU)
-		mod_timer_pinned(&buf->switch_timer,
+		lttng_mod_timer_pinned(&buf->switch_timer,
 				 jiffies + chan->switch_timer_interval);
 	else
 		mod_timer(&buf->switch_timer,
@@ -298,7 +299,12 @@ static void lib_ring_buffer_start_switch_timer(struct lib_ring_buffer *buf)
 
 	if (!chan->switch_timer_interval || buf->switch_timer_enabled)
 		return;
-	init_timer(&buf->switch_timer);
+
+	if (config->alloc == RING_BUFFER_ALLOC_PER_CPU)
+		lttng_init_timer_pinned(&buf->switch_timer);
+	else
+		init_timer(&buf->switch_timer);
+
 	buf->switch_timer.function = switch_buffer_timer;
 	buf->switch_timer.expires = jiffies + chan->switch_timer_interval;
 	buf->switch_timer.data = (unsigned long)buf;
@@ -341,7 +347,7 @@ static void read_buffer_timer(unsigned long data)
 	}
 
 	if (config->alloc == RING_BUFFER_ALLOC_PER_CPU)
-		mod_timer_pinned(&buf->read_timer,
+		lttng_mod_timer_pinned(&buf->read_timer,
 				 jiffies + chan->read_timer_interval);
 	else
 		mod_timer(&buf->read_timer,
@@ -361,7 +367,11 @@ static void lib_ring_buffer_start_read_timer(struct lib_ring_buffer *buf)
 	    || buf->read_timer_enabled)
 		return;
 
-	init_timer(&buf->read_timer);
+	if (config->alloc == RING_BUFFER_ALLOC_PER_CPU)
+		lttng_init_timer_pinned(&buf->read_timer);
+	else
+		init_timer(&buf->read_timer);
+
 	buf->read_timer.function = read_buffer_timer;
 	buf->read_timer.expires = jiffies + chan->read_timer_interval;
 	buf->read_timer.data = (unsigned long)buf;
diff --git a/wrapper/timer.h b/wrapper/timer.h
new file mode 100644
index 0000000..441a017
--- /dev/null
+++ b/wrapper/timer.h
@@ -0,0 +1,55 @@
+#ifndef _LTTNG_WRAPPER_TIMER_H
+#define _LTTNG_WRAPPER_TIMER_H
+
+/*
+ * wrapper/timer.h
+ *
+ * wrapper around linux/timer.h.
+ *
+ * Copyright (C) 2016 Michael Jeanson <mjeanson@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; only
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <linux/version.h>
+#include <linux/timer.h>
+#include <lttng-kernel-version.h>
+
+
+#if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8))
+
+#define lttng_init_timer_pinned(timer)					\
+	init_timer_pinned(timer)
+
+static inline int lttng_mod_timer_pinned(struct timer_list *timer,
+		unsigned long expires)
+{
+	return mod_timer(timer, expires);
+}
+
+#else /* #if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8)) */
+
+#define lttng_init_timer_pinned(timer)					\
+	init_timer(timer)
+
+static inline int lttng_mod_timer_pinned(struct timer_list *timer,
+		unsigned long expires)
+{
+	return mod_timer_pinned(timer, expires);
+}
+
+#endif /* #else #if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8)) */
+
+#endif /* _LTTNG_WRAPPER_TIMER_H */
-- 
2.7.4

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-29 22:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1469803967-1071-1-git-send-email-mjeanson@efficios.com>
2016-07-29 22:01 ` [PATCH lttng-modules] Fix: Add support for 4.6.4-rt8 kernel Mathieu Desnoyers
2016-07-29 14:52 Michael Jeanson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.