summaryrefslogtreecommitdiff
path: root/package/ktap
diff options
context:
space:
mode:
authorAnders Darander <anders@chargestorm.se>2013-12-10 12:59:41 +0100
committerPeter Korsgaard <peter@korsgaard.com>2013-12-10 13:19:31 +0100
commit3e1e7db3cc677e9d68a7f0ec74406ab986dcc512 (patch)
treeb569a8590528feaefd00ed3d5933f0e7d38bbde9 /package/ktap
parent63e1c6b207c21a5a638332cc561cea001452ebc9 (diff)
ktap: new package
Add ktap, a script-based dynamic tracing tool. Signed-off-by: Anders Darander <anders@chargestorm.se> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/ktap')
-rw-r--r--package/ktap/Config.in26
-rw-r--r--package/ktap/ktap-0001-interpreter-vm.c-include-uaccess.h.patch27
-rw-r--r--package/ktap/ktap-0002-Set-PWD-in-Makefile.patch28
-rw-r--r--package/ktap/ktap.mk25
4 files changed, 106 insertions, 0 deletions
diff --git a/package/ktap/Config.in b/package/ktap/Config.in
new file mode 100644
index 000000000..43195df6d
--- /dev/null
+++ b/package/ktap/Config.in
@@ -0,0 +1,26 @@
+config BR2_PACKAGE_KTAP
+ bool "ktap"
+ depends on BR2_LINUX_KERNEL
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ help
+ ktap is a script-based dynamic tracing tool for Linux
+
+ It uses a scripting language and lets users trace the Linux kernel
+ dynamically. ktap is designed to give operational insights with
+ interoperability that allows users to tune, troubleshoot and extend
+ kernel and application. It's similar to Linux Systemtap and
+ Solaris Dtrace.
+
+ ktap doesn't support kernels older than 3.1.
+
+ Your kernel must have CONFIG_EVENT_TRACING,
+ CONFIG_PERF_EVENTS, and CONFIG_DEBUG_FS enabled to compile.
+
+ http://www.ktap.org
+
+comment "ktap requires a linux kernel to be built"
+ depends on !BR2_LINUX_KERNEL
+
+comment "ktap needs a toolchain w/ threads"
+ depends on !BR2_TOOLCHAIN_HAS_THREADS
+
diff --git a/package/ktap/ktap-0001-interpreter-vm.c-include-uaccess.h.patch b/package/ktap/ktap-0001-interpreter-vm.c-include-uaccess.h.patch
new file mode 100644
index 000000000..c7c6bbe03
--- /dev/null
+++ b/package/ktap/ktap-0001-interpreter-vm.c-include-uaccess.h.patch
@@ -0,0 +1,27 @@
+From 343cb5a8b11a1dfdf4262fce326113e889f13496 Mon Sep 17 00:00:00 2001
+From: Anders Darander <anders@chargestorm.se>
+Date: Sat, 9 Nov 2013 23:05:05 +0100
+Subject: [PATCH] interpreter/vm.c: include uaccess.h
+
+otherwise functions, such as copy_from_user, is implicitly defined.
+
+Signed-off-by: Anders Darander <anders@chargestorm.se>
+---
+ interpreter/vm.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/interpreter/vm.c b/interpreter/vm.c
+index bc7b951..f7cb794 100644
+--- a/interpreter/vm.c
++++ b/interpreter/vm.c
+@@ -28,6 +28,7 @@
+ #include <linux/signal.h>
+ #include <linux/sched.h>
+ #include "../include/ktap.h"
++#include <linux/uaccess.h>
+
+ #define KTAP_MINSTACK 20
+
+--
+1.8.4.2
+
diff --git a/package/ktap/ktap-0002-Set-PWD-in-Makefile.patch b/package/ktap/ktap-0002-Set-PWD-in-Makefile.patch
new file mode 100644
index 000000000..e62d4f152
--- /dev/null
+++ b/package/ktap/ktap-0002-Set-PWD-in-Makefile.patch
@@ -0,0 +1,28 @@
+From 90a8dd877b7766b1ba722c19569cffb68625288b Mon Sep 17 00:00:00 2001
+From: Anders Darander <anders@chargestorm.se>
+Date: Mon, 11 Nov 2013 13:04:36 +0100
+Subject: Set PWD in Makefile
+
+When cross-compiling using e.g. buildroot, PWD was not reset in the Makefile.
+That caused PWD to have an incorrect value, and thus building the module failed.
+
+Signed-off-by: Anders Darander <anders@chargestorm.se>
+---
+ Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile b/Makefile
+index 372b41a..939d25e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -25,6 +25,7 @@ ktapvm-y := $(INTP_OBJS)
+
+ KVERSION ?= $(shell uname -r)
+ KERNEL_SRC ?= /lib/modules/$(KVERSION)/build
++PWD := $(shell pwd)
+ mod:
+ $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules
+
+--
+1.8.4.2
+
diff --git a/package/ktap/ktap.mk b/package/ktap/ktap.mk
new file mode 100644
index 000000000..a5d277a5a
--- /dev/null
+++ b/package/ktap/ktap.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# ktap, script-based dynamic tracing tool
+#
+################################################################################
+
+KTAP_VERSION = v0.3
+KTAP_SITE = $(call github,ktap,ktap,$(KTAP_VERSION))
+KTAP_SOURCE = v$(KTAP_VERSION).tar.gz
+KTAP_LICENSE = GPLv2
+KTAP_LICENSE_FILES = LICENSE-GPL
+
+KTAP_DEPENDENCIES = linux
+
+define KTAP_BUILD_CMDS
+ $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) ktap
+ $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_SRC=$(LINUX_DIR) KVERSION=$(LINUX_VERSION_PROBED) mod
+endef
+
+define KTAP_INSTALL_TARGET_CMDS
+ $(INSTALL) -D -m755 $(@D)/ktap $(TARGET_DIR)/usr/bin/ktap
+ $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_SRC=$(LINUX_DIR) KVERSION=$(LINUX_VERSION_PROBED) modules_install
+endef
+
+$(eval $(generic-package))