diff -pruN 2.12.2-1/debian/changelog 2.12.2-1ubuntu2/debian/changelog
--- 2.12.2-1/debian/changelog	2020-08-05 17:52:08.000000000 +0000
+++ 2.12.2-1ubuntu2/debian/changelog	2020-11-26 11:07:33.000000000 +0000
@@ -1,3 +1,16 @@
+lttng-modules (2.12.2-1ubuntu2) hirsute; urgency=medium
+
+  * Import upstream/stable-2.12 fixes for Linux 5.9 && 5.10:
+    https://github.com/lttng/lttng-modules.git
+
+ -- Paolo Pisati <paolo.pisati@canonical.com>  Thu, 26 Nov 2020 11:07:33 +0000
+
+lttng-modules (2.12.2-1ubuntu1) groovy; urgency=medium
+
+  * fix build bug with kernel 5.8. (LP: #1896077)
+
+ -- Andrea Righi <andrea.righi@canonical.com>  Wed, 16 Sep 2020 14:26:51 +0000
+
 lttng-modules (2.12.2-1) unstable; urgency=medium
 
   * [5de8762] New upstream version 2.12.2
diff -pruN 2.12.2-1/debian/patches/0001-fix-removal-of-smp_-read_barrier_depends-v5.9.patch 2.12.2-1ubuntu2/debian/patches/0001-fix-removal-of-smp_-read_barrier_depends-v5.9.patch
--- 2.12.2-1/debian/patches/0001-fix-removal-of-smp_-read_barrier_depends-v5.9.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.12.2-1ubuntu2/debian/patches/0001-fix-removal-of-smp_-read_barrier_depends-v5.9.patch	2020-11-26 11:07:33.000000000 +0000
@@ -0,0 +1,389 @@
+From d135aacfc3671c0f0a63be7f408a20756a6b5d04 Mon Sep 17 00:00:00 2001
+From: Michael Jeanson <mjeanson@efficios.com>
+Date: Tue, 25 Aug 2020 10:56:29 -0400
+Subject: [PATCH 1/6] fix: removal of [smp_]read_barrier_depends (v5.9)
+
+See upstream commits:
+
+  commit 76ebbe78f7390aee075a7f3768af197ded1bdfbb
+  Author: Will Deacon <will@kernel.org>
+  Date:   Tue Oct 24 11:22:47 2017 +0100
+
+    locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE()
+
+    In preparation for the removal of lockless_dereference(), which is the
+    same as READ_ONCE() on all architectures other than Alpha, add an
+    implicit smp_read_barrier_depends() to READ_ONCE() so that it can be
+    used to head dependency chains on all architectures.
+
+  commit 76ebbe78f7390aee075a7f3768af197ded1bdfbb
+  Author: Will Deacon <will.deacon@arm.com>
+  Date:   Tue Oct 24 11:22:47 2017 +0100
+
+    locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE()
+
+    In preparation for the removal of lockless_dereference(), which is the
+    same as READ_ONCE() on all architectures other than Alpha, add an
+    implicit smp_read_barrier_depends() to READ_ONCE() so that it can be
+    used to head dependency chains on all architectures.
+
+Change-Id: Ife8880bd9378dca2972da8838f40fc35ccdfaaac
+Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+---
+ instrumentation/events/lttng-module/i2c.h |  4 ++--
+ lib/ringbuffer/backend.h                  |  2 +-
+ lib/ringbuffer/backend_internal.h         |  2 +-
+ lib/ringbuffer/frontend.h                 |  4 ++--
+ lib/ringbuffer/ring_buffer_frontend.c     |  4 ++--
+ lib/ringbuffer/ring_buffer_iterator.c     |  2 +-
+ lttng-events.c                            |  8 ++++----
+ probes/lttng-kprobes.c                    |  6 +++---
+ probes/lttng-kretprobes.c                 |  6 +++---
+ probes/lttng-tracepoint-event-impl.h      | 12 ++++++------
+ probes/lttng-uprobes.c                    |  6 +++---
+ wrapper/compiler.h                        | 18 ++++++++++++++++++
+ wrapper/trace-clock.h                     | 15 +++++----------
+ 13 files changed, 51 insertions(+), 38 deletions(-)
+
+diff --git a/instrumentation/events/lttng-module/i2c.h b/instrumentation/events/lttng-module/i2c.h
+index dcbabf6f..131d1344 100644
+--- a/instrumentation/events/lttng-module/i2c.h
++++ b/instrumentation/events/lttng-module/i2c.h
+@@ -23,7 +23,7 @@ LTTNG_TRACEPOINT_EVENT_CODE(i2c_write,
+ 
+ 	TP_code_pre(
+ 		tp_locvar->extract_sensitive_payload =
+-			READ_ONCE(extract_sensitive_payload);
++			LTTNG_READ_ONCE(extract_sensitive_payload);
+ 	),
+ 
+ 	TP_FIELDS(
+@@ -78,7 +78,7 @@ LTTNG_TRACEPOINT_EVENT_CODE(i2c_reply,
+ 
+ 	TP_code_pre(
+ 		tp_locvar->extract_sensitive_payload =
+-			READ_ONCE(extract_sensitive_payload);
++			LTTNG_READ_ONCE(extract_sensitive_payload);
+ 	),
+ 
+ 	TP_FIELDS(
+diff --git a/lib/ringbuffer/backend.h b/lib/ringbuffer/backend.h
+index da937f29..43e1d475 100644
+--- a/lib/ringbuffer/backend.h
++++ b/lib/ringbuffer/backend.h
+@@ -156,7 +156,7 @@ size_t lib_ring_buffer_do_strcpy(const struct lib_ring_buffer_config *config,
+ 		 * Only read source character once, in case it is
+ 		 * modified concurrently.
+ 		 */
+-		c = READ_ONCE(src[count]);
++		c = LTTNG_READ_ONCE(src[count]);
+ 		if (!c)
+ 			break;
+ 		lib_ring_buffer_do_copy(config, &dest[count], &c, 1);
+diff --git a/lib/ringbuffer/backend_internal.h b/lib/ringbuffer/backend_internal.h
+index 2d6a3453..1226fd8f 100644
+--- a/lib/ringbuffer/backend_internal.h
++++ b/lib/ringbuffer/backend_internal.h
+@@ -367,7 +367,7 @@ void lib_ring_buffer_clear_noref(const struct lib_ring_buffer_config *config,
+ 	 * Performing a volatile access to read the sb_pages, because we want to
+ 	 * read a coherent version of the pointer and the associated noref flag.
+ 	 */
+-	id = READ_ONCE(bufb->buf_wsb[idx].id);
++	id = LTTNG_READ_ONCE(bufb->buf_wsb[idx].id);
+ 	for (;;) {
+ 		/* This check is called on the fast path for each record. */
+ 		if (likely(!subbuffer_id_is_noref(config, id))) {
+diff --git a/lib/ringbuffer/frontend.h b/lib/ringbuffer/frontend.h
+index 6f516d98..41382fe8 100644
+--- a/lib/ringbuffer/frontend.h
++++ b/lib/ringbuffer/frontend.h
+@@ -79,7 +79,7 @@ void *channel_destroy(struct channel *chan);
+ #define for_each_channel_cpu(cpu, chan)					\
+ 	for ((cpu) = -1;						\
+ 		({ (cpu) = cpumask_next(cpu, (chan)->backend.cpumask);	\
+-		   smp_read_barrier_depends(); (cpu) < nr_cpu_ids; });)
++		   smp_rmb(); (cpu) < nr_cpu_ids; });)
+ 
+ extern struct lib_ring_buffer *channel_get_ring_buffer(
+ 				const struct lib_ring_buffer_config *config,
+@@ -155,7 +155,7 @@ static inline
+ int lib_ring_buffer_is_finalized(const struct lib_ring_buffer_config *config,
+ 				 struct lib_ring_buffer *buf)
+ {
+-	int finalized = READ_ONCE(buf->finalized);
++	int finalized = LTTNG_READ_ONCE(buf->finalized);
+ 	/*
+ 	 * Read finalized before counters.
+ 	 */
+diff --git a/lib/ringbuffer/ring_buffer_frontend.c b/lib/ringbuffer/ring_buffer_frontend.c
+index 3cab3652..4980d20e 100644
+--- a/lib/ringbuffer/ring_buffer_frontend.c
++++ b/lib/ringbuffer/ring_buffer_frontend.c
+@@ -1074,7 +1074,7 @@ int lib_ring_buffer_snapshot(struct lib_ring_buffer *buf,
+ 	int finalized;
+ 
+ retry:
+-	finalized = READ_ONCE(buf->finalized);
++	finalized = LTTNG_READ_ONCE(buf->finalized);
+ 	/*
+ 	 * Read finalized before counters.
+ 	 */
+@@ -1245,7 +1245,7 @@ int lib_ring_buffer_get_subbuf(struct lib_ring_buffer *buf,
+ 		return -EBUSY;
+ 	}
+ retry:
+-	finalized = READ_ONCE(buf->finalized);
++	finalized = LTTNG_READ_ONCE(buf->finalized);
+ 	/*
+ 	 * Read finalized before counters.
+ 	 */
+diff --git a/lib/ringbuffer/ring_buffer_iterator.c b/lib/ringbuffer/ring_buffer_iterator.c
+index d25db725..7b4f20a5 100644
+--- a/lib/ringbuffer/ring_buffer_iterator.c
++++ b/lib/ringbuffer/ring_buffer_iterator.c
+@@ -46,7 +46,7 @@ restart:
+ 	switch (iter->state) {
+ 	case ITER_GET_SUBBUF:
+ 		ret = lib_ring_buffer_get_next_subbuf(buf);
+-		if (ret && !READ_ONCE(buf->finalized)
++		if (ret && !LTTNG_READ_ONCE(buf->finalized)
+ 		    && config->alloc == RING_BUFFER_ALLOC_GLOBAL) {
+ 			/*
+ 			 * Use "pull" scheme for global buffers. The reader
+diff --git a/lttng-events.c b/lttng-events.c
+index be7e3897..d7192947 100644
+--- a/lttng-events.c
++++ b/lttng-events.c
+@@ -1719,7 +1719,7 @@ int lttng_metadata_printf(struct lttng_session *session,
+ 	size_t len;
+ 	va_list ap;
+ 
+-	WARN_ON_ONCE(!READ_ONCE(session->active));
++	WARN_ON_ONCE(!LTTNG_READ_ONCE(session->active));
+ 
+ 	va_start(ap, fmt);
+ 	str = kvasprintf(GFP_KERNEL, fmt, ap);
+@@ -2305,7 +2305,7 @@ int _lttng_event_metadata_statedump(struct lttng_session *session,
+ {
+ 	int ret = 0;
+ 
+-	if (event->metadata_dumped || !READ_ONCE(session->active))
++	if (event->metadata_dumped || !LTTNG_READ_ONCE(session->active))
+ 		return 0;
+ 	if (chan->channel_type == METADATA_CHANNEL)
+ 		return 0;
+@@ -2377,7 +2377,7 @@ int _lttng_channel_metadata_statedump(struct lttng_session *session,
+ {
+ 	int ret = 0;
+ 
+-	if (chan->metadata_dumped || !READ_ONCE(session->active))
++	if (chan->metadata_dumped || !LTTNG_READ_ONCE(session->active))
+ 		return 0;
+ 
+ 	if (chan->channel_type == METADATA_CHANNEL)
+@@ -2604,7 +2604,7 @@ int _lttng_session_metadata_statedump(struct lttng_session *session)
+ 	struct lttng_event *event;
+ 	int ret = 0;
+ 
+-	if (!READ_ONCE(session->active))
++	if (!LTTNG_READ_ONCE(session->active))
+ 		return 0;
+ 
+ 	lttng_metadata_begin(session);
+diff --git a/probes/lttng-kprobes.c b/probes/lttng-kprobes.c
+index a44eaa11..38fb72e8 100644
+--- a/probes/lttng-kprobes.c
++++ b/probes/lttng-kprobes.c
+@@ -31,11 +31,11 @@ int lttng_kprobes_handler_pre(struct kprobe *p, struct pt_regs *regs)
+ 	int ret;
+ 	unsigned long data = (unsigned long) p->addr;
+ 
+-	if (unlikely(!READ_ONCE(chan->session->active)))
++	if (unlikely(!LTTNG_READ_ONCE(chan->session->active)))
+ 		return 0;
+-	if (unlikely(!READ_ONCE(chan->enabled)))
++	if (unlikely(!LTTNG_READ_ONCE(chan->enabled)))
+ 		return 0;
+-	if (unlikely(!READ_ONCE(event->enabled)))
++	if (unlikely(!LTTNG_READ_ONCE(event->enabled)))
+ 		return 0;
+ 
+ 	lib_ring_buffer_ctx_init(&ctx, chan->chan, &lttng_probe_ctx, sizeof(data),
+diff --git a/probes/lttng-kretprobes.c b/probes/lttng-kretprobes.c
+index ab98ff22..a6bcd218 100644
+--- a/probes/lttng-kretprobes.c
++++ b/probes/lttng-kretprobes.c
+@@ -51,11 +51,11 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
+ 		unsigned long parent_ip;
+ 	} payload;
+ 
+-	if (unlikely(!READ_ONCE(chan->session->active)))
++	if (unlikely(!LTTNG_READ_ONCE(chan->session->active)))
+ 		return 0;
+-	if (unlikely(!READ_ONCE(chan->enabled)))
++	if (unlikely(!LTTNG_READ_ONCE(chan->enabled)))
+ 		return 0;
+-	if (unlikely(!READ_ONCE(event->enabled)))
++	if (unlikely(!LTTNG_READ_ONCE(event->enabled)))
+ 		return 0;
+ 
+ 	payload.ip = (unsigned long) krpi->rp->kp.addr;
+diff --git a/probes/lttng-tracepoint-event-impl.h b/probes/lttng-tracepoint-event-impl.h
+index 77b86389..72a669e9 100644
+--- a/probes/lttng-tracepoint-event-impl.h
++++ b/probes/lttng-tracepoint-event-impl.h
+@@ -1132,11 +1132,11 @@ static void __event_probe__##_name(void *__data, _proto)		      \
+ 									      \
+ 	if (!_TP_SESSION_CHECK(session, __session))			      \
+ 		return;							      \
+-	if (unlikely(!READ_ONCE(__session->active)))			      \
++	if (unlikely(!LTTNG_READ_ONCE(__session->active)))		      \
+ 		return;							      \
+-	if (unlikely(!READ_ONCE(__chan->enabled)))			      \
++	if (unlikely(!LTTNG_READ_ONCE(__chan->enabled)))		      \
+ 		return;							      \
+-	if (unlikely(!READ_ONCE(__event->enabled)))			      \
++	if (unlikely(!LTTNG_READ_ONCE(__event->enabled)))		      \
+ 		return;							      \
+ 	__lf = lttng_rcu_dereference(__session->pid_tracker.p);		      \
+ 	if (__lf && likely(!lttng_id_tracker_lookup(__lf, current->tgid)))    \
+@@ -1225,11 +1225,11 @@ static void __event_probe__##_name(void *__data)			      \
+ 									      \
+ 	if (!_TP_SESSION_CHECK(session, __session))			      \
+ 		return;							      \
+-	if (unlikely(!READ_ONCE(__session->active)))			      \
++	if (unlikely(!LTTNG_READ_ONCE(__session->active)))		      \
+ 		return;							      \
+-	if (unlikely(!READ_ONCE(__chan->enabled)))			      \
++	if (unlikely(!LTTNG_READ_ONCE(__chan->enabled)))		      \
+ 		return;							      \
+-	if (unlikely(!READ_ONCE(__event->enabled)))			      \
++	if (unlikely(!LTTNG_READ_ONCE(__event->enabled)))		      \
+ 		return;							      \
+ 	__lf = lttng_rcu_dereference(__session->pid_tracker.p);		      \
+ 	if (__lf && likely(!lttng_id_tracker_lookup(__lf, current->tgid)))    \
+diff --git a/probes/lttng-uprobes.c b/probes/lttng-uprobes.c
+index bc101289..bda1d9b4 100644
+--- a/probes/lttng-uprobes.c
++++ b/probes/lttng-uprobes.c
+@@ -40,11 +40,11 @@ int lttng_uprobes_handler_pre(struct uprobe_consumer *uc, struct pt_regs *regs)
+ 		unsigned long ip;
+ 	} payload;
+ 
+-	if (unlikely(!READ_ONCE(chan->session->active)))
++	if (unlikely(!LTTNG_READ_ONCE(chan->session->active)))
+ 		return 0;
+-	if (unlikely(!READ_ONCE(chan->enabled)))
++	if (unlikely(!LTTNG_READ_ONCE(chan->enabled)))
+ 		return 0;
+-	if (unlikely(!READ_ONCE(event->enabled)))
++	if (unlikely(!LTTNG_READ_ONCE(event->enabled)))
+ 		return 0;
+ 
+ 	lib_ring_buffer_ctx_init(&ctx, chan->chan, &lttng_probe_ctx,
+diff --git a/wrapper/compiler.h b/wrapper/compiler.h
+index 1496f33e..b9f8c518 100644
+--- a/wrapper/compiler.h
++++ b/wrapper/compiler.h
+@@ -9,6 +9,7 @@
+ #define _LTTNG_WRAPPER_COMPILER_H
+ 
+ #include <linux/compiler.h>
++#include <linux/version.h>
+ 
+ /*
+  * Don't allow compiling with buggy compiler.
+@@ -39,4 +40,21 @@
+ # define WRITE_ONCE(x, val)	({ ACCESS_ONCE(x) = val; })
+ #endif
+ 
++/*
++ * In v4.15 a smp read barrier was added to READ_ONCE to replace
++ * lockless_dereference(), replicate this behavior on prior kernels
++ * and remove calls to smp_read_barrier_depends which was dropped
++ * in v5.9.
++ */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
++#define LTTNG_READ_ONCE(x)	READ_ONCE(x)
++#else
++#define LTTNG_READ_ONCE(x)			\
++({						\
++	typeof(x) __val = READ_ONCE(x);		\
++	smp_read_barrier_depends();		\
++	__val;					\
++})
++#endif
++
+ #endif /* _LTTNG_WRAPPER_COMPILER_H */
+diff --git a/wrapper/trace-clock.h b/wrapper/trace-clock.h
+index 9f4e366a..187fc82b 100644
+--- a/wrapper/trace-clock.h
++++ b/wrapper/trace-clock.h
+@@ -160,33 +160,30 @@ static inline void put_trace_clock(void)
+ 
+ static inline u64 trace_clock_read64(void)
+ {
+-	struct lttng_trace_clock *ltc = READ_ONCE(lttng_trace_clock);
++	struct lttng_trace_clock *ltc = LTTNG_READ_ONCE(lttng_trace_clock);
+ 
+ 	if (likely(!ltc)) {
+ 		return trace_clock_read64_monotonic();
+ 	} else {
+-		read_barrier_depends();	/* load ltc before content */
+ 		return ltc->read64();
+ 	}
+ }
+ 
+ static inline u64 trace_clock_freq(void)
+ {
+-	struct lttng_trace_clock *ltc = READ_ONCE(lttng_trace_clock);
++	struct lttng_trace_clock *ltc = LTTNG_READ_ONCE(lttng_trace_clock);
+ 
+ 	if (!ltc) {
+ 		return trace_clock_freq_monotonic();
+ 	} else {
+-		read_barrier_depends();	/* load ltc before content */
+ 		return ltc->freq();
+ 	}
+ }
+ 
+ static inline int trace_clock_uuid(char *uuid)
+ {
+-	struct lttng_trace_clock *ltc = READ_ONCE(lttng_trace_clock);
++	struct lttng_trace_clock *ltc = LTTNG_READ_ONCE(lttng_trace_clock);
+ 
+-	read_barrier_depends();	/* load ltc before content */
+ 	/* Use default UUID cb when NULL */
+ 	if (!ltc || !ltc->uuid) {
+ 		return trace_clock_uuid_monotonic(uuid);
+@@ -197,24 +194,22 @@ static inline int trace_clock_uuid(char *uuid)
+ 
+ static inline const char *trace_clock_name(void)
+ {
+-	struct lttng_trace_clock *ltc = READ_ONCE(lttng_trace_clock);
++	struct lttng_trace_clock *ltc = LTTNG_READ_ONCE(lttng_trace_clock);
+ 
+ 	if (!ltc) {
+ 		return trace_clock_name_monotonic();
+ 	} else {
+-		read_barrier_depends();	/* load ltc before content */
+ 		return ltc->name();
+ 	}
+ }
+ 
+ static inline const char *trace_clock_description(void)
+ {
+-	struct lttng_trace_clock *ltc = READ_ONCE(lttng_trace_clock);
++	struct lttng_trace_clock *ltc = LTTNG_READ_ONCE(lttng_trace_clock);
+ 
+ 	if (!ltc) {
+ 		return trace_clock_description_monotonic();
+ 	} else {
+-		read_barrier_depends();	/* load ltc before content */
+ 		return ltc->description();
+ 	}
+ }
+-- 
+2.29.2
+
diff -pruN 2.12.2-1/debian/patches/0002-fix-don-t-allow-userspace-copy-to-read-kernel-memory.patch 2.12.2-1ubuntu2/debian/patches/0002-fix-don-t-allow-userspace-copy-to-read-kernel-memory.patch
--- 2.12.2-1/debian/patches/0002-fix-don-t-allow-userspace-copy-to-read-kernel-memory.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.12.2-1ubuntu2/debian/patches/0002-fix-don-t-allow-userspace-copy-to-read-kernel-memory.patch	2020-11-26 11:07:33.000000000 +0000
@@ -0,0 +1,201 @@
+From 7d68291ddfb480540903b9727a886826a019e534 Mon Sep 17 00:00:00 2001
+From: Michael Jeanson <mjeanson@efficios.com>
+Date: Fri, 25 Sep 2020 16:05:00 -0400
+Subject: [PATCH 2/6] fix: don't allow userspace copy to read kernel memory
+
+This patch fixes a security issue which allows the root user to read
+arbitrary kernel memory. Considering the security model used in LTTng
+userspace tooling for kernel tracing, this bug also allows members of
+the 'tracing' group to read arbitrary kernel memory.
+
+Calls to __copy_from_user_inatomic() where wrongly enclosed in
+set_fs(KERNEL_DS) defeating the access_ok() calls and allowing to read
+from kernel memory if a kernel address is provided.
+
+Remove all set_fs() calls around __copy_from_user_inatomic().
+
+As a side effect this will allow us to support v5.10 which should remove
+set_fs().
+
+Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+Change-Id: I35e4562c835217352c012ed96a7b8f93e941381e
+---
+ lib/ringbuffer/backend.h   | 12 ------------
+ lttng-filter-interpreter.c | 16 ++++------------
+ probes/lttng-probe-user.c  |  4 ----
+ 3 files changed, 4 insertions(+), 28 deletions(-)
+
+diff --git a/lib/ringbuffer/backend.h b/lib/ringbuffer/backend.h
+index 43e1d475..855f1e01 100644
+--- a/lib/ringbuffer/backend.h
++++ b/lib/ringbuffer/backend.h
+@@ -277,7 +277,6 @@ void lib_ring_buffer_copy_from_user_inatomic(const struct lib_ring_buffer_config
+ 	size_t offset = ctx->buf_offset;
+ 	struct lib_ring_buffer_backend_pages *backend_pages;
+ 	unsigned long ret;
+-	mm_segment_t old_fs = get_fs();
+ 
+ 	if (unlikely(!len))
+ 		return;
+@@ -287,7 +286,6 @@ void lib_ring_buffer_copy_from_user_inatomic(const struct lib_ring_buffer_config
+ 	index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT;
+ 	pagecpy = min_t(size_t, len, (-offset) & ~PAGE_MASK);
+ 
+-	set_fs(KERNEL_DS);
+ 	pagefault_disable();
+ 	if (unlikely(!lttng_access_ok(VERIFY_READ, src, len)))
+ 		goto fill_buffer;
+@@ -304,14 +302,12 @@ void lib_ring_buffer_copy_from_user_inatomic(const struct lib_ring_buffer_config
+ 		_lib_ring_buffer_copy_from_user_inatomic(bufb, offset, src, len, 0);
+ 	}
+ 	pagefault_enable();
+-	set_fs(old_fs);
+ 	ctx->buf_offset += len;
+ 
+ 	return;
+ 
+ fill_buffer:
+ 	pagefault_enable();
+-	set_fs(old_fs);
+ 	/*
+ 	 * In the error path we call the slow path version to avoid
+ 	 * the pollution of static inline code.
+@@ -347,7 +343,6 @@ void lib_ring_buffer_strcpy_from_user_inatomic(const struct lib_ring_buffer_conf
+ 	size_t index, pagecpy;
+ 	size_t offset = ctx->buf_offset;
+ 	struct lib_ring_buffer_backend_pages *backend_pages;
+-	mm_segment_t old_fs = get_fs();
+ 
+ 	if (unlikely(!len))
+ 		return;
+@@ -357,7 +352,6 @@ void lib_ring_buffer_strcpy_from_user_inatomic(const struct lib_ring_buffer_conf
+ 	index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT;
+ 	pagecpy = min_t(size_t, len, (-offset) & ~PAGE_MASK);
+ 
+-	set_fs(KERNEL_DS);
+ 	pagefault_disable();
+ 	if (unlikely(!lttng_access_ok(VERIFY_READ, src, len)))
+ 		goto fill_buffer;
+@@ -388,14 +382,12 @@ void lib_ring_buffer_strcpy_from_user_inatomic(const struct lib_ring_buffer_conf
+ 					len, 0, pad);
+ 	}
+ 	pagefault_enable();
+-	set_fs(old_fs);
+ 	ctx->buf_offset += len;
+ 
+ 	return;
+ 
+ fill_buffer:
+ 	pagefault_enable();
+-	set_fs(old_fs);
+ 	/*
+ 	 * In the error path we call the slow path version to avoid
+ 	 * the pollution of static inline code.
+@@ -447,16 +439,12 @@ unsigned long lib_ring_buffer_copy_from_user_check_nofault(void *dest,
+ 						unsigned long len)
+ {
+ 	unsigned long ret;
+-	mm_segment_t old_fs;
+ 
+ 	if (!lttng_access_ok(VERIFY_READ, src, len))
+ 		return 1;
+-	old_fs = get_fs();
+-	set_fs(KERNEL_DS);
+ 	pagefault_disable();
+ 	ret = __copy_from_user_inatomic(dest, src, len);
+ 	pagefault_enable();
+-	set_fs(old_fs);
+ 	return ret;
+ }
+ 
+diff --git a/lttng-filter-interpreter.c b/lttng-filter-interpreter.c
+index 3dad6cc6..21169f01 100644
+--- a/lttng-filter-interpreter.c
++++ b/lttng-filter-interpreter.c
+@@ -81,16 +81,14 @@ static
+ int stack_star_glob_match(struct estack *stack, int top, const char *cmp_type)
+ {
+ 	bool has_user = false;
+-	mm_segment_t old_fs;
+ 	int result;
+ 	struct estack_entry *pattern_reg;
+ 	struct estack_entry *candidate_reg;
+ 
++	/* Disable the page fault handler when reading from userspace. */
+ 	if (estack_bx(stack, top)->u.s.user
+ 			|| estack_ax(stack, top)->u.s.user) {
+ 		has_user = true;
+-		old_fs = get_fs();
+-		set_fs(KERNEL_DS);
+ 		pagefault_disable();
+ 	}
+ 
+@@ -106,10 +104,8 @@ int stack_star_glob_match(struct estack *stack, int top, const char *cmp_type)
+ 	/* Perform the match operation. */
+ 	result = !strutils_star_glob_match_char_cb(get_char_at_cb,
+ 		pattern_reg, get_char_at_cb, candidate_reg);
+-	if (has_user) {
++	if (has_user)
+ 		pagefault_enable();
+-		set_fs(old_fs);
+-	}
+ 
+ 	return result;
+ }
+@@ -119,13 +115,10 @@ int stack_strcmp(struct estack *stack, int top, const char *cmp_type)
+ {
+ 	size_t offset_bx = 0, offset_ax = 0;
+ 	int diff, has_user = 0;
+-	mm_segment_t old_fs;
+ 
+ 	if (estack_bx(stack, top)->u.s.user
+ 			|| estack_ax(stack, top)->u.s.user) {
+ 		has_user = 1;
+-		old_fs = get_fs();
+-		set_fs(KERNEL_DS);
+ 		pagefault_disable();
+ 	}
+ 
+@@ -210,10 +203,9 @@ int stack_strcmp(struct estack *stack, int top, const char *cmp_type)
+ 		offset_bx++;
+ 		offset_ax++;
+ 	}
+-	if (has_user) {
++	if (has_user)
+ 		pagefault_enable();
+-		set_fs(old_fs);
+-	}
++
+ 	return diff;
+ }
+ 
+diff --git a/probes/lttng-probe-user.c b/probes/lttng-probe-user.c
+index 0d1f95fe..937b01ce 100644
+--- a/probes/lttng-probe-user.c
++++ b/probes/lttng-probe-user.c
+@@ -19,13 +19,10 @@
+ long lttng_strlen_user_inatomic(const char *addr)
+ {
+ 	long count = 0;
+-	mm_segment_t old_fs;
+ 
+ 	if (!addr)
+ 		return 0;
+ 
+-	old_fs = get_fs();
+-	set_fs(KERNEL_DS);
+ 	pagefault_disable();
+ 	for (;;) {
+ 		char v;
+@@ -46,7 +43,6 @@ long lttng_strlen_user_inatomic(const char *addr)
+ 		addr++;
+ 	}
+ 	pagefault_enable();
+-	set_fs(old_fs);
+ 	return count;
+ }
+ EXPORT_SYMBOL_GPL(lttng_strlen_user_inatomic);
+-- 
+2.29.2
+
diff -pruN 2.12.2-1/debian/patches/0003-fix-Use-kernel_read-to-read-from-procfs.patch 2.12.2-1ubuntu2/debian/patches/0003-fix-Use-kernel_read-to-read-from-procfs.patch
--- 2.12.2-1/debian/patches/0003-fix-Use-kernel_read-to-read-from-procfs.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.12.2-1ubuntu2/debian/patches/0003-fix-Use-kernel_read-to-read-from-procfs.patch	2020-11-26 11:07:33.000000000 +0000
@@ -0,0 +1,54 @@
+From 2535981df8fd48ebf8a6994692b937e6374c0d95 Mon Sep 17 00:00:00 2001
+From: Michael Jeanson <mjeanson@efficios.com>
+Date: Thu, 24 Sep 2020 15:38:35 -0400
+Subject: [PATCH 3/6] fix: Use 'kernel_read' to read from procfs
+
+Use the 'kernel_read' helper to read files in procfs, it's present in
+the kernel since the 2.6 series and does the right thing on kernels that
+require the set_fs dance and newer one which don't.
+
+Change-Id: I1a53fda379e0bb9acc79331626925bbdba63d727
+Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+---
+ wrapper/random.c | 12 +-----------
+ 1 file changed, 1 insertion(+), 11 deletions(-)
+
+diff --git a/wrapper/random.c b/wrapper/random.c
+index eb41769c..d7e53cd1 100644
+--- a/wrapper/random.c
++++ b/wrapper/random.c
+@@ -28,21 +28,12 @@ int wrapper_get_bootid(char *bootid)
+ 	struct file *file;
+ 	int ret;
+ 	ssize_t len;
+-	mm_segment_t old_fs;
+ 
+ 	file = filp_open("/proc/sys/kernel/random/boot_id", O_RDONLY, 0);
+ 	if (IS_ERR(file))
+ 		return PTR_ERR(file);
+ 
+-	old_fs = get_fs();
+-	set_fs(KERNEL_DS);
+-
+-	if (!file->f_op || !file->f_op->read) {
+-		ret = -EINVAL;
+-		goto end;
+-	}
+-
+-	len = file->f_op->read(file, bootid, BOOT_ID_LEN - 1, &file->f_pos);
++	len = kernel_read(file, bootid, BOOT_ID_LEN - 1, &file->f_pos);
+ 	if (len != BOOT_ID_LEN - 1) {
+ 		ret = -EINVAL;
+ 		goto end;
+@@ -51,7 +42,6 @@ int wrapper_get_bootid(char *bootid)
+ 	bootid[BOOT_ID_LEN - 1] = '\0';
+ 	ret = 0;
+ end:
+-	set_fs(old_fs);
+ 	filp_close(file, current->files);
+ 	return ret;
+ }
+-- 
+2.29.2
+
diff -pruN 2.12.2-1/debian/patches/0004-fix-objtool-Rename-frame.h-objtool.h-v5.10.patch 2.12.2-1ubuntu2/debian/patches/0004-fix-objtool-Rename-frame.h-objtool.h-v5.10.patch
--- 2.12.2-1/debian/patches/0004-fix-objtool-Rename-frame.h-objtool.h-v5.10.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.12.2-1ubuntu2/debian/patches/0004-fix-objtool-Rename-frame.h-objtool.h-v5.10.patch	2020-11-26 11:07:33.000000000 +0000
@@ -0,0 +1,86 @@
+From bf0790fca02b5d82c54b75c23a97535fc88f9fc2 Mon Sep 17 00:00:00 2001
+From: Michael Jeanson <mjeanson@efficios.com>
+Date: Mon, 26 Oct 2020 13:41:02 -0400
+Subject: [PATCH 4/6] fix: objtool: Rename frame.h -> objtool.h (v5.10)
+
+See upstream commit :
+
+  commit 00089c048eb4a8250325efb32a2724fd0da68cce
+  Author: Julien Thierry <jthierry@redhat.com>
+  Date:   Fri Sep 4 16:30:25 2020 +0100
+
+    objtool: Rename frame.h -> objtool.h
+
+    Header frame.h is getting more code annotations to help objtool analyze
+    object files.
+
+    Rename the file to objtool.h.
+
+Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+Change-Id: Ic2283161bebcbf1e33b72805eb4d2628f4ae3e89
+---
+ lttng-filter-interpreter.c     |  2 +-
+ wrapper/{frame.h => objtool.h} | 19 ++++++++++++-------
+ 2 files changed, 13 insertions(+), 8 deletions(-)
+ rename wrapper/{frame.h => objtool.h} (50%)
+
+diff --git a/lttng-filter-interpreter.c b/lttng-filter-interpreter.c
+index 21169f01..5d572437 100644
+--- a/lttng-filter-interpreter.c
++++ b/lttng-filter-interpreter.c
+@@ -8,7 +8,7 @@
+  */
+ 
+ #include <wrapper/uaccess.h>
+-#include <wrapper/frame.h>
++#include <wrapper/objtool.h>
+ #include <wrapper/types.h>
+ #include <linux/swab.h>
+ 
+diff --git a/wrapper/frame.h b/wrapper/objtool.h
+similarity index 50%
+rename from wrapper/frame.h
+rename to wrapper/objtool.h
+index 6e6dc811..3b997cae 100644
+--- a/wrapper/frame.h
++++ b/wrapper/objtool.h
+@@ -1,18 +1,23 @@
+-/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
++/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
+  *
+- * wrapper/frame.h
++ * wrapper/objtool.h
+  *
+  * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+  */
+ 
+-#ifndef _LTTNG_WRAPPER_FRAME_H
+-#define _LTTNG_WRAPPER_FRAME_H
++#ifndef _LTTNG_WRAPPER_OBJTOOL_H
++#define _LTTNG_WRAPPER_OBJTOOL_H
+ 
+ #include <linux/version.h>
+ 
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
+-
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
++#include <linux/objtool.h>
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
+ #include <linux/frame.h>
++#endif
++
++
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
+ 
+ #define LTTNG_STACK_FRAME_NON_STANDARD(func) \
+ 	STACK_FRAME_NON_STANDARD(func)
+@@ -23,4 +28,4 @@
+ 
+ #endif
+ 
+-#endif /* _LTTNG_WRAPPER_FRAME_H */
++#endif /* _LTTNG_WRAPPER_OBJTOOL_H */
+-- 
+2.29.2
+
diff -pruN 2.12.2-1/debian/patches/0005-fix-tracepoint-Optimize-using-static_call-v5.10.patch 2.12.2-1ubuntu2/debian/patches/0005-fix-tracepoint-Optimize-using-static_call-v5.10.patch
--- 2.12.2-1/debian/patches/0005-fix-tracepoint-Optimize-using-static_call-v5.10.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.12.2-1ubuntu2/debian/patches/0005-fix-tracepoint-Optimize-using-static_call-v5.10.patch	2020-11-26 11:07:33.000000000 +0000
@@ -0,0 +1,194 @@
+From 0c0558337a4483b907fb02a9819d360536f61798 Mon Sep 17 00:00:00 2001
+From: Michael Jeanson <mjeanson@efficios.com>
+Date: Mon, 26 Oct 2020 17:09:05 -0400
+Subject: [PATCH 5/6] fix: tracepoint: Optimize using static_call() (v5.10)
+
+See upstream commit :
+
+  commit d25e37d89dd2f41d7acae0429039d2f0ae8b4a07
+  Author: Steven Rostedt (VMware) <rostedt@goodmis.org>
+  Date:   Tue Aug 18 15:57:52 2020 +0200
+
+    tracepoint: Optimize using static_call()
+
+    Currently the tracepoint site will iterate a vector and issue indirect
+    calls to however many handlers are registered (ie. the vector is
+    long).
+
+    Using static_call() it is possible to optimize this for the common
+    case of only having a single handler registered. In this case the
+    static_call() can directly call this handler. Otherwise, if the vector
+    is longer than 1, call a function that iterates the whole vector like
+    the current code.
+
+Change-Id: I739dd84d62cc1a821b8bd8acff74fa29aa25d22f
+Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+---
+ lttng-statedump-impl.c    | 80 +++++++++++++++++++++++++++++++--------
+ probes/lttng.c            |  7 +++-
+ tests/probes/lttng-test.c |  7 +++-
+ wrapper/tracepoint.h      |  8 ++++
+ 4 files changed, 84 insertions(+), 18 deletions(-)
+
+diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c
+index a6fa71a5..67ecd33c 100644
+--- a/lttng-statedump-impl.c
++++ b/lttng-statedump-impl.c
+@@ -55,26 +55,76 @@
+ #define LTTNG_INSTRUMENTATION
+ #include <instrumentation/events/lttng-module/lttng-statedump.h>
+ 
+-DEFINE_TRACE(lttng_statedump_block_device);
+-DEFINE_TRACE(lttng_statedump_end);
+-DEFINE_TRACE(lttng_statedump_interrupt);
+-DEFINE_TRACE(lttng_statedump_file_descriptor);
+-DEFINE_TRACE(lttng_statedump_start);
+-DEFINE_TRACE(lttng_statedump_process_state);
+-DEFINE_TRACE(lttng_statedump_process_pid_ns);
++LTTNG_DEFINE_TRACE(lttng_statedump_block_device,
++	TP_PROTO(struct lttng_session *session,
++		dev_t dev, const char *diskname),
++	TP_ARGS(session, dev, diskname));
++
++LTTNG_DEFINE_TRACE(lttng_statedump_end,
++	TP_PROTO(struct lttng_session *session),
++	TP_ARGS(session));
++
++LTTNG_DEFINE_TRACE(lttng_statedump_interrupt,
++	TP_PROTO(struct lttng_session *session,
++		unsigned int irq, const char *chip_name,
++		struct irqaction *action),
++	TP_ARGS(session, irq, chip_name, action));
++
++LTTNG_DEFINE_TRACE(lttng_statedump_file_descriptor,
++	TP_PROTO(struct lttng_session *session,
++		struct files_struct *files,
++		int fd, const char *filename,
++		unsigned int flags, fmode_t fmode),
++	TP_ARGS(session, files, fd, filename, flags, fmode));
++
++LTTNG_DEFINE_TRACE(lttng_statedump_start,
++	TP_PROTO(struct lttng_session *session),
++	TP_ARGS(session));
++
++LTTNG_DEFINE_TRACE(lttng_statedump_process_state,
++	TP_PROTO(struct lttng_session *session,
++		struct task_struct *p,
++		int type, int mode, int submode, int status,
++		struct files_struct *files),
++	TP_ARGS(session, p, type, mode, submode, status, files));
++
++LTTNG_DEFINE_TRACE(lttng_statedump_process_pid_ns,
++	TP_PROTO(struct lttng_session *session,
++		struct task_struct *p,
++		struct pid_namespace *pid_ns),
++	TP_ARGS(session, p, pid_ns));
++
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
+-DEFINE_TRACE(lttng_statedump_process_cgroup_ns);
++LTTNG_DEFINE_TRACE(lttng_statedump_process_cgroup_ns,
++	TP_PROTO(struct lttng_session *session,
++		struct task_struct *p,
++		struct cgroup_namespace *cgroup_ns),
++	TP_ARGS(session, p, cgroup_ns));
+ #endif
+-DEFINE_TRACE(lttng_statedump_process_ipc_ns);
++
++LTTNG_DEFINE_TRACE(lttng_statedump_process_ipc_ns,
++	TP_PROTO(struct lttng_session *session,
++		struct task_struct *p,
++		struct ipc_namespace *ipc_ns),
++	TP_ARGS(session, p, ipc_ns));
++
+ #ifndef LTTNG_MNT_NS_MISSING_HEADER
+-DEFINE_TRACE(lttng_statedump_process_mnt_ns);
++LTTNG_DEFINE_TRACE(lttng_statedump_process_mnt_ns,
++	TP_PROTO(struct lttng_session *session,
++		struct task_struct *p,
++		struct mnt_namespace *mnt_ns),
++	TP_ARGS(session, p, mnt_ns));
+ #endif
+-DEFINE_TRACE(lttng_statedump_process_net_ns);
+-DEFINE_TRACE(lttng_statedump_process_user_ns);
+-DEFINE_TRACE(lttng_statedump_process_uts_ns);
+-DEFINE_TRACE(lttng_statedump_network_interface);
++
++LTTNG_DEFINE_TRACE(lttng_statedump_network_interface,
++	TP_PROTO(struct lttng_session *session,
++		struct net_device *dev, struct in_ifaddr *ifa),
++	TP_ARGS(session, dev, ifa));
++
+ #ifdef LTTNG_HAVE_STATEDUMP_CPU_TOPOLOGY
+-DEFINE_TRACE(lttng_statedump_cpu_topology);
++LTTNG_DEFINE_TRACE(lttng_statedump_cpu_topology,
++	TP_PROTO(struct lttng_session *session, struct cpuinfo_x86 *c),
++	TP_ARGS(session, c));
+ #endif
+ 
+ struct lttng_fd_ctx {
+diff --git a/probes/lttng.c b/probes/lttng.c
+index 05bc1388..7ddaa69f 100644
+--- a/probes/lttng.c
++++ b/probes/lttng.c
+@@ -8,7 +8,7 @@
+  */
+ 
+ #include <linux/module.h>
+-#include <linux/tracepoint.h>
++#include <wrapper/tracepoint.h>
+ #include <linux/uaccess.h>
+ #include <linux/gfp.h>
+ #include <linux/fs.h>
+@@ -32,7 +32,10 @@
+ #define LTTNG_LOGGER_COUNT_MAX	1024
+ #define LTTNG_LOGGER_FILE	"lttng-logger"
+ 
+-DEFINE_TRACE(lttng_logger);
++LTTNG_DEFINE_TRACE(lttng_logger,
++	PARAMS(const char __user *text, size_t len),
++	PARAMS(text, len)
++);
+ 
+ static struct proc_dir_entry *lttng_logger_dentry;
+ 
+diff --git a/tests/probes/lttng-test.c b/tests/probes/lttng-test.c
+index b450e7d7..a4fa0645 100644
+--- a/tests/probes/lttng-test.c
++++ b/tests/probes/lttng-test.c
+@@ -25,7 +25,12 @@
+ #define LTTNG_INSTRUMENTATION
+ #include <instrumentation/events/lttng-module/lttng-test.h>
+ 
+-DEFINE_TRACE(lttng_test_filter_event);
++LTTNG_DEFINE_TRACE(lttng_test_filter_event,
++	PARAMS(int anint, int netint, long *values,
++		char *text, size_t textlen,
++		char *etext, uint32_t * net_values),
++	PARAMS(anint, netint, values, text, textlen, etext, net_values)
++);
+ 
+ #define LTTNG_TEST_FILTER_EVENT_FILE	"lttng-test-filter-event"
+ 
+diff --git a/wrapper/tracepoint.h b/wrapper/tracepoint.h
+index c4ba0123..bc19d8c1 100644
+--- a/wrapper/tracepoint.h
++++ b/wrapper/tracepoint.h
+@@ -14,6 +14,14 @@
+ #include <linux/tracepoint.h>
+ #include <linux/module.h>
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
++#define LTTNG_DEFINE_TRACE(name, proto, args)		\
++	DEFINE_TRACE(name, PARAMS(proto), PARAMS(args))
++#else
++#define LTTNG_DEFINE_TRACE(name, proto, args)		\
++	DEFINE_TRACE(name)
++#endif
++
+ #ifndef HAVE_KABI_2635_TRACEPOINT
+ 
+ #define kabi_2635_tracepoint_probe_register tracepoint_probe_register
+-- 
+2.29.2
+
diff -pruN 2.12.2-1/debian/patches/0006-fix-statedump-undefined-symbols-caused-by-incorrect-.patch 2.12.2-1ubuntu2/debian/patches/0006-fix-statedump-undefined-symbols-caused-by-incorrect-.patch
--- 2.12.2-1/debian/patches/0006-fix-statedump-undefined-symbols-caused-by-incorrect-.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.12.2-1ubuntu2/debian/patches/0006-fix-statedump-undefined-symbols-caused-by-incorrect-.patch	2020-11-26 11:07:33.000000000 +0000
@@ -0,0 +1,53 @@
+From 49dc48631f5b5a0184cc39c990bd9ac5bc17e23d Mon Sep 17 00:00:00 2001
+From: He Zhe <zhe.he@windriver.com>
+Date: Mon, 23 Nov 2020 18:14:25 +0800
+Subject: [PATCH 6/6] fix: statedump: undefined symbols caused by incorrect
+ patch backport
+
+bb346792c2cb ("fix: tracepoint: Optimize using static_call() (v5.10)")
+misses three definitions and causes the following build failures.
+
+ERROR: "__tracepoint_lttng_statedump_process_net_ns" [lttng-statedump.ko] undefined!
+ERROR: "__tracepoint_lttng_statedump_process_user_ns" [lttng-statedump.ko] undefined!
+ERROR: "__tracepoint_lttng_statedump_process_uts_ns" [lttng-statedump.ko] undefined!
+
+Fixes: #1290
+
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+---
+ lttng-statedump-impl.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c
+index 67ecd33c..cf803a73 100644
+--- a/lttng-statedump-impl.c
++++ b/lttng-statedump-impl.c
+@@ -116,6 +116,24 @@ LTTNG_DEFINE_TRACE(lttng_statedump_process_mnt_ns,
+ 	TP_ARGS(session, p, mnt_ns));
+ #endif
+ 
++LTTNG_DEFINE_TRACE(lttng_statedump_process_net_ns,
++	TP_PROTO(struct lttng_session *session,
++		struct task_struct *p,
++		struct net *net_ns),
++	TP_ARGS(session, p, net_ns));
++
++LTTNG_DEFINE_TRACE(lttng_statedump_process_user_ns,
++	TP_PROTO(struct lttng_session *session,
++		struct task_struct *p,
++		struct user_namespace *user_ns),
++	TP_ARGS(session, p, user_ns));
++
++LTTNG_DEFINE_TRACE(lttng_statedump_process_uts_ns,
++	TP_PROTO(struct lttng_session *session,
++		struct task_struct *p,
++		struct uts_namespace *uts_ns),
++	TP_ARGS(session, p, uts_ns));
++
+ LTTNG_DEFINE_TRACE(lttng_statedump_network_interface,
+ 	TP_PROTO(struct lttng_session *session,
+ 		struct net_device *dev, struct in_ifaddr *ifa),
+-- 
+2.29.2
+
diff -pruN 2.12.2-1/debian/patches/fix-writeback-queue-io-prototype-with-kernel-5.8.patch 2.12.2-1ubuntu2/debian/patches/fix-writeback-queue-io-prototype-with-kernel-5.8.patch
--- 2.12.2-1/debian/patches/fix-writeback-queue-io-prototype-with-kernel-5.8.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.12.2-1ubuntu2/debian/patches/fix-writeback-queue-io-prototype-with-kernel-5.8.patch	2020-09-16 14:26:51.000000000 +0000
@@ -0,0 +1,142 @@
+Index: lttng-modules-2.12.2/instrumentation/events/lttng-module/writeback.h
+===================================================================
+--- lttng-modules-2.12.2.orig/instrumentation/events/lttng-module/writeback.h
++++ lttng-modules-2.12.2/instrumentation/events/lttng-module/writeback.h
+@@ -370,107 +370,53 @@ LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_
+ #endif
+ LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writepage, writeback_wbc_writepage)
+ 
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) || \
++	LTTNG_KERNEL_RANGE(5,8,6, 5,9,0) || \
++	LTTNG_KERNEL_RANGE(5,4,62, 5,5,0) || \
++	LTTNG_KERNEL_RANGE(4,19,143, 4,20,0) || \
++	LTTNG_KERNEL_RANGE(4,14,196, 4,15,0) || \
++	LTTNG_KERNEL_RANGE(4,9,235, 4,10,0) || \
++	LTTNG_KERNEL_RANGE(4,4,235, 4,5,0))
++LTTNG_TRACEPOINT_EVENT(writeback_queue_io,
++	TP_PROTO(struct bdi_writeback *wb,
++		 struct wb_writeback_work *work,
++		 unsigned long dirtied_before,
++		 int moved),
++	TP_ARGS(wb, work, dirtied_before, moved),
++	TP_FIELDS(
++		ctf_array_text(char, name, dev_name(wb->bdi->dev), 32)
++		ctf_integer(unsigned long, older, dirtied_before)
++		ctf_integer(int, moved, moved)
++	)
++)
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+ LTTNG_TRACEPOINT_EVENT(writeback_queue_io,
+ 	TP_PROTO(struct bdi_writeback *wb,
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+ 		 struct wb_writeback_work *work,
+-#else
+-		 unsigned long *older_than_this,
+-#endif
+ 		 int moved),
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+ 	TP_ARGS(wb, work, moved),
+-#else
++	TP_FIELDS(
++		ctf_array_text(char, name, dev_name(wb->bdi->dev), 32)
++		ctf_integer(int, moved, moved)
++	)
++)
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
++LTTNG_TRACEPOINT_EVENT(writeback_queue_io,
++	TP_PROTO(struct bdi_writeback *wb,
++		 unsigned long *older_than_this,
++		 int moved),
+ 	TP_ARGS(wb, older_than_this, moved),
+-#endif
+ 	TP_FIELDS(
+ 		ctf_array_text(char, name, dev_name(wb->bdi->dev), 32)
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+-#else
+ 		ctf_integer(unsigned long, older,
+ 			older_than_this ? *older_than_this : 0)
+ 		ctf_integer(long, age,
+ 			older_than_this ?
+ 				(jiffies - *older_than_this) * 1000 / HZ
+ 				: -1)
+-#endif
+ 		ctf_integer(int, moved, moved)
+ 	)
+ )
+-
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0))
+-LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state,
+-
+-	writeback_global_dirty_state,
+-
+-	TP_PROTO(unsigned long background_thresh,
+-		 unsigned long dirty_thresh
+-	),
+-
+-	TP_ARGS(background_thresh,
+-		dirty_thresh
+-	),
+-
+-	TP_FIELDS(
+-		ctf_integer(unsigned long, nr_dirty, global_node_page_state(NR_FILE_DIRTY))
+-		ctf_integer(unsigned long, nr_writeback, global_node_page_state(NR_WRITEBACK))
+-		ctf_integer(unsigned long, nr_dirtied, global_node_page_state(NR_DIRTIED))
+-		ctf_integer(unsigned long, nr_written, global_node_page_state(NR_WRITTEN))
+-		ctf_integer(unsigned long, background_thresh, background_thresh)
+-		ctf_integer(unsigned long, dirty_thresh, dirty_thresh)
+-		ctf_integer(unsigned long, dirty_limit, global_dirty_limit)
+-	)
+-)
+-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
+-LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state,
+-
+-	writeback_global_dirty_state,
+-
+-	TP_PROTO(unsigned long background_thresh,
+-		 unsigned long dirty_thresh
+-	),
+-
+-	TP_ARGS(background_thresh,
+-		dirty_thresh
+-	),
+-
+-	TP_FIELDS(
+-		ctf_integer(unsigned long, nr_dirty, global_node_page_state(NR_FILE_DIRTY))
+-		ctf_integer(unsigned long, nr_writeback, global_node_page_state(NR_WRITEBACK))
+-		ctf_integer(unsigned long, nr_unstable, global_node_page_state(NR_UNSTABLE_NFS))
+-		ctf_integer(unsigned long, nr_dirtied, global_node_page_state(NR_DIRTIED))
+-		ctf_integer(unsigned long, nr_written, global_node_page_state(NR_WRITTEN))
+-		ctf_integer(unsigned long, background_thresh, background_thresh)
+-		ctf_integer(unsigned long, dirty_thresh, dirty_thresh)
+-		ctf_integer(unsigned long, dirty_limit, global_dirty_limit)
+-	)
+-)
+-#else
+-LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state,
+-
+-	writeback_global_dirty_state,
+-
+-	TP_PROTO(unsigned long background_thresh,
+-		 unsigned long dirty_thresh
+-	),
+-
+-	TP_ARGS(background_thresh,
+-		dirty_thresh
+-	),
+-
+-	TP_FIELDS(
+-		ctf_integer(unsigned long, nr_dirty, global_page_state(NR_FILE_DIRTY))
+-		ctf_integer(unsigned long, nr_writeback, global_page_state(NR_WRITEBACK))
+-		ctf_integer(unsigned long, nr_unstable, global_page_state(NR_UNSTABLE_NFS))
+-		ctf_integer(unsigned long, nr_dirtied, global_page_state(NR_DIRTIED))
+-		ctf_integer(unsigned long, nr_written, global_page_state(NR_WRITTEN))
+-		ctf_integer(unsigned long, background_thresh, background_thresh)
+-		ctf_integer(unsigned long, dirty_thresh, dirty_thresh)
+-		ctf_integer(unsigned long, dirty_limit, global_dirty_limit)
+-	)
+-)
+-#endif
+ #endif
+ 
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
diff -pruN 2.12.2-1/debian/patches/series 2.12.2-1ubuntu2/debian/patches/series
--- 2.12.2-1/debian/patches/series	2020-08-05 17:51:20.000000000 +0000
+++ 2.12.2-1ubuntu2/debian/patches/series	2020-11-26 11:07:33.000000000 +0000
@@ -1 +1,8 @@
 fix-linux-rt-4.9-sched.patch
+fix-writeback-queue-io-prototype-with-kernel-5.8.patch
+0001-fix-removal-of-smp_-read_barrier_depends-v5.9.patch
+0002-fix-don-t-allow-userspace-copy-to-read-kernel-memory.patch
+0003-fix-Use-kernel_read-to-read-from-procfs.patch
+0004-fix-objtool-Rename-frame.h-objtool.h-v5.10.patch
+0005-fix-tracepoint-Optimize-using-static_call-v5.10.patch
+0006-fix-statedump-undefined-symbols-caused-by-incorrect-.patch
