lttng-modules: update to latest stable (fixes build)

Fixes build against linux 3.14.36+.

Also
* It works with linux 3.12 now, so remove that assert
* Remove unneeded patches (merged upstream)
This commit is contained in:
Bjørn Forsman 2015-03-24 07:05:25 +01:00
parent c3bc040128
commit ff9bc81946
3 changed files with 6 additions and 110 deletions

View File

@ -1,71 +0,0 @@
From 6f0af2643c40b57280796eaa4fe60ce4f678b6dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Goddard=20Rosa?= <andre.goddard@gmail.com>
Date: Thu, 13 Nov 2014 21:33:02 -0800
Subject: [PATCH] Fix compilation on Linux kernel >= 3.18.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since kernel commit 8a9522d2fe compilation fails as kvm_age_page
tracepoint had its signature changed, so update it accordingly.
Tested pointing to kernels:
git reset --hard v3.17; make init/version.o
git reset --hard v3.18-rc1; make init/version.o
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
instrumentation/events/lttng-module/kvm.h | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
mode change 100644 => 100755 instrumentation/events/lttng-module/kvm.h
diff --git a/instrumentation/events/lttng-module/kvm.h b/instrumentation/events/lttng-module/kvm.h
old mode 100644
new mode 100755
index c0d42e2..4f95095
--- a/instrumentation/events/lttng-module/kvm.h
+++ b/instrumentation/events/lttng-module/kvm.h
@@ -232,6 +232,34 @@ LTTNG_TRACEPOINT_EVENT(kvm_fpu,
TP_printk("%s", __print_symbolic(__entry->load, kvm_fpu_load_symbol))
)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
+
+LTTNG_TRACEPOINT_EVENT(kvm_age_page,
+ TP_PROTO(ulong gfn, int level, struct kvm_memory_slot *slot, int ref),
+ TP_ARGS(gfn, level, slot, ref),
+
+ TP_STRUCT__entry(
+ __field( u64, hva )
+ __field( u64, gfn )
+ __field( u8, level )
+ __field( u8, referenced )
+ ),
+
+ TP_fast_assign(
+ tp_assign(gfn, gfn)
+ tp_assign(level, level)
+ tp_assign(hva, ((gfn - slot->base_gfn) <<
+ PAGE_SHIFT) + slot->userspace_addr)
+ tp_assign(referenced, ref)
+ ),
+
+ TP_printk("hva %llx gfn %llx level %u %s",
+ __entry->hva, __entry->gfn, __entry->level,
+ __entry->referenced ? "YOUNG" : "OLD")
+)
+
+#else
+
LTTNG_TRACEPOINT_EVENT(kvm_age_page,
TP_PROTO(ulong hva, struct kvm_memory_slot *slot, int ref),
TP_ARGS(hva, slot, ref),
@@ -254,6 +282,7 @@ LTTNG_TRACEPOINT_EVENT(kvm_age_page,
__entry->referenced ? "YOUNG" : "OLD")
)
#endif
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))

View File

@ -1,30 +0,0 @@
[PATCH] Update compaction instrumentation for 3.14.x stable kernels
Conditional compilation introduced by lttng-modules commit
0007344741ef65259bc52dea72259173dfbf96c0
needs to be applied to kernels 3.14.25 and up in the 3.14.x branch.
Signed-off-by: Simon Marchi <simon.marchi at polymtl.ca>
Reported-by: Bjørn Forsman <bjorn.forsman at gmail.com>
---
instrumentation/events/lttng-module/compaction.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/instrumentation/events/lttng-module/compaction.h b/instrumentation/events/lttng-module/compaction.h
index ee23aa9..773a6ad 100644
--- a/instrumentation/events/lttng-module/compaction.h
+++ b/instrumentation/events/lttng-module/compaction.h
@@ -46,7 +46,8 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_compaction_isolate_template, mm_compaction_is
TP_ARGS(nr_scanned, nr_taken)
)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
+#if LTTNG_KERNEL_RANGE(3,14,25, 3,15,0) || \
+ (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
LTTNG_TRACEPOINT_EVENT(mm_compaction_migratepages,
TP_PROTO(unsigned long nr_all,
--
2.1.3

View File

@ -1,21 +1,18 @@
{ stdenv, fetchurl, kernel }:
{ stdenv, fetchgit, kernel }:
assert stdenv.lib.versionAtLeast kernel.version "3.4"; # fails on 3.2
assert builtins.substring 0 4 kernel.version != "3.12";
stdenv.mkDerivation rec {
pname = "lttng-modules-${version}";
name = "${pname}-${kernel.version}";
version = "2.6.0-rc1"; # "git describe bf2ba318fff"
version = "2.6.0-5-g1b2a542";
src = fetchurl {
url = "https://github.com/lttng/lttng-modules/archive/v${version}.tar.gz";
sha256 = "01gha02ybbzr86v6s6bqn649jiw5k89kb363b9s1iv8igrdlzhl1";
src = fetchgit {
url = "https://github.com/lttng/lttng-modules.git";
rev = "1b2a5429de815c95643df2eadf91253909708728";
sha256 = "0zccaiadnk0xl6xrqaqlg9rpkwjgbq2fiyc3psylzqimnx0ydxc2";
};
# from upstream ML, should be in the next release
patches = [ ./build-fix.patch ./6f0af2643c40b57280796eaa4fe60ce4f678b6dc.patch ];
preConfigure = ''
export KERNELDIR="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
export INSTALL_MOD_PATH="$out"