summary refs log tree commit diff
path: root/pkgs/os-specific/linux/lttng-modules
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2013-07-04 22:34:32 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2013-08-10 14:47:55 +0200
commit70ea99cfa8e75ae2efa2a4cbc37ee8c20ea6fa72 (patch)
tree40dee546ae0d16b2f5596b37e27ca3f24703e290 /pkgs/os-specific/linux/lttng-modules
parent5a3a82d81c6447eb25210adbc145ecf01edf54ea (diff)
downloadnixpkgs-70ea99cfa8e75ae2efa2a4cbc37ee8c20ea6fa72.tar
nixpkgs-70ea99cfa8e75ae2efa2a4cbc37ee8c20ea6fa72.tar.gz
nixpkgs-70ea99cfa8e75ae2efa2a4cbc37ee8c20ea6fa72.tar.bz2
nixpkgs-70ea99cfa8e75ae2efa2a4cbc37ee8c20ea6fa72.tar.lz
nixpkgs-70ea99cfa8e75ae2efa2a4cbc37ee8c20ea6fa72.tar.xz
nixpkgs-70ea99cfa8e75ae2efa2a4cbc37ee8c20ea6fa72.tar.zst
nixpkgs-70ea99cfa8e75ae2efa2a4cbc37ee8c20ea6fa72.zip
lttng-modules: new package
Add linux kernel modules needed to do kernel tracing with LTTng.

To make them available to lttng in NixOS, add this to configuration.nix:

  boot.extraModulePackages = [ pkgs.linuxPackages.lttngModules ];
Diffstat (limited to 'pkgs/os-specific/linux/lttng-modules')
-rw-r--r--pkgs/os-specific/linux/lttng-modules/default.nix31
-rw-r--r--pkgs/os-specific/linux/lttng-modules/lttng-fix-build-error-on-linux-3.2.patch33
2 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/lttng-modules/default.nix b/pkgs/os-specific/linux/lttng-modules/default.nix
new file mode 100644
index 00000000000..ee80b7632ba
--- /dev/null
+++ b/pkgs/os-specific/linux/lttng-modules/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, kernelDev }:
+
+stdenv.mkDerivation rec {
+  pname = "lttng-modules-2.2.1";
+  name = "${pname}-${kernelDev.version}";
+
+  src = fetchurl {
+    url = "https://lttng.org/files/lttng-modules/${pname}.tar.bz2";
+    sha256 = "00ww1443ssv614s1ix6zby8llaf6zzlxcf5k4w7jsyji47ng33m2";
+  };
+
+  patches = [ ./lttng-fix-build-error-on-linux-3.2.patch ];
+
+  preConfigure = ''
+    export KERNELDIR="${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build"
+    export INSTALL_MOD_PATH="$out"
+  '';
+
+  installPhase = ''
+    make modules_install
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Linux kernel modules for LTTng tracing";
+    homepage = http://lttng.org/;
+    license = with licenses; [ lgpl21 gpl2 mit ];
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+
+}
diff --git a/pkgs/os-specific/linux/lttng-modules/lttng-fix-build-error-on-linux-3.2.patch b/pkgs/os-specific/linux/lttng-modules/lttng-fix-build-error-on-linux-3.2.patch
new file mode 100644
index 00000000000..dfe6d21be84
--- /dev/null
+++ b/pkgs/os-specific/linux/lttng-modules/lttng-fix-build-error-on-linux-3.2.patch
@@ -0,0 +1,33 @@
+When building against linux 3.2, we get this build error:
+
+  building /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/lttng-probe-ext3.o
+    CC [M]  /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/lttng-probe-ext3.o
+  In file included from /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/../instrumentation/events/lttng-module/../../../probes/lttng-events.h:759:0,
+                   from /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/../instrumentation/events/lttng-module/../../../probes/define_trace.h:148,
+                   from /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/../instrumentation/events/lttng-module/ext3.h:868,
+                   from /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/lttng-probe-ext3.c:48:
+  /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/../instrumentation/events/lttng-module/../../../probes/../instrumentation/events/lttng-module/ext3.h: In function '__event_probe__ext3__page_op':
+  /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/../instrumentation/events/lttng-module/../../../probes/../instrumentation/events/lttng-module/ext3.h:240:1: error: dereferencing pointer to incomplete type
+  /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/../instrumentation/events/lttng-module/../../../probes/../instrumentation/events/lttng-module/ext3.h:240:1: error: dereferencing pointer to incomplete type
+  /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/../instrumentation/events/lttng-module/../../../probes/../instrumentation/events/lttng-module/ext3.h:240:1: error: dereferencing pointer to incomplete type
+  /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/../instrumentation/events/lttng-module/../../../probes/../instrumentation/events/lttng-module/ext3.h: In function '__event_probe__ext3_invalidatepage':
+  /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/../instrumentation/events/lttng-module/../../../probes/../instrumentation/events/lttng-module/ext3.h:298:1: error: dereferencing pointer to incomplete type
+  /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/../instrumentation/events/lttng-module/../../../probes/../instrumentation/events/lttng-module/ext3.h:298:1: error: dereferencing pointer to incomplete type
+  /tmp/nix-build-lttng-modules-2.2.0.drv-0/lttng-modules-2.2.0/probes/../instrumentation/events/lttng-module/../../../probes/../instrumentation/events/lttng-module/ext3.h:298:1: error: dereferencing pointer to incomplete type
+
+because a check for existing ext3/*h files in the kernel build tree is skipped
+for linux < 3.4. Fix it by extending the ext3_dep_check thing to also be run
+when building against linux >= 3.2 (not only linux >= 3.4).
+
+diff -uNr lttng-modules-2.2.0.orig/probes/Makefile lttng-modules-2.2.0/probes/Makefile
+--- lttng-modules-2.2.0.orig/probes/Makefile	2013-06-19 03:22:44.000000000 +0200
++++ lttng-modules-2.2.0/probes/Makefile	2013-07-06 13:22:15.902957717 +0200
+@@ -59,7 +59,7 @@
+ ext3_dep_check = $(wildcard $(ext3_dep))
+ ext3 = $(shell \
+ 	if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
+-		if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 4 -a \
++		if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 2 -a \
+ 			-z "$(ext3_dep_check)" ] ; then \
+ 			echo "warn" ; \
+ 			exit ; \