* [Buildroot] [PATCH 1/1] ktap: new package
@ 2013-11-11 12:24 Anders Darander
2013-12-08 11:44 ` Anders Darander
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Anders Darander @ 2013-11-11 12:24 UTC (permalink / raw)
To: buildroot
Add ktap, a script-based dynamic tracing tool.
Signed-off-by: Anders Darander <anders@chargestorm.se>
---
package/Config.in | 1 +
.../0001-interpreter-vm.c-include-uaccess.h.patch | 27 +++++++++++++++++++++
package/ktap/0002-Set-PWD-in-Makefile.patch | 28 ++++++++++++++++++++++
package/ktap/Config.in | 21 ++++++++++++++++
package/ktap/ktap.mk | 25 +++++++++++++++++++
5 files changed, 102 insertions(+)
create mode 100644 package/ktap/0001-interpreter-vm.c-include-uaccess.h.patch
create mode 100644 package/ktap/0002-Set-PWD-in-Makefile.patch
create mode 100644 package/ktap/Config.in
create mode 100644 package/ktap/ktap.mk
diff --git a/package/Config.in b/package/Config.in
index 311cc6c..c9eab85 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -50,6 +50,7 @@ source "package/duma/Config.in"
source "package/gdb/Config.in"
source "package/iozone/Config.in"
source "package/kexec/Config.in"
+source "package/ktap/Config.in"
source "package/latencytop/Config.in"
source "package/lmbench/Config.in"
if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
diff --git a/package/ktap/0001-interpreter-vm.c-include-uaccess.h.patch b/package/ktap/0001-interpreter-vm.c-include-uaccess.h.patch
new file mode 100644
index 0000000..c7c6bbe
--- /dev/null
+++ b/package/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/0002-Set-PWD-in-Makefile.patch b/package/ktap/0002-Set-PWD-in-Makefile.patch
new file mode 100644
index 0000000..e62d4f1
--- /dev/null
+++ b/package/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/Config.in b/package/ktap/Config.in
new file mode 100644
index 0000000..97bcd9c
--- /dev/null
+++ b/package/ktap/Config.in
@@ -0,0 +1,21 @@
+config BR2_PACKAGE_KTAP
+ bool "ktap"
+ depends on BR2_LINUX_KERNEL
+ 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 with Linux Systemtap and
+ Solaris Dtrace.
+
+ ktap don'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
diff --git a/package/ktap/ktap.mk b/package/ktap/ktap.mk
new file mode 100644
index 0000000..281258d
--- /dev/null
+++ b/package/ktap/ktap.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# ktap, script-based dynamic tracing tool
+#
+################################################################################
+
+KTAP_VERSION = 0.3
+KTAP_SITE = https://github.com/ktap/ktap/archive
+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) CC=${TARGET_CC} ktap
+ $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_SRC=$(LINUX_DIR) KVERSION=${LINUX_VERSION_PROBED} mod
+endef
+
+define KTAP_INSTALL_TARGET_CMDS
+ $(INSTALL) -m755 $(@D)/ktap $(TARGET_DIR)/usr/bin/
+ $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_SRC=$(LINUX_DIR) KVERSION=${LINUX_VERSION_PROBED} modules_install
+endef
+
+$(eval $(generic-package))
--
1.8.4.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* [Buildroot] [PATCH 1/1] ktap: new package
2013-11-11 12:24 [Buildroot] [PATCH 1/1] ktap: new package Anders Darander
@ 2013-12-08 11:44 ` Anders Darander
2013-12-08 13:19 ` Thomas Petazzoni
2013-12-08 13:24 ` Thomas Petazzoni
2 siblings, 0 replies; 5+ messages in thread
From: Anders Darander @ 2013-12-08 11:44 UTC (permalink / raw)
To: buildroot
Ping... As the new buildroot release has been made.
Cheers,
Anders
On 11 Nov 2013 13:30, "Anders Darander" <anders@chargestorm.se> wrote:
> Add ktap, a script-based dynamic tracing tool.
>
> Signed-off-by: Anders Darander <anders@chargestorm.se>
> ---
> package/Config.in | 1 +
> .../0001-interpreter-vm.c-include-uaccess.h.patch | 27
> +++++++++++++++++++++
> package/ktap/0002-Set-PWD-in-Makefile.patch | 28
> ++++++++++++++++++++++
> package/ktap/Config.in | 21 ++++++++++++++++
> package/ktap/ktap.mk | 25
> +++++++++++++++++++
> 5 files changed, 102 insertions(+)
> create mode 100644
> package/ktap/0001-interpreter-vm.c-include-uaccess.h.patch
> create mode 100644 package/ktap/0002-Set-PWD-in-Makefile.patch
> create mode 100644 package/ktap/Config.in
> create mode 100644 package/ktap/ktap.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index 311cc6c..c9eab85 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -50,6 +50,7 @@ source "package/duma/Config.in"
> source "package/gdb/Config.in"
> source "package/iozone/Config.in"
> source "package/kexec/Config.in"
> +source "package/ktap/Config.in"
> source "package/latencytop/Config.in"
> source "package/lmbench/Config.in"
> if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
> diff --git a/package/ktap/0001-interpreter-vm.c-include-uaccess.h.patch
> b/package/ktap/0001-interpreter-vm.c-include-uaccess.h.patch
> new file mode 100644
> index 0000000..c7c6bbe
> --- /dev/null
> +++ b/package/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/0002-Set-PWD-in-Makefile.patch
> b/package/ktap/0002-Set-PWD-in-Makefile.patch
> new file mode 100644
> index 0000000..e62d4f1
> --- /dev/null
> +++ b/package/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/Config.in b/package/ktap/Config.in
> new file mode 100644
> index 0000000..97bcd9c
> --- /dev/null
> +++ b/package/ktap/Config.in
> @@ -0,0 +1,21 @@
> +config BR2_PACKAGE_KTAP
> + bool "ktap"
> + depends on BR2_LINUX_KERNEL
> + 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 with Linux Systemtap and
> + Solaris Dtrace.
> +
> + ktap don'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
> diff --git a/package/ktap/ktap.mk b/package/ktap/ktap.mk
> new file mode 100644
> index 0000000..281258d
> --- /dev/null
> +++ b/package/ktap/ktap.mk
> @@ -0,0 +1,25 @@
>
> +################################################################################
> +#
> +# ktap, script-based dynamic tracing tool
> +#
>
> +################################################################################
> +
> +KTAP_VERSION = 0.3
> +KTAP_SITE = https://github.com/ktap/ktap/archive
> +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) CC=${TARGET_CC} ktap
> + $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_SRC=$(LINUX_DIR)
> KVERSION=${LINUX_VERSION_PROBED} mod
> +endef
> +
> +define KTAP_INSTALL_TARGET_CMDS
> + $(INSTALL) -m755 $(@D)/ktap $(TARGET_DIR)/usr/bin/
> + $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_SRC=$(LINUX_DIR)
> KVERSION=${LINUX_VERSION_PROBED} modules_install
> +endef
> +
> +$(eval $(generic-package))
> --
> 1.8.4.2
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20131208/79384226/attachment.html>
^ permalink raw reply [flat|nested] 5+ messages in thread* [Buildroot] [PATCH 1/1] ktap: new package
2013-11-11 12:24 [Buildroot] [PATCH 1/1] ktap: new package Anders Darander
2013-12-08 11:44 ` Anders Darander
@ 2013-12-08 13:19 ` Thomas Petazzoni
2013-12-08 13:24 ` Thomas Petazzoni
2 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2013-12-08 13:19 UTC (permalink / raw)
To: buildroot
Dear Anders Darander,
On Mon, 11 Nov 2013 13:24:26 +0100, Anders Darander wrote:
> +KTAP_VERSION = 0.3
> +KTAP_SITE = https://github.com/ktap/ktap/archive
> +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) CC=${TARGET_CC} ktap
Can you use:
$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) ktap
instead ?
> + $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_SRC=$(LINUX_DIR) KVERSION=${LINUX_VERSION_PROBED} mod
KVERSION=$(LINUX_VERSION_PROBED)
i.e use $() instead of ${}, since LINUX_VERSION_PROBED is a make
variable.
> +endef
> +
> +define KTAP_INSTALL_TARGET_CMDS
> + $(INSTALL) -m755 $(@D)/ktap $(TARGET_DIR)/usr/bin/
$(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
Ditto for the ${} -> $().
> +endef
> +
> +$(eval $(generic-package))
Other than that, looks good to me!
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread* [Buildroot] [PATCH 1/1] ktap: new package
2013-11-11 12:24 [Buildroot] [PATCH 1/1] ktap: new package Anders Darander
2013-12-08 11:44 ` Anders Darander
2013-12-08 13:19 ` Thomas Petazzoni
@ 2013-12-08 13:24 ` Thomas Petazzoni
2 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2013-12-08 13:24 UTC (permalink / raw)
To: buildroot
Dear Anders Darander,
On Mon, 11 Nov 2013 13:24:26 +0100, Anders Darander wrote:
> diff --git a/package/ktap/Config.in b/package/ktap/Config.in
> new file mode 100644
> index 0000000..97bcd9c
> --- /dev/null
> +++ b/package/ktap/Config.in
> @@ -0,0 +1,21 @@
> +config BR2_PACKAGE_KTAP
> + bool "ktap"
> + depends on BR2_LINUX_KERNEL
Are you sure it doesn't need any specific C library functionality?
For example, the Makefile seems to link the program against the pthread
library, so ktap should probably "depends on BR2_TOOLCHAIN_HAS_THREADS".
See
http://buildroot.org/downloads/manual/manual.html#dependencies-target-toolchain-options
for details about this topic.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 1/1] ktap: new package
@ 2013-12-08 13:47 Anders Darander
0 siblings, 0 replies; 5+ messages in thread
From: Anders Darander @ 2013-12-08 13:47 UTC (permalink / raw)
To: buildroot
Hi Thomas,
Thanks for the feedback (both in email and the other one), I hope to send out a v2 in a couple of days.
On 8 Dec 2013 14:24, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
>
> Dear Anders Darander,
>
> On Mon, 11 Nov 2013 13:24:26 +0100, Anders Darander wrote:
>
> > diff --git a/package/ktap/Config.in b/package/ktap/Config.in
> > new file mode 100644
> > index 0000000..97bcd9c
> > --- /dev/null
> > +++ b/package/ktap/Config.in
> > @@ -0,0 +1,21 @@
> > +config BR2_PACKAGE_KTAP
> > + bool "ktap"
> > + depends on BR2_LINUX_KERNEL
>
> Are you sure it doesn't need any specific C library functionality?
>
> For example, the Makefile seems to link the program against the pthread
> library, so ktap should probably "depends on BR2_TOOLCHAIN_HAS_THREADS".
I'll have a look at this, though it sounds correct to me. I'll also see of I'll find some more issues.
Cheers,
Anders
> See
> http://buildroot.org/downloads/manual/manual.html#dependencies-target-toolchain-options
> for details about this topic.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20131208/486009f9/attachment.html>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-12-08 13:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-11 12:24 [Buildroot] [PATCH 1/1] ktap: new package Anders Darander
2013-12-08 11:44 ` Anders Darander
2013-12-08 13:19 ` Thomas Petazzoni
2013-12-08 13:24 ` Thomas Petazzoni
-- strict thread matches above, loose matches on Subject: below --
2013-12-08 13:47 Anders Darander
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox