diff -Nru lttng-modules-2.8.0/debian/changelog lttng-modules-2.8.0/debian/changelog --- lttng-modules-2.8.0/debian/changelog 2016-05-24 21:38:38.000000000 -0400 +++ lttng-modules-2.8.0/debian/changelog 2016-12-01 11:30:41.000000000 -0500 @@ -1,3 +1,16 @@ +lttng-modules (2.8.0-1ubuntu1) yakkety-proposed; urgency=medium + + * Backport upstream stable commits from 2.8.1 to allow compiling on 4.8 + kernels. (LP: #1625072) + 0001-Fix-Add-support-for-4.6.4-rt8-kernel.patch + 0002-Fix-timer-wrapper-support-kernels-4.8.patch + 0003-Fix-update-block-instrumentation-to-compile-on-4.8-k.patch + 0004-Fix-napi-instrumentation-for-4.8-kernels.patch + 0005-Fix-update-mm_vmscan-instrumentation-for-kernel-4.8.patch + 0006-Fix-btrfs-instrumentation-for-4.8-kernel.patch + + -- Robert Hooker Thu, 01 Dec 2016 09:51:38 -0500 + lttng-modules (2.8.0-1) unstable; urgency=medium [ Michael Jeanson ] diff -Nru lttng-modules-2.8.0/debian/control lttng-modules-2.8.0/debian/control --- lttng-modules-2.8.0/debian/control 2016-05-24 21:38:38.000000000 -0400 +++ lttng-modules-2.8.0/debian/control 2016-12-01 11:17:45.000000000 -0500 @@ -1,7 +1,8 @@ Source: lttng-modules Section: kernel Priority: extra -Maintainer: Jon Bernard +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Jon Bernard Build-Depends: debhelper (>= 9), dkms (>= 2.1.0.0) Standards-Version: 3.9.8 Vcs-Git: https://anonscm.debian.org/git/collab-maint/lttng-modules.git diff -Nru lttng-modules-2.8.0/debian/patches/0001-Fix-Add-support-for-4.6.4-rt8-kernel.patch lttng-modules-2.8.0/debian/patches/0001-Fix-Add-support-for-4.6.4-rt8-kernel.patch --- lttng-modules-2.8.0/debian/patches/0001-Fix-Add-support-for-4.6.4-rt8-kernel.patch 1969-12-31 19:00:00.000000000 -0500 +++ lttng-modules-2.8.0/debian/patches/0001-Fix-Add-support-for-4.6.4-rt8-kernel.patch 2016-12-01 11:35:18.000000000 -0500 @@ -0,0 +1,134 @@ +From 47da52acb585cedb3a130d7c8af5db2d2f208265 Mon Sep 17 00:00:00 2001 +From: Michael Jeanson +Date: Fri, 29 Jul 2016 10:52:47 -0400 +Subject: [PATCH 1/6] Fix: Add support for 4.6.4-rt8 kernel + +Signed-off-by: Michael Jeanson +Signed-off-by: Mathieu Desnoyers +--- + 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 1e4b98b..74af7c6 100644 +--- a/lib/ringbuffer/ring_buffer_frontend.c ++++ b/lib/ringbuffer/ring_buffer_frontend.c +@@ -63,6 +63,7 @@ + #include + #include + #include ++#include + + /* + * 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 ++ * ++ * 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 ++#include ++#include ++ ++ ++#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 + diff -Nru lttng-modules-2.8.0/debian/patches/0002-Fix-timer-wrapper-support-kernels-4.8.patch lttng-modules-2.8.0/debian/patches/0002-Fix-timer-wrapper-support-kernels-4.8.patch --- lttng-modules-2.8.0/debian/patches/0002-Fix-timer-wrapper-support-kernels-4.8.patch 1969-12-31 19:00:00.000000000 -0500 +++ lttng-modules-2.8.0/debian/patches/0002-Fix-timer-wrapper-support-kernels-4.8.patch 2016-12-01 11:35:30.000000000 -0500 @@ -0,0 +1,44 @@ +From 9889a003260b4fd46caba76c21be985f7205ac8f Mon Sep 17 00:00:00 2001 +From: Mathieu Desnoyers +Date: Thu, 25 Aug 2016 17:39:47 -0400 +Subject: [PATCH 2/6] Fix: timer wrapper: support kernels >= 4.8 + +Signed-off-by: Mathieu Desnoyers +--- + wrapper/timer.h | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/wrapper/timer.h b/wrapper/timer.h +index 441a017..c1c0c95 100644 +--- a/wrapper/timer.h ++++ b/wrapper/timer.h +@@ -28,7 +28,8 @@ + #include + + +-#if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8)) ++#if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8) \ ++ || LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) + + #define lttng_init_timer_pinned(timer) \ + init_timer_pinned(timer) +@@ -39,7 +40,7 @@ static inline int lttng_mod_timer_pinned(struct timer_list *timer, + return mod_timer(timer, expires); + } + +-#else /* #if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8)) */ ++#else + + #define lttng_init_timer_pinned(timer) \ + init_timer(timer) +@@ -50,6 +51,6 @@ static inline int lttng_mod_timer_pinned(struct timer_list *timer, + return mod_timer_pinned(timer, expires); + } + +-#endif /* #else #if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8)) */ ++#endif + + #endif /* _LTTNG_WRAPPER_TIMER_H */ +-- +2.7.4 + diff -Nru lttng-modules-2.8.0/debian/patches/0003-Fix-update-block-instrumentation-to-compile-on-4.8-k.patch lttng-modules-2.8.0/debian/patches/0003-Fix-update-block-instrumentation-to-compile-on-4.8-k.patch --- lttng-modules-2.8.0/debian/patches/0003-Fix-update-block-instrumentation-to-compile-on-4.8-k.patch 1969-12-31 19:00:00.000000000 -0500 +++ lttng-modules-2.8.0/debian/patches/0003-Fix-update-block-instrumentation-to-compile-on-4.8-k.patch 2016-12-01 11:35:51.000000000 -0500 @@ -0,0 +1,284 @@ +From 283b1c890496023649b4d37d3f88e60c9cd959cd Mon Sep 17 00:00:00 2001 +From: Mathieu Desnoyers +Date: Tue, 30 Aug 2016 16:59:13 -0400 +Subject: [PATCH 3/6] Fix: update block instrumentation to compile on 4.8 + kernels +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +These 2 upstream Linux commits break the block instrumentation in lttng +modules master: + +https://github.com/torvalds/linux/commit/4e1b2d52a80d79296a5d899d73249748dea71a53 + +https://github.com/torvalds/linux/commit/288dab8a35a0bde426a09870943c8d3ee3a50dab + +The errors are : + +lttng-modules/probes/../instrumentation/events/lttng-module/block.h:35:13: +error: ‘REQ_DISCARD’ undeclared (first use in this function) + +lttng-modules/probes/../instrumentation/events/lttng-module/block.h:41:14: +error: ‘REQ_SECURE’ undeclared (first use in this function) + +Signed-off-by: Mathieu Desnoyers +--- + instrumentation/events/lttng-module/block.h | 99 ++++++++++++++++++++++------- + 1 file changed, 75 insertions(+), 24 deletions(-) + +diff --git a/instrumentation/events/lttng-module/block.h b/instrumentation/events/lttng-module/block.h +index 75cb11b..4373edf 100644 +--- a/instrumentation/events/lttng-module/block.h ++++ b/instrumentation/events/lttng-module/block.h +@@ -24,13 +24,40 @@ enum { + RWBS_FLAG_SECURE = (1 << 7), + RWBS_FLAG_FLUSH = (1 << 8), + RWBS_FLAG_FUA = (1 << 9), ++ RWBS_FLAG_PREFLUSH = (1 << 10), + }; + + #endif /* _TRACE_BLOCK_DEF_ */ + +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) ++ ++#define lttng_req_op(rq) req_op(rq) ++#define lttng_req_rw(rq) ((rq)->cmd_flags) ++#define lttng_bio_op(bio) bio_op(bio) ++#define lttng_bio_rw(bio) ((bio)->bi_opf) ++ ++#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ ++ ctf_integer(type, rwbs, \ ++ (((op) == REQ_OP_WRITE || (op) == REQ_OP_WRITE_SAME) ? RWBS_FLAG_WRITE : \ ++ ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \ ++ ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \ ++ ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \ ++ ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \ ++ ( 0 )))))) \ ++ | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \ ++ | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \ ++ | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \ ++ | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \ ++ | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0)) ++ ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) + +-#define blk_rwbs_ctf_integer(type, rwbs, rw, bytes) \ ++#define lttng_req_op(rq) ++#define lttng_req_rw(rq) ((rq)->cmd_flags) ++#define lttng_bio_op(bio) ++#define lttng_bio_rw(bio) ((bio)->bi_rw) ++ ++#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ + ctf_integer(type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \ + ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \ + ( (bytes) ? RWBS_FLAG_READ : \ +@@ -44,7 +71,12 @@ enum { + + #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) + +-#define blk_rwbs_ctf_integer(type, rwbs, rw, bytes) \ ++#define lttng_req_op(rq) ++#define lttng_req_rw(rq) ((rq)->cmd_flags) ++#define lttng_bio_op(bio) ++#define lttng_bio_rw(bio) ((bio)->bi_rw) ++ ++#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ + ctf_integer(type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \ + ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \ + ( (bytes) ? RWBS_FLAG_READ : \ +@@ -56,7 +88,12 @@ enum { + + #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) + +-#define blk_rwbs_ctf_integer(type, rwbs, rw, bytes) \ ++#define lttng_req_op(rq) ++#define lttng_req_rw(rq) ((rq)->cmd_flags) ++#define lttng_bio_op(bio) ++#define lttng_bio_rw(bio) ((bio)->bi_rw) ++ ++#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ + ctf_integer(type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \ + ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \ + ( (bytes) ? RWBS_FLAG_READ : \ +@@ -69,7 +106,12 @@ enum { + + #else + +-#define blk_rwbs_ctf_integer(type, rwbs, rw, bytes) \ ++#define lttng_req_op(rq) ++#define lttng_req_rw(rq) ((rq)->cmd_flags) ++#define lttng_bio_op(bio) ++#define lttng_bio_rw(bio) ((bio)->bi_rw) ++ ++#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ + ctf_integer(type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \ + ( (rw) & (1 << BIO_RW_DISCARD) ? RWBS_FLAG_DISCARD : \ + ( (bytes) ? RWBS_FLAG_READ : \ +@@ -156,7 +198,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error, + ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector) + ctf_integer(int, errors, rq->errors) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- rq->cmd_flags, blk_rq_bytes(rq)) ++ lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) + ctf_sequence_hex(unsigned char, cmd, + tp_locvar->cmd, size_t, tp_locvar->cmd_len) + ), +@@ -246,7 +288,7 @@ LTTNG_TRACEPOINT_EVENT_CODE(block_rq_complete, + ctf_integer(unsigned int, nr_sector, nr_bytes >> 9) + ctf_integer(int, errors, rq->errors) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- rq->cmd_flags, nr_bytes) ++ lttng_req_op(rq), lttng_req_rw(rq), nr_bytes) + ctf_sequence_hex(unsigned char, cmd, + tp_locvar->cmd, size_t, tp_locvar->cmd_len) + ), +@@ -314,7 +356,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq, + ctf_integer(unsigned int, bytes, tp_locvar->bytes) + ctf_integer(pid_t, tid, current->pid) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- rq->cmd_flags, blk_rq_bytes(rq)) ++ lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) + ctf_sequence_hex(unsigned char, cmd, + tp_locvar->cmd, size_t, tp_locvar->cmd_len) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) +@@ -378,12 +420,14 @@ LTTNG_TRACEPOINT_EVENT(block_bio_bounce, + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_iter.bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), ++ bio->bi_iter.bi_size) + #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio->bi_sector) + ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), ++ bio->bi_size) + #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) +@@ -418,7 +462,8 @@ LTTNG_TRACEPOINT_EVENT(block_bio_complete, + ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) + ctf_integer(int, error, error) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_iter.bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), ++ bio->bi_iter.bi_size) + #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio->bi_sector) + ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) +@@ -428,7 +473,7 @@ LTTNG_TRACEPOINT_EVENT(block_bio_complete, + ctf_integer(int, error, 0) + #endif + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) + #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ) + ) +@@ -446,12 +491,13 @@ LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge, + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_iter.bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), ++ bio->bi_iter.bi_size) + #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio->bi_sector) + ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) + #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) +@@ -507,12 +553,13 @@ LTTNG_TRACEPOINT_EVENT(block_bio_queue, + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_iter.bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), ++ bio->bi_iter.bi_size) + #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio->bi_sector) + ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) + #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) +@@ -530,7 +577,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(block_bio, + ctf_integer(sector_t, sector, bio->bi_sector) + ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +@@ -594,14 +641,16 @@ LTTNG_TRACEPOINT_EVENT_CLASS(block_get_rq, + ctf_integer(unsigned int, nr_sector, + bio ? bio_sectors(bio) : 0) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio ? bio->bi_rw : 0, ++ bio ? lttng_bio_op(bio) : 0, ++ bio ? lttng_bio_rw(bio) : 0, + bio ? bio->bi_iter.bi_size : 0) + #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio ? bio->bi_sector : 0) + ctf_integer(unsigned int, nr_sector, + bio ? bio->bi_size >> 9 : 0) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio ? bio->bi_rw : 0, ++ bio ? lttng_bio_op(bio) : 0, ++ bio ? lttng_bio_rw(bio) : 0, + bio ? bio->bi_size : 0) + #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(pid_t, tid, current->pid) +@@ -751,11 +800,12 @@ LTTNG_TRACEPOINT_EVENT(block_split, + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_iter.bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), ++ bio->bi_iter.bi_size) + #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio->bi_sector) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) + #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, new_sector, new_sector) + ctf_integer(pid_t, tid, current->pid) +@@ -790,12 +840,13 @@ LTTNG_TRACEPOINT_EVENT(block_remap, + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_iter.bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), ++ bio->bi_iter.bi_size) + #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio->bi_sector) + ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- bio->bi_rw, bio->bi_size) ++ lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) + #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(dev_t, old_dev, dev) + ctf_integer(sector_t, old_sector, from) +@@ -828,7 +879,7 @@ LTTNG_TRACEPOINT_EVENT(block_rq_remap, + ctf_integer(dev_t, old_dev, dev) + ctf_integer(sector_t, old_sector, from) + blk_rwbs_ctf_integer(unsigned int, rwbs, +- rq->cmd_flags, blk_rq_bytes(rq)) ++ lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) + ) + ) + #endif +-- +2.7.4 + diff -Nru lttng-modules-2.8.0/debian/patches/0004-Fix-napi-instrumentation-for-4.8-kernels.patch lttng-modules-2.8.0/debian/patches/0004-Fix-napi-instrumentation-for-4.8-kernels.patch --- lttng-modules-2.8.0/debian/patches/0004-Fix-napi-instrumentation-for-4.8-kernels.patch 1969-12-31 19:00:00.000000000 -0500 +++ lttng-modules-2.8.0/debian/patches/0004-Fix-napi-instrumentation-for-4.8-kernels.patch 2016-12-01 11:35:58.000000000 -0500 @@ -0,0 +1,51 @@ +From c1dacd91afb9874948d9e469496620a1aa27f0a9 Mon Sep 17 00:00:00 2001 +From: Mathieu Desnoyers +Date: Tue, 30 Aug 2016 17:02:09 -0400 +Subject: [PATCH 4/6] Fix: napi instrumentation for 4.8 kernels + +Signed-off-by: Mathieu Desnoyers +--- + instrumentation/events/lttng-module/napi.h | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/instrumentation/events/lttng-module/napi.h b/instrumentation/events/lttng-module/napi.h +index 1126dd4..7b5ecfc 100644 +--- a/instrumentation/events/lttng-module/napi.h ++++ b/instrumentation/events/lttng-module/napi.h +@@ -10,6 +10,24 @@ + + #define NO_DEV "(no_device)" + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) ++ ++LTTNG_TRACEPOINT_EVENT(napi_poll, ++ ++ TP_PROTO(struct napi_struct *napi, int work, int budget), ++ ++ TP_ARGS(napi, work, budget), ++ ++ TP_FIELDS( ++ ctf_integer_hex(struct napi_struct *, napi, napi) ++ ctf_string(dev_name, napi->dev ? napi->dev->name : NO_DEV) ++ ctf_integer(int, work, work) ++ ctf_integer(int, budget, budget) ++ ) ++) ++ ++#else ++ + LTTNG_TRACEPOINT_EVENT(napi_poll, + + TP_PROTO(struct napi_struct *napi), +@@ -22,6 +40,8 @@ LTTNG_TRACEPOINT_EVENT(napi_poll, + ) + ) + ++#endif ++ + #undef NO_DEV + + #endif /* LTTNG_TRACE_NAPI_H */ +-- +2.7.4 + diff -Nru lttng-modules-2.8.0/debian/patches/0005-Fix-update-mm_vmscan-instrumentation-for-kernel-4.8.patch lttng-modules-2.8.0/debian/patches/0005-Fix-update-mm_vmscan-instrumentation-for-kernel-4.8.patch --- lttng-modules-2.8.0/debian/patches/0005-Fix-update-mm_vmscan-instrumentation-for-kernel-4.8.patch 1969-12-31 19:00:00.000000000 -0500 +++ lttng-modules-2.8.0/debian/patches/0005-Fix-update-mm_vmscan-instrumentation-for-kernel-4.8.patch 2016-12-01 11:36:05.000000000 -0500 @@ -0,0 +1,211 @@ +From 026909ddb03f43b871561dcc3ad150e02423df81 Mon Sep 17 00:00:00 2001 +From: Mathieu Desnoyers +Date: Tue, 30 Aug 2016 17:13:37 -0400 +Subject: [PATCH 5/6] Fix: update mm_vmscan instrumentation for kernel 4.8 + +Signed-off-by: Mathieu Desnoyers +--- + instrumentation/events/lttng-module/mm_vmscan.h | 145 +++++++++++++++++++++++- + 1 file changed, 144 insertions(+), 1 deletion(-) + +diff --git a/instrumentation/events/lttng-module/mm_vmscan.h b/instrumentation/events/lttng-module/mm_vmscan.h +index 56f020e..36ebd5c 100644 +--- a/instrumentation/events/lttng-module/mm_vmscan.h ++++ b/instrumentation/events/lttng-module/mm_vmscan.h +@@ -53,6 +53,23 @@ LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_sleep, + ) + ) + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) ++ ++LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake, ++ ++ TP_PROTO(int nid, int zid, int order), ++ ++ TP_ARGS(nid, zid, order), ++ ++ TP_FIELDS( ++ ctf_integer(int, nid, nid) ++ ctf_integer(int, zid, zid) ++ ctf_integer(int, order, order) ++ ) ++) ++ ++#else ++ + LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake, + + TP_PROTO(int nid, int order), +@@ -65,6 +82,8 @@ LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake, + ) + ) + ++#endif ++ + LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, + + TP_PROTO(int nid, int zid, int order), +@@ -78,6 +97,45 @@ LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, + ) + ) + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) ++ ++LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, ++ ++ TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), ++ ++ TP_ARGS(order, may_writepage, gfp_flags, classzone_idx), ++ ++ TP_FIELDS( ++ ctf_integer(int, order, order) ++ ctf_integer(int, may_writepage, may_writepage) ++ ctf_integer(gfp_t, gfp_flags, gfp_flags) ++ ctf_integer(int, classzone_idx, classzone_idx) ++ ) ++) ++ ++LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, ++ ++ TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), ++ ++ TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) ++) ++ ++LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, ++ ++ TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), ++ ++ TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) ++) ++ ++LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, ++ ++ TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), ++ ++ TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) ++) ++ ++#else ++ + LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, + + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), +@@ -112,6 +170,8 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmsc + TP_ARGS(order, may_writepage, gfp_flags) + ) + ++#endif ++ + LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template, + + TP_PROTO(unsigned long nr_reclaimed), +@@ -221,6 +281,70 @@ LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end, + #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */ + #endif + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) ++ ++LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template, ++ ++ TP_PROTO(int classzone_idx, ++ int order, ++ unsigned long nr_requested, ++ unsigned long nr_scanned, ++ unsigned long nr_taken, ++ isolate_mode_t isolate_mode, ++ int file ++ ), ++ ++ TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, ++ isolate_mode, file ++ ), ++ ++ ++ TP_FIELDS( ++ ctf_integer(int, classzone_idx, classzone_idx) ++ ctf_integer(int, order, order) ++ ctf_integer(unsigned long, nr_requested, nr_requested) ++ ctf_integer(unsigned long, nr_scanned, nr_scanned) ++ ctf_integer(unsigned long, nr_taken, nr_taken) ++ ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) ++ ctf_integer(int, file, file) ++ ) ++) ++ ++LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, ++ ++ TP_PROTO(int classzone_idx, ++ int order, ++ unsigned long nr_requested, ++ unsigned long nr_scanned, ++ unsigned long nr_taken, ++ isolate_mode_t isolate_mode, ++ int file ++ ), ++ ++ TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, ++ isolate_mode, file ++ ) ++ ++) ++ ++LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, ++ ++ TP_PROTO(int classzone_idx, ++ int order, ++ unsigned long nr_requested, ++ unsigned long nr_scanned, ++ unsigned long nr_taken, ++ isolate_mode_t isolate_mode, ++ int file ++ ), ++ ++ TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, ++ isolate_mode, file ++ ) ++) ++ ++#else ++ + LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template, + + TP_PROTO(int order, +@@ -332,6 +456,8 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_ + ) + ) + ++#endif ++ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) + LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, + +@@ -359,7 +485,24 @@ LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, + ) + #endif + +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) ++LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, ++ ++ TP_PROTO(int nid, ++ unsigned long nr_scanned, unsigned long nr_reclaimed, ++ int priority, int file), ++ ++ TP_ARGS(nid, nr_scanned, nr_reclaimed, priority, file), ++ ++ TP_FIELDS( ++ ctf_integer(int, nid, nid) ++ ctf_integer(unsigned long, nr_scanned, nr_scanned) ++ ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) ++ ctf_integer(int, priority, priority) ++ ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) ++ ) ++) ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) + LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, + + TP_PROTO(struct zone *zone, +-- +2.7.4 + diff -Nru lttng-modules-2.8.0/debian/patches/0006-Fix-btrfs-instrumentation-for-4.8-kernel.patch lttng-modules-2.8.0/debian/patches/0006-Fix-btrfs-instrumentation-for-4.8-kernel.patch --- lttng-modules-2.8.0/debian/patches/0006-Fix-btrfs-instrumentation-for-4.8-kernel.patch 1969-12-31 19:00:00.000000000 -0500 +++ lttng-modules-2.8.0/debian/patches/0006-Fix-btrfs-instrumentation-for-4.8-kernel.patch 2016-12-01 11:36:10.000000000 -0500 @@ -0,0 +1,129 @@ +From 518d405eb97936c084abed4542b9e62d99d7ff75 Mon Sep 17 00:00:00 2001 +From: Mathieu Desnoyers +Date: Tue, 30 Aug 2016 17:32:35 -0400 +Subject: [PATCH 6/6] Fix: btrfs instrumentation for 4.8 kernel + +Note: there are missing events. + +Signed-off-by: Mathieu Desnoyers +--- + instrumentation/events/lttng-module/btrfs.h | 74 +++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) + +diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h +index 38c66c1..ea6710f 100644 +--- a/instrumentation/events/lttng-module/btrfs.h ++++ b/instrumentation/events/lttng-module/btrfs.h +@@ -222,6 +222,18 @@ LTTNG_TRACEPOINT_EVENT(btrfs_sync_file, + ) + ) + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) ++LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, ++ ++ TP_PROTO(struct btrfs_fs_info *fs_info, int wait), ++ ++ TP_ARGS(fs_info, wait), ++ ++ TP_FIELDS( ++ ctf_integer(int, wait, wait) ++ ) ++) ++#else + LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, + + TP_PROTO(int wait), +@@ -232,7 +244,48 @@ LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, + ctf_integer(int, wait, wait) + ) + ) ++#endif ++ ++LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, ++ ++ TP_PROTO(struct btrfs_fs_info *fs_info, ++ struct btrfs_block_group_cache *block_group, int create), ++ ++ TP_ARGS(fs_info, block_group, create), ++ ++ TP_FIELDS( ++ ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE) ++ ctf_integer(u64, offset, block_group->key.objectid) ++ ctf_integer(u64, size, block_group->key.offset) ++ ctf_integer(u64, flags, block_group->flags) ++ ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item)) ++ ctf_integer(u64, bytes_super, block_group->bytes_super) ++ ctf_integer(int, create, create) ++ ) ++) + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) ++LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref, ++ ++ TP_PROTO(struct btrfs_fs_info *fs_info, ++ struct btrfs_delayed_ref_node *ref, ++ struct btrfs_delayed_tree_ref *full_ref, ++ int action), ++ ++ TP_ARGS(fs_info, ref, full_ref, action), ++ ++ TP_FIELDS( ++ ctf_integer(u64, bytenr, ref->bytenr) ++ ctf_integer(u64, num_bytes, ref->num_bytes) ++ ctf_integer(int, action, action) ++ ctf_integer(u64, parent, full_ref->parent) ++ ctf_integer(u64, ref_root, full_ref->root) ++ ctf_integer(int, level, full_ref->level) ++ ctf_integer(int, type, ref->type) ++ ctf_integer(u64, seq, ref->seq) ++ ) ++) ++#else + LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, +@@ -254,6 +307,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref, + #endif + ) + ) ++#endif + + LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref, + +@@ -278,6 +332,25 @@ LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref, + ) + ) + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) ++LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head, ++ ++ TP_PROTO(struct btrfs_fs_info *fs_info, ++ struct btrfs_delayed_ref_node *ref, ++ struct btrfs_delayed_ref_head *head_ref, ++ int action), ++ ++ TP_ARGS(fs_info, ref, head_ref, action), ++ ++ TP_FIELDS( ++ ctf_integer(u64, bytenr, ref->bytenr) ++ ctf_integer(u64, num_bytes, ref->num_bytes) ++ ctf_integer(int, action, action) ++ ctf_integer(int, is_data, head_ref->is_data) ++ ) ++) ++ ++#else + LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, +@@ -293,6 +366,7 @@ LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head, + ctf_integer(int, is_data, head_ref->is_data) + ) + ) ++#endif + + LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, + +-- +2.7.4 + diff -Nru lttng-modules-2.8.0/debian/patches/series lttng-modules-2.8.0/debian/patches/series --- lttng-modules-2.8.0/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 +++ lttng-modules-2.8.0/debian/patches/series 2016-12-01 11:15:09.000000000 -0500 @@ -0,0 +1,6 @@ +0001-Fix-Add-support-for-4.6.4-rt8-kernel.patch +0002-Fix-timer-wrapper-support-kernels-4.8.patch +0003-Fix-update-block-instrumentation-to-compile-on-4.8-k.patch +0004-Fix-napi-instrumentation-for-4.8-kernels.patch +0005-Fix-update-mm_vmscan-instrumentation-for-kernel-4.8.patch +0006-Fix-btrfs-instrumentation-for-4.8-kernel.patch