Hi Jon,

Here is an updated debdiff, it works on a fully updated jessie. Should
we track these updates in a branch of the collab-maint repo?

Michael
diff -Nru lttng-modules-2.5.1/debian/changelog 
lttng-modules-2.5.1/debian/changelog
--- lttng-modules-2.5.1/debian/changelog        2014-10-24 11:11:35.000000000 
-0400
+++ lttng-modules-2.5.1/debian/changelog        2016-07-04 04:49:26.000000000 
-0400
@@ -1,3 +1,9 @@
+lttng-modules (2.5.1-2~test2) unstable; urgency=medium
+
+  * Add patches
+
+ -- Michael Jeanson <mjean...@ubuntu.com>  Mon, 04 Jul 2016 17:24:58 -0400
+
 lttng-modules (2.5.1-1) unstable; urgency=medium
 
   * [106d0a8] New upstream version 2.5.1
diff -Nru lttng-modules-2.5.1/debian/lttng-modules-dkms.dkms.in 
lttng-modules-2.5.1/debian/lttng-modules-dkms.dkms.in
--- lttng-modules-2.5.1/debian/lttng-modules-dkms.dkms.in       2014-10-24 
11:11:35.000000000 -0400
+++ lttng-modules-2.5.1/debian/lttng-modules-dkms.dkms.in       2016-07-04 
04:47:00.000000000 -0400
@@ -10,7 +10,7 @@
     KCONFIG=true
 fi
 
-MAKE[$i]="make -C $kernel_source_dir 
M=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build modules"
+MAKE[$i]="make -C $kernel_source_dir 
M=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build modules V=1"
 
 BUILT_MODULE_NAME[$i]="lttng-lib-ring-buffer"
 BUILT_MODULE_LOCATION[$i]="lib/"
@@ -158,13 +158,6 @@
 DEST_MODULE_LOCATION[$i]="/extra/probes"
 i=$((i+1))
 
-if [ "$KCONFIG" = "true" ] && [ -n "$CONFIG_REGMAP" ]; then
-    BUILT_MODULE_NAME[$i]="lttng-probe-regmap"
-    BUILT_MODULE_LOCATION[$i]="probes/"
-    DEST_MODULE_LOCATION[$i]="/extra/probes"
-    i=$((i+1))
-fi
-
 if [ "$KCONFIG" = "true" ] && [ -n "$CONFIG_REGULATOR" ]; then
     BUILT_MODULE_NAME[$i]="lttng-probe-regulator"
     BUILT_MODULE_LOCATION[$i]="probes/"
diff -Nru lttng-modules-2.5.1/debian/patches/0001-Fix-discover-Debian-API.patch 
lttng-modules-2.5.1/debian/patches/0001-Fix-discover-Debian-API.patch
--- lttng-modules-2.5.1/debian/patches/0001-Fix-discover-Debian-API.patch       
1969-12-31 19:00:00.000000000 -0500
+++ lttng-modules-2.5.1/debian/patches/0001-Fix-discover-Debian-API.patch       
2016-07-04 04:41:24.000000000 -0400
@@ -0,0 +1,257 @@
+From 0aadd8424c7c21259f80da4c97a2b9fef92bd2e9 Mon Sep 17 00:00:00 2001
+From: Mathieu Desnoyers <mathieu.desnoy...@efficios.com>
+Date: Mon, 27 Apr 2015 10:57:34 -0400
+Subject: [PATCH 1/2] Fix: discover Debian API
+
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com>
+---
+ Makefile                                   | 12 ++--
+ Makefile.ABI.workarounds                   | 11 ++++
+ abi-debian-version.sh                      | 30 ++++++++++
+ instrumentation/events/lttng-module/kmem.h | 91 +++++++++++++++++++++++++++++-
+ lib/Makefile                               |  4 ++
+ lttng-kernel-version.h                     | 14 +++++
+ probes/Makefile                            |  4 ++
+ 7 files changed, 161 insertions(+), 5 deletions(-)
+ create mode 100644 Makefile.ABI.workarounds
+ create mode 100755 abi-debian-version.sh
+
+--- a/Makefile
++++ b/Makefile
+@@ -5,6 +5,8 @@
+ ifneq ($(KERNELRELEASE),)
+ ifneq ($(CONFIG_TRACEPOINTS),)
+ 
++KERNELDIR=${LTTNG_KERNELDIR}
++
+ lttng_check_linux_version = $(shell pwd)/include/linux/version.h
+ lttng_check_generated_linux_version = $(shell 
pwd)/include/generated/uapi/linux/version.h
+ 
+@@ -19,6 +21,8 @@
+ endif
+ endif
+ 
++include $(KBUILD_EXTMOD)/Makefile.ABI.workarounds
++
+ obj-m += lttng-ring-buffer-client-discard.o
+ obj-m += lttng-ring-buffer-client-overwrite.o
+ obj-m += lttng-ring-buffer-metadata-client.o
+@@ -67,14 +71,14 @@
+       CFLAGS = $(EXTCFLAGS)
+ 
+ default:
+-      $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
++      LTTNG_KERNELDIR=$(KERNELDIR) $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+ 
+ modules_install:
+-      $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
++      LTTNG_KERNELDIR=$(KERNELDIR) $(MAKE) -C $(KERNELDIR) M=$(PWD) 
modules_install
+ 
+ clean:
+-      $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
++      LTTNG_KERNELDIR=$(KERNELDIR) $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
+ 
+ %.i: %.c
+-      $(MAKE) -C $(KERNELDIR) M=$(PWD) $@
++      LTTNG_KERNELDIR=$(KERNELDIR) $(MAKE) -C $(KERNELDIR) M=$(PWD) $@
+ endif # KERNELRELEASE
+--- /dev/null
++++ b/Makefile.ABI.workarounds
+@@ -0,0 +1,11 @@
++# Work-around for distro-specific public modules ABI breakages.
++# Some distributions break the public module instrumentation ABI
++# compared to upstream stable kernels without providing other mean than
++# the kernel EXTRAVERSION to figure it out. Translate this information
++# into a define visible from the C preprocessor.
++
++DEB_API_VERSION=$(shell $(KBUILD_EXTMOD)/abi-debian-version.sh $(CURDIR))
++
++ifneq ($(DEB_API_VERSION), 0)
++ccflags-y += -DDEBIAN_API_VERSION=$(DEB_API_VERSION)
++endif
+--- /dev/null
++++ b/abi-debian-version.sh
+@@ -0,0 +1,39 @@
++#!/bin/sh
++
++# First argument is the path to the kernel headers.
++KPATH=$1
++
++if [ ! -f ${KPATH}/include/generated/package.h ]; then
++      echo 0
++      exit 0
++fi
++
++# Debian snippet courtesy of Ben Hutchings
++
++# Assuming KPATH is the target kernel headers directory
++DEB_PACKAGE_VERSION=$(sed -rn 's/^#define LINUX_PACKAGE_ID " Debian 
(.*)"/\1/p' ${KPATH}/include/generated/package.h)
++# Ignore backports part
++DEB_PACKAGE_VERSION=$(echo ${DEB_PACKAGE_VERSION} | sed -r 's/~(bpo|deb).*//')
++# Get -ckt update number, if present
++KERNEL_CKT_UPDATE=$(echo ${DEB_PACKAGE_VERSION} | sed -rn 
's/^[0-9]+\.[0-9]+\.[0-9]+-ckt([0-9]+).*/\1/p')
++
++# Only care about the rest if it is a -ckt kernel, making sure we do not
++# clash with older Debian kernels (e.g. Debian 3.2.65-1+deb7u2).
++if [ -z "${KERNEL_CKT_UPDATE}" ]; then
++      echo 0
++      exit 0
++fi
++
++# Get package revision
++DEB_PACKAGE_REVISION=$(echo ${DEB_PACKAGE_VERSION} | sed -r 
's/.*-([^-]+)$/\1/')
++# Get non-sec update number
++DEB_PACKAGE_REVISION_BASE=$(echo ${DEB_PACKAGE_REVISION} | sed -r 
's/^([0-9]+).*/\1/')
++# Get security update number, if present
++#DEB_PACKAGE_REVISION_SECURITY=$(echo ${DEB_PACKAGE_REVISION} | sed -rn 
's/.*\+(squeeze|deb[0-9])+u([0-9]+)$/\1/p')
++test -n "${DEB_PACKAGE_REVISION_SECURITY}" || DEB_PACKAGE_REVISION_SECURITY=0
++# Combine all update numbers into one
++DEB_API_VERSION=$((KERNEL_CKT_UPDATE * 10000 + DEB_PACKAGE_REVISION_BASE * 
100 + DEB_PACKAGE_REVISION_SECURITY))
++
++echo "KPATH: $KPATH API: $DEB_API_VERSION" >> /tmp/abi-debian
++
++echo ${DEB_API_VERSION}
+--- a/instrumentation/events/lttng-module/kmem.h
++++ b/instrumentation/events/lttng-module/kmem.h
+@@ -286,7 +286,96 @@
+               __entry->order, __entry->migratetype)
+ )
+ 
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2)     \
++      || LTTNG_KERNEL_RANGE(3,14,36, 3,15,0)          \
++      || LTTNG_UBUNTU_KERNEL_RANGE(3,13,0,50, 3,14,0,0)       \
++      || LTTNG_UBUNTU_KERNEL_RANGE(3,16,0,38, 3,17,0,0)       \
++      || LTTNG_DEBIAN_KERNEL_RANGE(3,16,7,9,0,0, 3,17,0,0,0,0))
++
++TRACE_EVENT(mm_page_alloc_extfrag,
++
++      TP_PROTO(struct page *page,
++              int alloc_order, int fallback_order,
++              int alloc_migratetype, int fallback_migratetype),
++
++      TP_ARGS(page,
++              alloc_order, fallback_order,
++              alloc_migratetype, fallback_migratetype),
++
++      TP_STRUCT__entry(
++              __field_hex(    struct page *,  page                    )
++              __field(        int,            alloc_order             )
++              __field(        int,            fallback_order          )
++              __field(        int,            alloc_migratetype       )
++              __field(        int,            fallback_migratetype    )
++              __field(        int,            change_ownership        )
++      ),
++
++      TP_fast_assign(
++              tp_assign(page, page)
++              tp_assign(alloc_order, alloc_order)
++              tp_assign(fallback_order, fallback_order)
++              tp_assign(alloc_migratetype, alloc_migratetype)
++              tp_assign(fallback_migratetype, fallback_migratetype)
++              tp_assign(change_ownership,
++                      (alloc_migratetype == get_pageblock_migratetype(page)))
++      ),
++
++      TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d 
pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d 
change_ownership=%d",
++              __entry->page,
++              page_to_pfn(__entry->page),
++              __entry->alloc_order,
++              __entry->fallback_order,
++              pageblock_order,
++              __entry->alloc_migratetype,
++              __entry->fallback_migratetype,
++              __entry->fallback_order < pageblock_order,
++              __entry->change_ownership)
++)
++
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,30))
++
++TRACE_EVENT(mm_page_alloc_extfrag,
++
++      TP_PROTO(struct page *page,
++              int alloc_order, int fallback_order,
++              int alloc_migratetype, int fallback_migratetype, int 
new_migratetype),
++
++      TP_ARGS(page,
++              alloc_order, fallback_order,
++              alloc_migratetype, fallback_migratetype, new_migratetype),
++
++      TP_STRUCT__entry(
++              __field_hex(    struct page *,  page                    )
++              __field(        int,            alloc_order             )
++              __field(        int,            fallback_order          )
++              __field(        int,            alloc_migratetype       )
++              __field(        int,            fallback_migratetype    )
++              __field(        int,            change_ownership        )
++      ),
++
++      TP_fast_assign(
++              tp_assign(page, page)
++              tp_assign(alloc_order, alloc_order)
++              tp_assign(fallback_order, fallback_order)
++              tp_assign(alloc_migratetype, alloc_migratetype)
++              tp_assign(fallback_migratetype, fallback_migratetype)
++              tp_assign(change_ownership, (new_migratetype == 
alloc_migratetype))
++      ),
++
++      TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d 
pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d 
change_ownership=%d",
++              __entry->page,
++              page_to_pfn(__entry->page),
++              __entry->alloc_order,
++              __entry->fallback_order,
++              pageblock_order,
++              __entry->alloc_migratetype,
++              __entry->fallback_migratetype,
++              __entry->fallback_order < pageblock_order,
++              __entry->change_ownership)
++)
++
++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
+ 
+ TRACE_EVENT(mm_page_alloc_extfrag,
+ 
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -1,3 +1,7 @@
++KERNELDIR=${LTTNG_KERNELDIR}
++
++include $(KBUILD_EXTMOD)/Makefile.ABI.workarounds
++
+ obj-m += lttng-lib-ring-buffer.o
+ 
+ lttng-lib-ring-buffer-objs := \
+--- a/lttng-kernel-version.h
++++ b/lttng-kernel-version.h
+@@ -48,4 +48,18 @@
+               LTTNG_UBUNTU_VERSION_CODE < \
+               LTTNG_UBUNTU_KERNEL_VERSION(a_high, b_high, c_high, d_high))
+ 
++#define LTTNG_DEBIAN_KERNEL_VERSION(a, b, c, d, e, f) \
++      (((((a) << 16) + ((b) << 8) + (c)) * 1000000ULL) + ((d) * 10000) + ((e) 
* 100) + (f))
++
++#define LTTNG_DEBIAN_VERSION_CODE \
++      ((LINUX_VERSION_CODE * 1000000ULL) + DEBIAN_API_VERSION)
++
++#define LTTNG_DEBIAN_KERNEL_RANGE(a_low, b_low, c_low, d_low, e_low, f_low, \
++              a_high, b_high, c_high, d_high, e_high, f_high) \
++      (defined(DEBIAN_API_VERSION) && \
++              LTTNG_DEBIAN_VERSION_CODE >= \
++              LTTNG_DEBIAN_KERNEL_VERSION(a_low, b_low, c_low, d_low, e_low, 
f_low) && \
++              LTTNG_DEBIAN_VERSION_CODE < \
++              LTTNG_DEBIAN_KERNEL_VERSION(a_high, b_high, c_high, d_high, 
e_high, f_high))
++
+ #endif /* _LTTNG_KERNEL_VERSION_H */
+--- a/probes/Makefile
++++ b/probes/Makefile
+@@ -5,6 +5,10 @@
+ ifneq ($(KERNELRELEASE),)
+ ifneq ($(CONFIG_TRACEPOINTS),)
+ 
++KERNELDIR=${LTTNG_KERNELDIR}
++
++include $(KBUILD_EXTMOD)/Makefile.ABI.workarounds
++
+ ccflags-y += -I$(PWD)/probes
+ obj-m += lttng-types.o
+ 
diff -Nru 
lttng-modules-2.5.1/debian/patches/0002-Fix-remove-regmap-instrumentation-for-kernels-4.1.patch
 
lttng-modules-2.5.1/debian/patches/0002-Fix-remove-regmap-instrumentation-for-kernels-4.1.patch
--- 
lttng-modules-2.5.1/debian/patches/0002-Fix-remove-regmap-instrumentation-for-kernels-4.1.patch
     1969-12-31 19:00:00.000000000 -0500
+++ 
lttng-modules-2.5.1/debian/patches/0002-Fix-remove-regmap-instrumentation-for-kernels-4.1.patch
     2016-07-03 11:29:07.000000000 -0400
@@ -0,0 +1,91 @@
+From 31964a955d12429de00321d1670b1bc0daf015c7 Mon Sep 17 00:00:00 2001
+From: Mathieu Desnoyers <mathieu.desnoy...@efficios.com>
+Date: Tue, 26 May 2015 15:22:01 -0400
+Subject: [PATCH 2/2] Fix: remove regmap instrumentation for kernels < 4.1
+
+Modifications to regmap.h instrumentation in mainline Linux kernel has
+been no less than erratic. First, the public instrumentation header
+regmap.h include a private driver header in Linux 4.0. Then, regmap.h
+is moved to the private driver directory in Linux 4.1. To make things
+worse, the 4.0 commit has been picked into stable branches of the Linux
+kernel.
+
+Since this does not appear to be an instrumentation of utmost
+importance, only build this instrumentation probe if the private header
+is found in the driver directory (need full kernel sources).
+
+This removes regmap instrumentation for older kernels.
+
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com>
+---
+ instrumentation/events/lttng-module/regmap.h | 4 ----
+ probes/Makefile                              | 9 ++++++---
+ probes/lttng-probe-regmap.c                  | 5 ++++-
+ 3 files changed, 10 insertions(+), 8 deletions(-)
+
+--- a/instrumentation/events/lttng-module/regmap.h
++++ b/instrumentation/events/lttng-module/regmap.h
+@@ -59,7 +59,6 @@
+ 
+ )
+ 
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
+ DEFINE_EVENT(regmap_reg, regmap_reg_read_cache,
+ 
+       TP_PROTO(struct device *dev, unsigned int reg,
+@@ -68,7 +67,6 @@
+       TP_ARGS(dev, reg, val)
+ 
+ )
+-#endif
+ 
+ DECLARE_EVENT_CLASS(regmap_block,
+ 
+@@ -144,7 +142,6 @@
+                 __get_str(type), __get_str(status))
+ )
+ 
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+ DECLARE_EVENT_CLASS(regmap_bool,
+ 
+       TP_PROTO(struct device *dev, bool flag),
+@@ -180,7 +177,6 @@
+       TP_ARGS(dev, flag)
+ 
+ )
+-#endif
+ 
+ #endif /* _TRACE_REGMAP_H */
+ 
+--- a/probes/Makefile
++++ b/probes/Makefile
+@@ -184,9 +184,12 @@
+               echo "lttng-probe-rcu.o" ; fi;)
+ 
+ ifneq ($(CONFIG_REGMAP),)
+-obj-m +=  $(shell \
+-      if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 2 ] ; then \
+-              echo "lttng-probe-regmap.o" ; fi;)
++regmap_dep_4_1 = $(srctree)/drivers/base/regmap/trace.h
++ifneq ($(wildcard $(regmap_dep_4_1)),)
++obj-m += lttng-probe-regmap.o
++else
++$(warning File $(regmap_dep_4_1) not found. Probe "regmap" is disabled. Need 
Linux 4.1+ kernel source tree to enable it.)
++endif
+ endif
+ 
+ ifneq ($(CONFIG_PM_RUNTIME),)
+--- a/probes/lttng-probe-regmap.c
++++ b/probes/lttng-probe-regmap.c
+@@ -29,7 +29,10 @@
+  * Create the tracepoint static inlines from the kernel to validate that our
+  * trace event macros match the kernel we run on.
+  */
+-#include <trace/events/regmap.h>
++#include <../../drivers/base/regmap/trace.h>
++
++#undef TRACE_INCLUDE_PATH
++#undef TRACE_INCLUDE_FILE
+ 
+ /*
+  * Create LTTng tracepoint probes.
diff -Nru 
lttng-modules-2.5.1/debian/patches/66861b2e35992cbbab6ac1b52127bb4fb96ed3b6.patch
 
lttng-modules-2.5.1/debian/patches/66861b2e35992cbbab6ac1b52127bb4fb96ed3b6.patch
--- 
lttng-modules-2.5.1/debian/patches/66861b2e35992cbbab6ac1b52127bb4fb96ed3b6.patch
   1969-12-31 19:00:00.000000000 -0500
+++ 
lttng-modules-2.5.1/debian/patches/66861b2e35992cbbab6ac1b52127bb4fb96ed3b6.patch
   2016-07-03 12:05:16.000000000 -0400
@@ -0,0 +1,210 @@
+From 66861b2e35992cbbab6ac1b52127bb4fb96ed3b6 Mon Sep 17 00:00:00 2001
+From: Mathieu Desnoyers <mathieu.desnoy...@efficios.com>
+Date: Thu, 16 Apr 2015 17:15:45 -0400
+Subject: [PATCH] Implement wrapper around get_pfnblock_flags_mask
+
+This is used by kmem instrumentation, and changed in 4.0.0. This change
+has been backported to 3.19.2 stable kernel.
+
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com>
+---
+ Makefile                  |  2 +-
+ lttng-events.c            | 10 ++++++-
+ probes/lttng-probe-kmem.c |  5 ++++
+ wrapper/page_alloc.c      | 68 +++++++++++++++++++++++++++++++++++++++++++++++
+ wrapper/page_alloc.h      | 54 +++++++++++++++++++++++++++++++++++++
+ 5 files changed, 137 insertions(+), 2 deletions(-)
+ create mode 100644 wrapper/page_alloc.c
+ create mode 100644 wrapper/page_alloc.h
+
+diff --git a/Makefile b/Makefile
+index aa4835d..3130848 100644
+--- a/Makefile
++++ b/Makefile
+@@ -35,7 +35,7 @@ lttng-tracer-objs :=  lttng-events.o lttng-abi.o \
+                       lttng-context-vtid.o lttng-context-ppid.o \
+                       lttng-context-vppid.o lttng-calibrate.o \
+                       lttng-context-hostname.o wrapper/random.o \
+-                      probes/lttng.o
++                      probes/lttng.o wrapper/page_alloc.o
+ 
+ obj-m += lttng-statedump.o
+ lttng-statedump-objs := lttng-statedump-impl.o wrapper/irqdesc.o \
+diff --git a/lttng-events.c b/lttng-events.c
+index e377deb..c4de34f 100644
+--- a/lttng-events.c
++++ b/lttng-events.c
+@@ -20,6 +20,12 @@
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
USA
+  */
+ 
++/*
++ * This page_alloc.h wrapper needs to be included before gfpflags.h because it
++ * overrides a function with a define.
++ */
++#include "wrapper/page_alloc.h"
++
+ #include <linux/module.h>
+ #include <linux/list.h>
+ #include <linux/mutex.h>
+@@ -1282,7 +1288,9 @@ static int __init lttng_events_init(void)
+       ret = wrapper_lttng_fixup_sig(THIS_MODULE);
+       if (ret)
+               return ret;
+-
++      ret = wrapper_get_pfnblock_flags_mask_init();
++      if (ret)
++              return ret;
+       ret = lttng_tracepoint_init();
+       if (ret)
+               return ret;
+diff --git a/probes/lttng-probe-kmem.c b/probes/lttng-probe-kmem.c
+index c8252ec..0120241 100644
+--- a/probes/lttng-probe-kmem.c
++++ b/probes/lttng-probe-kmem.c
+@@ -21,6 +21,11 @@
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
USA
+  */
+ 
++/*
++ * This page_alloc.h wrapper needs to be included before gfpflags.h because it
++ * overrides a function with a define.
++ */
++#include "../wrapper/page_alloc.h"
+ #include <linux/module.h>
+ #include "../lttng-tracer.h"
+ 
+diff --git a/wrapper/page_alloc.c b/wrapper/page_alloc.c
+new file mode 100644
+index 0000000..184ec71
+--- /dev/null
++++ b/wrapper/page_alloc.c
+@@ -0,0 +1,68 @@
++/*
++ * wrapper/page_alloc.c
++ *
++ * wrapper around get_pfnblock_flags_mask. Using KALLSYMS to get its address
++ * when available, else we need to have a kernel that exports this function to
++ * GPL modules.
++ *
++ * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoy...@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 "../lttng-kernel-version.h"
++
++#if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2))
++
++#include <linux/kallsyms.h>
++#include <linux/mm_types.h>
++#include <linux/module.h>
++#include "kallsyms.h"
++#include "page_alloc.h"
++
++static
++unsigned long (*get_pfnblock_flags_mask_sym)(struct page *page,
++              unsigned long pfn,
++              unsigned long end_bitidx,
++              unsigned long mask);
++
++unsigned long wrapper_get_pfnblock_flags_mask(struct page *page,
++              unsigned long pfn,
++              unsigned long end_bitidx,
++              unsigned long mask)
++{
++      WARN_ON_ONCE(!get_pfnblock_flags_mask_sym);
++      if (get_pfnblock_flags_mask_sym) {
++              return get_pfnblock_flags_mask_sym(page, pfn, end_bitidx, mask);
++      } else {
++              return -ENOSYS;
++      }
++}
++EXPORT_SYMBOL_GPL(wrapper_get_pfnblock_flags_mask);
++
++int wrapper_get_pfnblock_flags_mask_init(void)
++{
++      get_pfnblock_flags_mask_sym =
++              (void *) kallsyms_lookup_funcptr("get_pfnblock_flags_mask");
++      if (!get_pfnblock_flags_mask_sym)
++              return -1;
++      return 0;
++}
++
++#else /* #if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= 
KERNEL_VERSION(3,19,2)) */
++
++#include <linux/pageblock-flags.h>
++
++#endif /* #else #if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= 
KERNEL_VERSION(3,19,2)) */
+diff --git a/wrapper/page_alloc.h b/wrapper/page_alloc.h
+new file mode 100644
+index 0000000..06e2ddc
+--- /dev/null
++++ b/wrapper/page_alloc.h
+@@ -0,0 +1,54 @@
++#ifndef _LTTNG_WRAPPER_PAGE_ALLOC_H
++#define _LTTNG_WRAPPER_PAGE_ALLOC_H
++
++/*
++ * wrapper/page_alloc.h
++ *
++ * wrapper around get_pfnblock_flags_mask. Using KALLSYMS to get its address
++ * when available, else we need to have a kernel that exports this function to
++ * GPL modules.
++ *
++ * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoy...@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 "../lttng-kernel-version.h"
++
++/*
++ * We need to redefine get_pfnblock_flags_mask to our wrapper, because
++ * the get_pageblock_migratetype() macro uses it.
++ */
++#if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2))
++
++#define get_pfnblock_flags_mask               wrapper_get_pfnblock_flags_mask
++
++#include <linux/mm_types.h>
++
++int wrapper_get_pfnblock_flags_mask_init(void);
++
++#else /* #if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= 
KERNEL_VERSION(3,19,2)) */
++
++#include <linux/mm_types.h>
++
++static inline
++int wrapper_get_pfnblock_flags_mask_init(void)
++{
++      return 0;
++}
++
++#endif /* else #if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= 
KERNEL_VERSION(3,19,2)) */
++
++#endif /* _LTTNG_WRAPPER_PAGE_ALLOC_H */
diff -Nru 
lttng-modules-2.5.1/debian/patches/ffc696db884c44a49780bcd9e3b0f97ef82d2382.patch
 
