Skip to contentSkip to conversation

ktap: update to v0.4

PATCH New Anders Darander 3 participants 3 messages Dec 18, 2013 – Dec 19, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ktap: update to v0.4

Add a check for BR2_PACKAGE_ELFUTILS; if this is enabled, then try to link against libelf from the elfutils package. This allows ktap to resolve symbols in userspace.

The new FFI functionality in ktap is not exposed, as it currently only supports x86_64...

---
 package/ktap/Config.in                             |  3 +++
 ...p-0001-interpreter-vm.c-include-uaccess.h.patch | 27 ---------------------
 package/ktap/ktap-0002-Set-PWD-in-Makefile.patch   | 28 ----------------------
 package/ktap/ktap.mk                               | 10 ++++++--
 4 files changed, 11 insertions(+), 57 deletions(-)
 delete mode 100644 package/ktap/ktap-0001-interpreter-vm.c-include-uaccess.h.patch
 delete mode 100644 package/ktap/ktap-0002-Set-PWD-in-Makefile.patch
package/ktap/Config.in +3 -0
index 7f40ce2..e665211 100644
@@ -13,6 +13,9 @@ config BR2_PACKAGE_KTAP
 
 	  ktap doesn't support kernels older than 3.1.
 
+	  To be able to resolve symbols in DSO and for sdt, you need to enable
+	  elfutils.
+
 	  Your kernel must have CONFIG_EVENT_TRACING,
 	  CONFIG_PERF_EVENTS, and CONFIG_DEBUG_FS enabled to compile.
 
package/ktap/ktap-0001-interpreter-vm.c-include-uaccess.h.patch deleted +0 -27
deleted file mode 100644
index c7c6bbe..0000000
@@ -1,27 +0,0 @@
-From 343cb5a8b11a1dfdf4262fce326113e889f13496 Mon Sep 17 00:00:00 2001
-From: Anders Darander <[email protected]>
-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 <[email protected]>
----
- 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
-
package/ktap/ktap-0002-Set-PWD-in-Makefile.patch deleted +0 -28
deleted file mode 100644
index e62d4f1..0000000
@@ -1,28 +0,0 @@
-From 90a8dd877b7766b1ba722c19569cffb68625288b Mon Sep 17 00:00:00 2001
-From: Anders Darander <[email protected]>
-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 <[email protected]>
----
- 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
-
package/ktap/ktap.mk +8 -2
index a5d277a..4d4929c 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-KTAP_VERSION = v0.3
+KTAP_VERSION = v0.4
 KTAP_SITE = $(call github,ktap,ktap,$(KTAP_VERSION))
 KTAP_SOURCE = v$(KTAP_VERSION).tar.gz
 KTAP_LICENSE = GPLv2
@@ -12,8 +12,14 @@ KTAP_LICENSE_FILES = LICENSE-GPL
 
 KTAP_DEPENDENCIES = linux
 
+ifeq ($(BR2_PACKAGE_ELFUTILS),y)
+KTAP_DEPENDENCIES += elfutils
+else
+KTAP_FLAGS += NO_LIBELF=1
+endif
+
 define KTAP_BUILD_CMDS
-	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) ktap
+	$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) $(KTAP_FLAGS)  ktap
 	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_SRC=$(LINUX_DIR) KVERSION=$(LINUX_VERSION_PROBED) mod
 endef
 
Signature · 1 line
1.8.5.2
#1 lore raw

PATCH 1/1 ktap: update to v0.4

Quoted 7 lines · Anders Darander

Add a check for BR2_PACKAGE_ELFUTILS; if this is enabled, then try to link against libelf from the elfutils package. This allows ktap to resolve symbols in userspace.

The new FFI functionality in ktap is not exposed, as it currently only supports x86_64...

Quoted 8 lines
---
  package/ktap/Config.in                             |  3 +++
  ...p-0001-interpreter-vm.c-include-uaccess.h.patch | 27 ---------------------
  package/ktap/ktap-0002-Set-PWD-in-Makefile.patch   | 28 ----------------------
  package/ktap/ktap.mk                               | 10 ++++++--
  4 files changed, 11 insertions(+), 57 deletions(-)

delete mode 100644 package/ktap/ktap-0001-interpreter-vm.c-include-uaccess.h.patch delete mode 100644 package/ktap/ktap-0002-Set-PWD-in-Makefile.patch

When patches can be removed, it's better to mention this explicitly in
the commit message. But that shouldn't stop this patch to be applied.

Regards,
Arnout

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#2 lore raw

PATCH 1/1 ktap: update to v0.4

In reply to Anders Darander
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Anders" == Anders Darander <[email protected]> writes:

Add a check for BR2_PACKAGE_ELFUTILS; if this is enabled, then try to link against libelf from the elfutils package. This allows ktap to resolve symbols in userspace.

The new FFI functionality in ktap is not exposed, as it currently only supports x86_64...

Nit: please wrap your commit text so it displays on a 80 col screen without scrolling.

Quoted 1 line

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard