summaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2016-04-28 10:03:04 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2016-05-01 09:12:26 +0200
commitb79b3a68a6f097f56bf75c54361a44abfae27737 (patch)
treeb283946dea50127dd6ebb49a91a6ca27b16d1c2a /rules
parente30ffd90ad2615b3d2c8d1f015f91d2bbbefc292 (diff)
downloadptxdist-b79b3a68a6f097f56bf75c54361a44abfae27737.tar.gz
ptxdist-b79b3a68a6f097f56bf75c54361a44abfae27737.tar.xz
kernel: add support for perf and iio tools
Not-Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'rules')
-rw-r--r--rules/kernel.in17
-rw-r--r--rules/kernel.make46
2 files changed, 63 insertions, 0 deletions
diff --git a/rules/kernel.in b/rules/kernel.in
index 77345336b..be5753ed3 100644
--- a/rules/kernel.in
+++ b/rules/kernel.in
@@ -2,6 +2,10 @@
menuconfig KERNEL
bool "kernel tools "
+ select LIBELF if KERNEL_TOOL_PERF
+ select LIBELF_LIBDW if KERNEL_TOOL_PERF
+ select SLANG if KERNEL_TOOL_PERF
+ select BINUTILS if KERNEL_TOOL_PERF
if KERNEL
@@ -17,4 +21,17 @@ config KERNEL_VMLINUX
help
install kernel image to /boot/vmlinux
+config KERNEL_TOOL_PERF
+ select KERNEL_XPKG
+ bool "perf"
+ help
+ perf helps to analyze and measure performance using hardware and
+ software counters.
+
+config KERNEL_TOOL_IIO
+ select KERNEL_XPKG
+ bool "iio (>=v4.5)"
+ help
+ IIO tools help to access and analyze the iio devices.
+
endif
diff --git a/rules/kernel.make b/rules/kernel.make
index 4e52defdf..3d4948a28 100644
--- a/rules/kernel.make
+++ b/rules/kernel.make
@@ -158,6 +158,29 @@ $(STATEDIR)/kernel.tags:
# Compile
# ----------------------------------------------------------------------------
+KERNEL_TOOL_PERF_OPTS := \
+ NO_LIBPERL=1 \
+ NO_LIBPYTHON=1 \
+ NO_NEWT=1 \
+ SLANG=1 \
+ NO_GTK2=1 \
+ DEMANGLE=1 \
+ LIBEL=1 \
+ NO_LIBUNWIND=1 \
+ BACKTRACE=1 \
+ NO_LIBNUMA=1 \
+ NO_LIBAUDIT=1 \
+ NO_LIBBIONIC=1 \
+ NO_LIBCRYPTO=1 \
+ LIBDW_DWARF_UNWIND=1 \
+ NO_PERF_READ_VDSO32=1 \
+ NO_PERF_READ_VDSOX32=1 \
+ ZLIB=1 \
+ NO_LIBBABELTRACE=1 \
+ NO_LZMA=1 \
+ AUXTRACE=1 \
+ NO_LIBBPF=1
+
$(STATEDIR)/kernel.compile:
@$(call targetinfo)
@rm -f \
@@ -165,6 +188,14 @@ $(STATEDIR)/kernel.compile:
$(KERNEL_DIR)/usr/.initramfs_data.cpio.*
@+cd $(KERNEL_DIR) && $(KERNEL_PATH) $(KERNEL_ENV) $(MAKE) \
$(KERNEL_MAKEVARS) $(KERNEL_IMAGE) $(PTXCONF_KERNEL_MODULES_BUILD)
+ifdef PTXCONF_KERNEL_TOOL_PERF
+ @+cd $(KERNEL_DIR) && $(KERNEL_PATH) $(KERNEL_ENV) $(MAKE) \
+ $(KERNEL_MAKEVARS) -C tools/perf
+endif
+ifdef PTXCONF_KERNEL_TOOL_IIO
+ @+cd $(KERNEL_DIR) && $(KERNEL_PATH) $(KERNEL_ENV) $(MAKE) \
+ $(KERNEL_MAKEVARS) -C tools/iio
+endif
@$(call touch)
endif # !PTXCONF_PROJECT_USE_PRODUCTION
@@ -204,6 +235,7 @@ ifdef PTXCONF_KERNEL_XPKG
@$(call install_fixup, kernel, DESCRIPTION,missing)
@$(call install_copy, kernel, 0, 0, 0755, /boot);
+
ifdef PTXCONF_KERNEL_INSTALL
@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
endif
@@ -213,6 +245,20 @@ ifdef PTXCONF_KERNEL_VMLINUX
@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_DIR)/vmlinux, /boot/vmlinux, n)
endif
+ifdef PTXCONF_KERNEL_TOOL_PERF
+ @$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_DIR)/tools/perf/perf, \
+ /usr/bin/perf)
+endif
+
+ifdef PTXCONF_KERNEL_TOOL_IIO
+ @$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_DIR)/tools/iio/generic_buffer, \
+ /usr/bin/iio_generic_buffer)
+ @$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_DIR)/tools/iio/lsiio, \
+ /usr/bin/lsiio)
+ @$(call install_copy, kernel, 0, 0, 0755, $(KERNEL_DIR)/tools/iio/iio_event_monitor, \
+ /usr/bin/iio_event_monitor)
+endif
+
@$(call install_finish, kernel)
endif