lttng-modules-2.5.1/debian/patches/ffc696db884c44a49780bcd9e3b0f97ef82d2382.patch
--- 
lttng-modules-2.5.1/debian/patches/ffc696db884c44a49780bcd9e3b0f97ef82d2382.patch
   1969-12-31 19:00:00.000000000 -0500
+++ 
lttng-modules-2.5.1/debian/patches/ffc696db884c44a49780bcd9e3b0f97ef82d2382.patch
   2016-07-03 12:10:38.000000000 -0400
@@ -0,0 +1,42 @@
+From ffc696db884c44a49780bcd9e3b0f97ef82d2382 Mon Sep 17 00:00:00 2001
+From: Mathieu Desnoyers <mathieu.desnoy...@efficios.com>
+Date: Mon, 27 Apr 2015 11:03:17 -0400
+Subject: [PATCH] Fix: update get_pfnblock_flags_mask wrapper for debian
+ kernels
+
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com>
+---
+ wrapper/page_alloc.c | 4 +++-
+ wrapper/page_alloc.h | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/wrapper/page_alloc.c b/wrapper/page_alloc.c
+index 184ec71..d82d897 100644
+--- a/wrapper/page_alloc.c
++++ b/wrapper/page_alloc.c
+@@ -24,7 +24,9 @@
+ 
+ #include "../lttng-kernel-version.h"
+ 
+-#if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2))
++#if (defined(CONFIG_KALLSYMS) \
++      && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2) \
++              || LTTNG_DEBIAN_KERNEL_RANGE(3,16,7,9,0,0, 3,17,0,0,0,0)))
+ 
+ #include <linux/kallsyms.h>
+ #include <linux/mm_types.h>
+diff --git a/wrapper/page_alloc.h b/wrapper/page_alloc.h
+index 06e2ddc..5e84b5c 100644
+--- a/wrapper/page_alloc.h
++++ b/wrapper/page_alloc.h
+@@ -31,7 +31,9 @@
+  * We need to redefine get_pfnblock_flags_mask to our wrapper, because
+  * the get_pageblock_migratetype() macro uses it.
+  */
+-#if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2))
++#if (defined(CONFIG_KALLSYMS) \
++      && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2) \
++              || LTTNG_DEBIAN_KERNEL_RANGE(3,16,7,9,0,0, 3,17,0,0,0,0)))
+ 
+ #define get_pfnblock_flags_mask               wrapper_get_pfnblock_flags_mask
+ 
diff -Nru lttng-modules-2.5.1/debian/patches/series 
lttng-modules-2.5.1/debian/patches/series
--- lttng-modules-2.5.1/debian/patches/series   1969-12-31 19:00:00.000000000 
-0500
+++ lttng-modules-2.5.1/debian/patches/series   2016-07-04 04:42:59.000000000 
-0400
@@ -0,0 +1,4 @@
+0001-Fix-discover-Debian-API.patch
+0002-Fix-remove-regmap-instrumentation-for-kernels-4.1.patch
+66861b2e35992cbbab6ac1b52127bb4fb96ed3b6.patch
+ffc696db884c44a49780bcd9e3b0f97ef82d2382.patch
diff -Nru lttng-modules-2.5.1/debian/rules lttng-modules-2.5.1/debian/rules
--- lttng-modules-2.5.1/debian/rules    2014-10-24 11:11:35.000000000 -0400
+++ lttng-modules-2.5.1/debian/rules    2016-07-03 12:20:26.000000000 -0400
@@ -19,7 +19,8 @@
        dh_auto_install
 
 override_dh_install:
-       dh_install -Xdebian -XLICENSE -Xgpl-2.0.txt -Xlgpl-2.1.txt
+       chmod 0755 abi-debian-version.sh
+       dh_install -Xdebian/ -XLICENSE -Xgpl-2.0.txt -Xlgpl-2.1.txt
 
 override_dh_auto_clean:
        exit 0

Reply via email to