diff -Nru lttng-modules-2.6.2/debian/changelog lttng-modules-2.6.2/debian/changelog --- lttng-modules-2.6.2/debian/changelog 2015-07-24 20:02:03.000000000 +0000 +++ lttng-modules-2.6.2/debian/changelog 2015-08-24 14:56:18.000000000 +0000 @@ -1,3 +1,22 @@ +lttng-modules (2.6.2-1ubuntu3) wily; urgency=medium + + * Support linux 4.2 + Dropped Fix-disable-kvm-probe-if-lapic.h-isn-t-found.patch + Updated from git://git.lttng.org/lttng-modules.git stable-2.6 + git format-patch 7a88f8b50696dd71e80c08661159caf8e119bf51..0e648dfbed54d26f95a302d62512517ae09c8315 + 0001-Fix-use-after-free-on-metadata-cache-reallocation.patch + 0002-Fix-Building-the-event-list-fails-on-fragmented-memo.patch + 0003-Fix-allow-LTTng-to-be-built-within-kernel-tree.patch + 0004-Fix-kvm-instrumentation-for-4.2-kernels.patch + 0005-Fix-ext4-instrumentation-for-4.2-kernels.patch + 0006-Fix-timer-instrumentation-for-4.2-kernels.patch + 0007-Fix-disable-kvm-probe-if-lapic.h-isn-t-found.patch + 0008-Fix-kmem-probe-with-Ubuntu-3.13-kernels.patch + 0009-Fix-mm_page_alloc_extfrag-instrumentation-for-kernel.patch + 0010-Fix-writeback-instrumentation-for-4.2-kernels.patch + + -- Tim Gardner Mon, 24 Aug 2015 08:47:13 -0600 + lttng-modules (2.6.2-1ubuntu2) wily; urgency=medium * dkms: Don't install regmap trace module. diff -Nru lttng-modules-2.6.2/debian/patches/0001-Fix-use-after-free-on-metadata-cache-reallocation.patch lttng-modules-2.6.2/debian/patches/0001-Fix-use-after-free-on-metadata-cache-reallocation.patch --- lttng-modules-2.6.2/debian/patches/0001-Fix-use-after-free-on-metadata-cache-reallocation.patch 1970-01-01 00:00:00.000000000 +0000 +++ lttng-modules-2.6.2/debian/patches/0001-Fix-use-after-free-on-metadata-cache-reallocation.patch 2015-08-24 14:44:40.000000000 +0000 @@ -0,0 +1,155 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + lttng-modules (2.6.2-1ubuntu2) wily; urgency=medium + . + * dkms: Don't install regmap trace module. +Author: Chris J Arges + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- lttng-modules-2.6.2.orig/lttng-abi.c ++++ lttng-modules-2.6.2/lttng-abi.c +@@ -565,9 +565,11 @@ unsigned int lttng_metadata_ring_buffer_ + if (finalized) + mask |= POLLHUP; + ++ mutex_lock(&stream->metadata_cache->lock); + if (stream->metadata_cache->metadata_written > + stream->metadata_out) + mask |= POLLIN; ++ mutex_unlock(&stream->metadata_cache->lock); + } + + return mask; +@@ -865,7 +867,6 @@ int lttng_abi_open_metadata_stream(struc + metadata_stream->priv = buf; + stream_priv = metadata_stream; + metadata_stream->transport = channel->transport; +- mutex_init(&metadata_stream->lock); + + /* + * Since life-time of metadata cache differs from that of +--- lttng-modules-2.6.2.orig/lttng-events.c ++++ lttng-modules-2.6.2/lttng-events.c +@@ -102,6 +102,7 @@ struct lttng_session *lttng_session_crea + goto err_free_cache; + metadata_cache->cache_alloc = METADATA_CACHE_DEFAULT_SIZE; + kref_init(&metadata_cache->refcount); ++ mutex_init(&metadata_cache->lock); + session->metadata_cache = metadata_cache; + INIT_LIST_HEAD(&metadata_cache->metadata_stream); + memcpy(&metadata_cache->uuid, &session->uuid, +@@ -595,10 +596,12 @@ void _lttng_event_destroy(struct lttng_e + /* + * Serialize at most one packet worth of metadata into a metadata + * channel. +- * We have exclusive access to our metadata buffer (protected by the +- * sessions_mutex), so we can do racy operations such as looking for +- * remaining space left in packet and write, since mutual exclusion +- * protects us from concurrent writes. ++ * We grab the metadata cache mutex to get exclusive access to our metadata ++ * buffer and to the metadata cache. Exclusive access to the metadata buffer ++ * allows us to do racy operations such as looking for remaining space left in ++ * packet and write, since mutual exclusion protects us from concurrent writes. ++ * Mutual exclusion on the metadata cache allow us to read the cache content ++ * without racing against reallocation of the cache by updates. + * Returns the number of bytes written in the channel, 0 if no data + * was written and a negative value on error. + */ +@@ -610,13 +613,15 @@ int lttng_metadata_output_channel(struct + size_t len, reserve_len; + + /* +- * Ensure we support mutiple get_next / put sequences followed +- * by put_next. The metadata stream lock internally protects +- * reading the metadata cache. It can indeed be read +- * concurrently by "get_next_subbuf" and "flush" operations on +- * the buffer invoked by different processes. ++ * Ensure we support mutiple get_next / put sequences followed by ++ * put_next. The metadata cache lock protects reading the metadata ++ * cache. It can indeed be read concurrently by "get_next_subbuf" and ++ * "flush" operations on the buffer invoked by different processes. ++ * Moreover, since the metadata cache memory can be reallocated, we ++ * need to have exclusive access against updates even though we only ++ * read it. + */ +- mutex_lock(&stream->lock); ++ mutex_lock(&stream->metadata_cache->lock); + WARN_ON(stream->metadata_in < stream->metadata_out); + if (stream->metadata_in != stream->metadata_out) + goto end; +@@ -646,13 +651,15 @@ int lttng_metadata_output_channel(struct + ret = reserve_len; + + end: +- mutex_unlock(&stream->lock); ++ mutex_unlock(&stream->metadata_cache->lock); + return ret; + } + + /* + * Write the metadata to the metadata cache. + * Must be called with sessions_mutex held. ++ * The metadata cache lock protects us from concurrent read access from ++ * thread outputting metadata content to ring buffer. + */ + int lttng_metadata_printf(struct lttng_session *session, + const char *fmt, ...) +@@ -671,6 +678,7 @@ int lttng_metadata_printf(struct lttng_s + return -ENOMEM; + + len = strlen(str); ++ mutex_lock(&session->metadata_cache->lock); + if (session->metadata_cache->metadata_written + len > + session->metadata_cache->cache_alloc) { + char *tmp_cache_realloc; +@@ -690,6 +698,7 @@ int lttng_metadata_printf(struct lttng_s + session->metadata_cache->metadata_written, + str, len); + session->metadata_cache->metadata_written += len; ++ mutex_unlock(&session->metadata_cache->lock); + kfree(str); + + list_for_each_entry(stream, &session->metadata_cache->metadata_stream, list) +@@ -698,6 +707,7 @@ int lttng_metadata_printf(struct lttng_s + return 0; + + err: ++ mutex_unlock(&session->metadata_cache->lock); + kfree(str); + return -ENOMEM; + } +--- lttng-modules-2.6.2.orig/lttng-events.h ++++ lttng-modules-2.6.2/lttng-events.h +@@ -321,7 +321,6 @@ struct lttng_metadata_stream { + wait_queue_head_t read_wait; /* Reader buffer-level wait queue */ + struct list_head list; /* Stream list */ + struct lttng_transport *transport; +- struct mutex lock; + }; + + struct lttng_session { +@@ -344,6 +343,7 @@ struct lttng_metadata_cache { + struct kref refcount; /* Metadata cache usage */ + struct list_head metadata_stream; /* Metadata stream list */ + uuid_le uuid; /* Trace session unique ID (copy) */ ++ struct mutex lock; + }; + + struct lttng_session *lttng_session_create(void); diff -Nru lttng-modules-2.6.2/debian/patches/0002-Fix-Building-the-event-list-fails-on-fragmented-memo.patch lttng-modules-2.6.2/debian/patches/0002-Fix-Building-the-event-list-fails-on-fragmented-memo.patch --- lttng-modules-2.6.2/debian/patches/0002-Fix-Building-the-event-list-fails-on-fragmented-memo.patch 1970-01-01 00:00:00.000000000 +0000 +++ lttng-modules-2.6.2/debian/patches/0002-Fix-Building-the-event-list-fails-on-fragmented-memo.patch 2015-08-24 14:44:50.000000000 +0000 @@ -0,0 +1,74 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + lttng-modules (2.6.2-1ubuntu2) wily; urgency=medium + . + * dkms: Don't install regmap trace module. +Author: Chris J Arges + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- lttng-modules-2.6.2.orig/lttng-events.c ++++ lttng-modules-2.6.2/lttng-events.c +@@ -34,6 +34,8 @@ + #include + #include + #include ++#include ++ + #include "wrapper/uuid.h" + #include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ + #include "wrapper/random.h" +@@ -96,8 +98,7 @@ struct lttng_session *lttng_session_crea + GFP_KERNEL); + if (!metadata_cache) + goto err_free_session; +- metadata_cache->data = kzalloc(METADATA_CACHE_DEFAULT_SIZE, +- GFP_KERNEL); ++ metadata_cache->data = vzalloc(METADATA_CACHE_DEFAULT_SIZE); + if (!metadata_cache->data) + goto err_free_cache; + metadata_cache->cache_alloc = METADATA_CACHE_DEFAULT_SIZE; +@@ -124,7 +125,7 @@ void metadata_cache_destroy(struct kref + { + struct lttng_metadata_cache *cache = + container_of(kref, struct lttng_metadata_cache, refcount); +- kfree(cache->data); ++ vfree(cache->data); + kfree(cache); + } + +@@ -687,10 +688,16 @@ int lttng_metadata_printf(struct lttng_s + tmp_cache_alloc_size = max_t(unsigned int, + session->metadata_cache->cache_alloc + len, + session->metadata_cache->cache_alloc << 1); +- tmp_cache_realloc = krealloc(session->metadata_cache->data, +- tmp_cache_alloc_size, GFP_KERNEL); ++ tmp_cache_realloc = vzalloc(tmp_cache_alloc_size); + if (!tmp_cache_realloc) + goto err; ++ if (session->metadata_cache->data) { ++ memcpy(tmp_cache_realloc, ++ session->metadata_cache->data, ++ session->metadata_cache->cache_alloc); ++ vfree(session->metadata_cache->data); ++ } ++ + session->metadata_cache->cache_alloc = tmp_cache_alloc_size; + session->metadata_cache->data = tmp_cache_realloc; + } diff -Nru lttng-modules-2.6.2/debian/patches/0003-Fix-allow-LTTng-to-be-built-within-kernel-tree.patch lttng-modules-2.6.2/debian/patches/0003-Fix-allow-LTTng-to-be-built-within-kernel-tree.patch --- lttng-modules-2.6.2/debian/patches/0003-Fix-allow-LTTng-to-be-built-within-kernel-tree.patch 1970-01-01 00:00:00.000000000 +0000 +++ lttng-modules-2.6.2/debian/patches/0003-Fix-allow-LTTng-to-be-built-within-kernel-tree.patch 2015-08-24 14:45:00.000000000 +0000 @@ -0,0 +1,89 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + lttng-modules (2.6.2-1ubuntu2) wily; urgency=medium + . + * dkms: Don't install regmap trace module. +Author: Chris J Arges + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- lttng-modules-2.6.2.orig/Makefile ++++ lttng-modules-2.6.2/Makefile +@@ -5,11 +5,13 @@ + ifneq ($(KERNELRELEASE),) + ifneq ($(CONFIG_TRACEPOINTS),) + +-KERNELDIR=${LTTNG_KERNELDIR} ++KERNELDIR = ${LTTNG_KERNELDIR} ++MAKEFILEDIR = $(shell dirname $(lastword $(MAKEFILE_LIST))) + + lttng_check_linux_version = $(shell pwd)/include/linux/version.h + lttng_check_generated_linux_version = $(shell pwd)/include/generated/uapi/linux/version.h + ++ + # + # Check for stale version.h, which can be a leftover from an old Linux + # kernel tree moved to a newer kernel version, only pruned by make +@@ -21,7 +23,7 @@ $(error Duplicate version.h files found + endif + endif + +-include $(KBUILD_EXTMOD)/Makefile.ABI.workarounds ++include $(MAKEFILEDIR)/Makefile.ABI.workarounds + + obj-m += lttng-ring-buffer-client-discard.o + obj-m += lttng-ring-buffer-client-overwrite.o +--- lttng-modules-2.6.2.orig/Makefile.ABI.workarounds ++++ lttng-modules-2.6.2/Makefile.ABI.workarounds +@@ -4,7 +4,7 @@ + # 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 $(KERNELDIR)) ++DEB_API_VERSION=$(shell $(MAKEFILEDIR)/abi-debian-version.sh $(KERNELDIR)) + + ifneq ($(DEB_API_VERSION), 0) + ccflags-y += -DDEBIAN_API_VERSION=$(DEB_API_VERSION) +--- lttng-modules-2.6.2.orig/lib/Makefile ++++ lttng-modules-2.6.2/lib/Makefile +@@ -1,6 +1,7 @@ +-KERNELDIR=${LTTNG_KERNELDIR} ++KERNELDIR = ${LTTNG_KERNELDIR} ++MAKEFILEDIR = $(shell dirname $(lastword $(MAKEFILE_LIST))) + +-include $(KBUILD_EXTMOD)/Makefile.ABI.workarounds ++include $(MAKEFILEDIR)/../Makefile.ABI.workarounds + + obj-m += lttng-lib-ring-buffer.o + +--- lttng-modules-2.6.2.orig/probes/Makefile ++++ lttng-modules-2.6.2/probes/Makefile +@@ -5,9 +5,10 @@ + ifneq ($(KERNELRELEASE),) + ifneq ($(CONFIG_TRACEPOINTS),) + +-KERNELDIR=${LTTNG_KERNELDIR} ++KERNELDIR = ${LTTNG_KERNELDIR} ++MAKEFILEDIR = $(shell dirname $(lastword $(MAKEFILE_LIST))) + +-include $(KBUILD_EXTMOD)/Makefile.ABI.workarounds ++include $(MAKEFILEDIR)/../Makefile.ABI.workarounds + + ccflags-y += -I$(PWD)/probes + obj-m += lttng-types.o diff -Nru lttng-modules-2.6.2/debian/patches/0004-Fix-kvm-instrumentation-for-4.2-kernels.patch lttng-modules-2.6.2/debian/patches/0004-Fix-kvm-instrumentation-for-4.2-kernels.patch --- lttng-modules-2.6.2/debian/patches/0004-Fix-kvm-instrumentation-for-4.2-kernels.patch 1970-01-01 00:00:00.000000000 +0000 +++ lttng-modules-2.6.2/debian/patches/0004-Fix-kvm-instrumentation-for-4.2-kernels.patch 2015-08-24 14:45:20.000000000 +0000 @@ -0,0 +1,43 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + lttng-modules (2.6.2-1ubuntu2) wily; urgency=medium + . + * dkms: Don't install regmap trace module. +Author: Chris J Arges + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- lttng-modules-2.6.2.orig/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h ++++ lttng-modules-2.6.2/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h +@@ -2,9 +2,14 @@ + #define LTTNG_TRACE_KVMMMU_H + + #include "../../../../../../probes/lttng-tracepoint-event.h" +-#include + #include + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) ++#include ++#else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ ++#include ++#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ ++ + #undef TRACE_SYSTEM + #define TRACE_SYSTEM kvmmmu + diff -Nru lttng-modules-2.6.2/debian/patches/0005-Fix-ext4-instrumentation-for-4.2-kernels.patch lttng-modules-2.6.2/debian/patches/0005-Fix-ext4-instrumentation-for-4.2-kernels.patch --- lttng-modules-2.6.2/debian/patches/0005-Fix-ext4-instrumentation-for-4.2-kernels.patch 1970-01-01 00:00:00.000000000 +0000 +++ lttng-modules-2.6.2/debian/patches/0005-Fix-ext4-instrumentation-for-4.2-kernels.patch 2015-08-24 14:45:28.000000000 +0000 @@ -0,0 +1,71 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + lttng-modules (2.6.2-1ubuntu2) wily; urgency=medium + . + * dkms: Don't install regmap trace module. +Author: Chris J Arges + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- lttng-modules-2.6.2.orig/instrumentation/events/lttng-module/ext4.h ++++ lttng-modules-2.6.2/instrumentation/events/lttng-module/ext4.h +@@ -1511,6 +1511,35 @@ LTTNG_TRACEPOINT_EVENT(ext4_da_update_re + #endif + ) + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) ++LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, ++ TP_PROTO(struct inode *inode), ++ ++ TP_ARGS(inode), ++ ++ TP_STRUCT__entry( ++ __field( dev_t, dev ) ++ __field( ino_t, ino ) ++ __field( __u64, i_blocks ) ++ __field( int, reserved_data_blocks ) ++ __field( int, reserved_meta_blocks ) ++ __field( TP_MODE_T, mode ) ++ ), ++ ++ TP_fast_assign( ++ tp_assign(dev, inode->i_sb->s_dev) ++ tp_assign(ino, inode->i_ino) ++ tp_assign(i_blocks, inode->i_blocks) ++ tp_assign(reserved_data_blocks, ++ EXT4_I(inode)->i_reserved_data_blocks) ++ tp_assign(reserved_meta_blocks, ++ EXT4_I(inode)->i_reserved_meta_blocks) ++ tp_assign(mode, inode->i_mode) ++ ), ++ ++ TP_printk() ++) ++#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ + LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, + TP_PROTO(struct inode *inode, int md_needed), + +@@ -1546,6 +1575,7 @@ LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_s + __entry->md_needed, __entry->reserved_data_blocks, + __entry->reserved_meta_blocks) + ) ++#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ + + LTTNG_TRACEPOINT_EVENT(ext4_da_release_space, + TP_PROTO(struct inode *inode, int freed_blocks), diff -Nru lttng-modules-2.6.2/debian/patches/0006-Fix-timer-instrumentation-for-4.2-kernels.patch lttng-modules-2.6.2/debian/patches/0006-Fix-timer-instrumentation-for-4.2-kernels.patch --- lttng-modules-2.6.2/debian/patches/0006-Fix-timer-instrumentation-for-4.2-kernels.patch 1970-01-01 00:00:00.000000000 +0000 +++ lttng-modules-2.6.2/debian/patches/0006-Fix-timer-instrumentation-for-4.2-kernels.patch 2015-08-24 14:45:37.000000000 +0000 @@ -0,0 +1,83 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + lttng-modules (2.6.2-1ubuntu2) wily; urgency=medium + . + * dkms: Don't install regmap trace module. +Author: Chris J Arges + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- lttng-modules-2.6.2.orig/instrumentation/events/lttng-module/timer.h ++++ lttng-modules-2.6.2/instrumentation/events/lttng-module/timer.h +@@ -10,6 +10,7 @@ + #define _TRACE_TIMER_DEF_ + #include + #include ++#include + + struct timer_list; + +@@ -43,6 +44,39 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(timer_cl + TP_ARGS(timer) + ) + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) ++/** ++ * timer_start - called when the timer is started ++ * @timer: pointer to struct timer_list ++ * @expires: the timers expiry time ++ * @flags: the timers expiry time ++ */ ++LTTNG_TRACEPOINT_EVENT(timer_start, ++ ++ TP_PROTO(struct timer_list *timer, unsigned long expires, ++ unsigned int flags), ++ ++ TP_ARGS(timer, expires, flags), ++ ++ TP_STRUCT__entry( ++ __field( void *, timer ) ++ __field( void *, function ) ++ __field( unsigned long, expires ) ++ __field( unsigned long, now ) ++ __field( unsigned int, flags ) ++ ), ++ ++ TP_fast_assign( ++ tp_assign(timer, timer) ++ tp_assign(function, timer->function) ++ tp_assign(expires, expires) ++ tp_assign(now, jiffies) ++ tp_assign(flags, flags) ++ ), ++ ++ TP_printk() ++) ++#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ + /** + * timer_start - called when the timer is started + * @timer: pointer to struct timer_list +@@ -72,6 +106,7 @@ LTTNG_TRACEPOINT_EVENT(timer_start, + __entry->timer, __entry->function, __entry->expires, + (long)__entry->expires - __entry->now) + ) ++#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ + + /** + * timer_expire_entry - called immediately before the timer callback diff -Nru lttng-modules-2.6.2/debian/patches/0007-Fix-disable-kvm-probe-if-lapic.h-isn-t-found.patch lttng-modules-2.6.2/debian/patches/0007-Fix-disable-kvm-probe-if-lapic.h-isn-t-found.patch --- lttng-modules-2.6.2/debian/patches/0007-Fix-disable-kvm-probe-if-lapic.h-isn-t-found.patch 1970-01-01 00:00:00.000000000 +0000 +++ lttng-modules-2.6.2/debian/patches/0007-Fix-disable-kvm-probe-if-lapic.h-isn-t-found.patch 2015-08-24 14:45:46.000000000 +0000 @@ -0,0 +1,46 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + lttng-modules (2.6.2-1ubuntu2) wily; urgency=medium + . + * dkms: Don't install regmap trace module. +Author: Chris J Arges + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- lttng-modules-2.6.2.orig/probes/Makefile ++++ lttng-modules-2.6.2/probes/Makefile +@@ -25,6 +25,8 @@ obj-m += lttng-probe-statedump.o + ifneq ($(CONFIG_KVM),) + obj-m += lttng-probe-kvm.o + ifneq ($(CONFIG_X86),) ++kvm_dep_lapic = $(srctree)/arch/x86/kvm/lapic.h ++ifneq ($(wildcard $(kvm_dep_lapic)),) + kvm_dep = $(srctree)/virt/kvm/iodev.h $(srctree)/include/kvm/iodev.h + ifneq ($(wildcard $(kvm_dep)),) + CFLAGS_lttng-probe-kvm-x86.o += -I$(srctree)/virt/kvm +@@ -40,6 +42,9 @@ obj-m += $(shell \ + else + $(warning File $(kvm_dep) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.) + endif ++else ++$(warning File $(kvm_dep_lapic) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.) ++endif + endif + endif + diff -Nru lttng-modules-2.6.2/debian/patches/0008-Fix-kmem-probe-with-Ubuntu-3.13-kernels.patch lttng-modules-2.6.2/debian/patches/0008-Fix-kmem-probe-with-Ubuntu-3.13-kernels.patch --- lttng-modules-2.6.2/debian/patches/0008-Fix-kmem-probe-with-Ubuntu-3.13-kernels.patch 1970-01-01 00:00:00.000000000 +0000 +++ lttng-modules-2.6.2/debian/patches/0008-Fix-kmem-probe-with-Ubuntu-3.13-kernels.patch 2015-08-24 14:45:58.000000000 +0000 @@ -0,0 +1,145 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + lttng-modules (2.6.2-1ubuntu2) wily; urgency=medium + . + * dkms: Don't install regmap trace module. +Author: Chris J Arges + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- lttng-modules-2.6.2.orig/wrapper/page_alloc.c ++++ lttng-modules-2.6.2/wrapper/page_alloc.c +@@ -1,9 +1,10 @@ + /* + * 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. ++ * wrapper around get_pfnblock_flags_mask and Ubuntu ++ * get_pageblock_flags_mask. Using KALLSYMS to get their address when ++ * available, else we need to have a kernel that exports this function ++ * to GPL modules. + * + * Copyright (C) 2015 Mathieu Desnoyers + * +@@ -63,8 +64,50 @@ int wrapper_get_pfnblock_flags_mask_init + return 0; + } + +-#else /* #if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2)) */ ++#else + + #include + +-#endif /* #else #if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2)) */ ++#endif ++ ++#if (defined(CONFIG_KALLSYMS) \ ++ && LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,50, 3,14,0,0)) ++ ++#include ++#include ++#include ++#include "kallsyms.h" ++#include "page_alloc.h" ++ ++static ++unsigned long (*get_pageblock_flags_mask_sym)(struct page *page, ++ unsigned long end_bitidx, ++ unsigned long mask); ++ ++unsigned long wrapper_get_pageblock_flags_mask(struct page *page, ++ unsigned long end_bitidx, ++ unsigned long mask) ++{ ++ WARN_ON_ONCE(!get_pageblock_flags_mask_sym); ++ if (get_pageblock_flags_mask_sym) { ++ return get_pageblock_flags_mask_sym(page, end_bitidx, mask); ++ } else { ++ return -ENOSYS; ++ } ++} ++EXPORT_SYMBOL_GPL(wrapper_get_pageblock_flags_mask); ++ ++int wrapper_get_pageblock_flags_mask_init(void) ++{ ++ get_pageblock_flags_mask_sym = ++ (void *) kallsyms_lookup_funcptr("get_pageblock_flags_mask"); ++ if (!get_pageblock_flags_mask_sym) ++ return -1; ++ return 0; ++} ++ ++#else ++ ++#include ++ ++#endif +--- lttng-modules-2.6.2.orig/wrapper/page_alloc.h ++++ lttng-modules-2.6.2/wrapper/page_alloc.h +@@ -41,7 +41,7 @@ + + int wrapper_get_pfnblock_flags_mask_init(void); + +-#else /* #if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2)) */ ++#else + + #include + +@@ -51,6 +51,38 @@ int wrapper_get_pfnblock_flags_mask_init + return 0; + } + +-#endif /* else #if defined(CONFIG_KALLSYMS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2)) */ ++#endif ++ ++/* ++ * For a specific range of Ubuntu 3.13 kernels, we need to redefine ++ * get_pageblock_flags_mask to our wrapper, because the ++ * get_pageblock_migratetype() macro uses it. This function has been ++ * introduced into mainline within commit ++ * e58469bafd0524e848c3733bc3918d854595e20f, but never actually showed ++ * up in a stable kernel version, since it has been changed by commit ++ * dc4b0caff24d9b2918e9f27bc65499ee63187eba. Since Ubuntu chose to only ++ * backport the former commit but not the latter, we need to do a ++ * special case to cover this. ++ */ ++#if (defined(CONFIG_KALLSYMS) \ ++ && LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,50, 3,14,0,0)) ++ ++#define get_pageblock_flags_mask wrapper_get_pageblock_flags_mask ++ ++#include ++ ++int wrapper_get_pageblock_flags_mask_init(void); ++ ++#else ++ ++#include ++ ++static inline ++int wrapper_get_pageblock_flags_mask_init(void) ++{ ++ return 0; ++} ++ ++#endif + + #endif /* _LTTNG_WRAPPER_PAGE_ALLOC_H */ diff -Nru lttng-modules-2.6.2/debian/patches/0009-Fix-mm_page_alloc_extfrag-instrumentation-for-kernel.patch lttng-modules-2.6.2/debian/patches/0009-Fix-mm_page_alloc_extfrag-instrumentation-for-kernel.patch --- lttng-modules-2.6.2/debian/patches/0009-Fix-mm_page_alloc_extfrag-instrumentation-for-kernel.patch 1970-01-01 00:00:00.000000000 +0000 +++ lttng-modules-2.6.2/debian/patches/0009-Fix-mm_page_alloc_extfrag-instrumentation-for-kernel.patch 2015-08-24 14:46:06.000000000 +0000 @@ -0,0 +1,35 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + lttng-modules (2.6.2-1ubuntu2) wily; urgency=medium + . + * dkms: Don't install regmap trace module. +Author: Chris J Arges + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- lttng-modules-2.6.2.orig/instrumentation/events/lttng-module/kmem.h ++++ lttng-modules-2.6.2/instrumentation/events/lttng-module/kmem.h +@@ -288,6 +288,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT(mm + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2) \ + || LTTNG_KERNEL_RANGE(3,14,36, 3,15,0) \ ++ || LTTNG_KERNEL_RANGE(3,18,10, 3,19,0) \ + || LTTNG_DEBIAN_KERNEL_RANGE(3,16,7,9,0,0, 3,17,0,0,0,0) \ + || LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,50, 3,14,0,0) \ + || LTTNG_UBUNTU_KERNEL_RANGE(3,16,7,38, 3,17,0,0)) diff -Nru lttng-modules-2.6.2/debian/patches/0010-Fix-writeback-instrumentation-for-4.2-kernels.patch lttng-modules-2.6.2/debian/patches/0010-Fix-writeback-instrumentation-for-4.2-kernels.patch --- lttng-modules-2.6.2/debian/patches/0010-Fix-writeback-instrumentation-for-4.2-kernels.patch 1970-01-01 00:00:00.000000000 +0000 +++ lttng-modules-2.6.2/debian/patches/0010-Fix-writeback-instrumentation-for-4.2-kernels.patch 2015-08-24 14:46:15.000000000 +0000 @@ -0,0 +1,92 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + lttng-modules (2.6.2-1ubuntu2) wily; urgency=medium + . + * dkms: Don't install regmap trace module. +Author: Chris J Arges + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- lttng-modules-2.6.2.orig/instrumentation/events/lttng-module/writeback.h ++++ lttng-modules-2.6.2/instrumentation/events/lttng-module/writeback.h +@@ -523,6 +523,55 @@ LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_ + + #define KBps(x) ((x) << (PAGE_SHIFT - 10)) + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) ++ ++LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, ++ ++ writeback_bdi_dirty_ratelimit, ++ ++ TP_PROTO(struct backing_dev_info *bdi, ++ unsigned long dirty_rate, ++ unsigned long task_ratelimit), ++ ++ TP_ARGS(bdi, dirty_rate, task_ratelimit), ++ ++ TP_STRUCT__entry( ++ __array(char, bdi, 32) ++ __field(unsigned long, write_bw) ++ __field(unsigned long, avg_write_bw) ++ __field(unsigned long, dirty_rate) ++ __field(unsigned long, dirty_ratelimit) ++ __field(unsigned long, task_ratelimit) ++ __field(unsigned long, balanced_dirty_ratelimit) ++ ), ++ ++ TP_fast_assign( ++ tp_memcpy(bdi, dev_name(bdi->dev), 32) ++ tp_assign(write_bw, KBps(bdi->wb.write_bandwidth)) ++ tp_assign(avg_write_bw, KBps(bdi->wb.avg_write_bandwidth)) ++ tp_assign(dirty_rate, KBps(dirty_rate)) ++ tp_assign(dirty_ratelimit, KBps(bdi->wb.dirty_ratelimit)) ++ tp_assign(task_ratelimit, KBps(task_ratelimit)) ++ tp_assign(balanced_dirty_ratelimit, ++ KBps(bdi->wb.balanced_dirty_ratelimit)) ++ ), ++ ++ TP_printk("bdi %s: " ++ "write_bw=%lu awrite_bw=%lu dirty_rate=%lu " ++ "dirty_ratelimit=%lu task_ratelimit=%lu " ++ "balanced_dirty_ratelimit=%lu", ++ __entry->bdi, ++ __entry->write_bw, /* write bandwidth */ ++ __entry->avg_write_bw, /* avg write bandwidth */ ++ __entry->dirty_rate, /* bdi dirty rate */ ++ __entry->dirty_ratelimit, /* base ratelimit */ ++ __entry->task_ratelimit, /* ratelimit with position control */ ++ __entry->balanced_dirty_ratelimit /* the balanced ratelimit */ ++ ) ++) ++ ++#else ++ + LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, + + writeback_bdi_dirty_ratelimit, +@@ -568,6 +617,8 @@ LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_rat + ) + ) + ++#endif ++ + LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages, + + writeback_balance_dirty_pages, diff -Nru lttng-modules-2.6.2/debian/patches/Fix-disable-kvm-probe-if-lapic.h-isn-t-found.patch lttng-modules-2.6.2/debian/patches/Fix-disable-kvm-probe-if-lapic.h-isn-t-found.patch --- lttng-modules-2.6.2/debian/patches/Fix-disable-kvm-probe-if-lapic.h-isn-t-found.patch 2015-07-24 18:22:38.000000000 +0000 +++ lttng-modules-2.6.2/debian/patches/Fix-disable-kvm-probe-if-lapic.h-isn-t-found.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -From d2f8a172be99f3dc18a2f866152d702f03562f32 Mon Sep 17 00:00:00 2001 -From: Chris J Arges -Date: Fri, 24 Jul 2015 13:12:06 -0500 -Subject: [PATCH] Fix: disable kvm probe if lapic.h isn't found - -In a typical distribution if just linux-headers is installed, lapic.h will -not be installed. We should check if that file exists and not build the module. - -Signed-off-by: Chris J Arges ---- - probes/Makefile | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/probes/Makefile b/probes/Makefile -index 0314a5e..cc4c352 100644 ---- a/probes/Makefile -+++ b/probes/Makefile -@@ -25,6 +25,8 @@ obj-m += lttng-probe-statedump.o - ifneq ($(CONFIG_KVM),) - obj-m += lttng-probe-kvm.o - ifneq ($(CONFIG_X86),) -+kvm_dep_lapic = $(srctree)/arch/x86/kvm/lapic.h -+ifneq ($(wildcard $(kvm_dep_lapic)),) - kvm_dep = $(srctree)/virt/kvm/iodev.h $(srctree)/include/kvm/iodev.h - ifneq ($(wildcard $(kvm_dep)),) - CFLAGS_lttng-probe-kvm-x86.o += -I$(srctree)/virt/kvm -@@ -40,6 +42,9 @@ obj-m += $(shell \ - else - $(warning File $(kvm_dep) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.) - endif -+else -+$(warning File $(kvm_dep_lapic) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.) -+endif - endif - endif - --- -2.1.4 - diff -Nru lttng-modules-2.6.2/debian/patches/series lttng-modules-2.6.2/debian/patches/series --- lttng-modules-2.6.2/debian/patches/series 2015-07-24 18:22:47.000000000 +0000 +++ lttng-modules-2.6.2/debian/patches/series 2015-08-24 14:46:15.000000000 +0000 @@ -1 +1,10 @@ -Fix-disable-kvm-probe-if-lapic.h-isn-t-found.patch +0001-Fix-use-after-free-on-metadata-cache-reallocation.patch +0002-Fix-Building-the-event-list-fails-on-fragmented-memo.patch +0003-Fix-allow-LTTng-to-be-built-within-kernel-tree.patch +0004-Fix-kvm-instrumentation-for-4.2-kernels.patch +0005-Fix-ext4-instrumentation-for-4.2-kernels.patch +0006-Fix-timer-instrumentation-for-4.2-kernels.patch +0007-Fix-disable-kvm-probe-if-lapic.h-isn-t-found.patch +0008-Fix-kmem-probe-with-Ubuntu-3.13-kernels.patch +0009-Fix-mm_page_alloc_extfrag-instrumentation-for-kernel.patch +0010-Fix-writeback-instrumentation-for-4.2-kernels.patch