[OpenWrt-Devel] [PATCH 4/5] config: add an option to enable KPROBE

Mathieu Olivari mathieu at codeaurora.org
Mon Mar 30 19:47:58 EDT 2015


Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
---
 config/Config-kernel.in          | 17 +++++++++++++++++
 include/kernel-defaults.mk       |  1 -
 target/linux/generic/config-3.10 |  4 ++++
 target/linux/generic/config-3.14 |  4 ++++
 target/linux/generic/config-3.18 |  4 ++++
 target/linux/generic/config-4.0  |  4 ++++
 6 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index 8471129..cc8df5a 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -127,6 +127,23 @@ config KERNEL_EARLY_PRINTK
 	  debugging purposes to send messages over the serial console in early boot.
 	  Enable this to debug early boot problems.
 
+config KERNEL_KPROBES
+	bool "Compile the kernel with kprobes support"
+	default n
+	select KERNEL_FTRACE
+	select KERNEL_PERF_EVENTS
+	help
+	  Compiles the kernel with KPROBES support, which allows you to trap
+	  at almost any kernel address and execute a callback function.
+	  register_kprobe() establishes a probepoint and specifies the
+	  callback. Kprobes is useful for kernel debugging, non-intrusive
+	  instrumentation and testing.
+	  If in doubt, say "N".
+
+config KERNEL_KPROBE_EVENT
+	bool
+	default y if KERNEL_KPROBES
+
 config KERNEL_AIO
 	bool "Compile the kernel with asynchronous IO support"
 	default n
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 3a32209..24d2630 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -107,7 +107,6 @@ define Kernel/Configure/Default
 	echo "# CONFIG_KALLSYMS_EXTRA_PASS is not set" >> $(LINUX_DIR)/.config.target
 	echo "# CONFIG_KALLSYMS_ALL is not set" >> $(LINUX_DIR)/.config.target
 	echo "# CONFIG_KALLSYMS_UNCOMPRESSED is not set" >> $(LINUX_DIR)/.config.target
-	echo "# CONFIG_KPROBES is not set" >> $(LINUX_DIR)/.config.target
 	$(SCRIPT_DIR)/metadata.pl kconfig $(TMP_DIR)/.packageinfo $(TOPDIR)/.config $(KERNEL_PATCHVER) > $(LINUX_DIR)/.config.override
 	$(SCRIPT_DIR)/kconfig.pl 'm+' '+' $(LINUX_DIR)/.config.target /dev/null $(LINUX_DIR)/.config.override > $(LINUX_DIR)/.config
 	$(call Kernel/SetNoInitramfs)
diff --git a/target/linux/generic/config-3.10 b/target/linux/generic/config-3.10
index 4ccc969..c16d04b 100644
--- a/target/linux/generic/config-3.10
+++ b/target/linux/generic/config-3.10
@@ -204,6 +204,7 @@ CONFIG_ARM_DMA_MEM_BUFFERABLE=y
 # CONFIG_ARM_ERRATA_764369 is not set
 # CONFIG_ARM_ERRATA_775420 is not set
 # CONFIG_ARM_ERRATA_798181 is not set
+# CONFIG_ARM_KPROBES_TEST is not set
 # CONFIG_ARM_PATCH_PHYS_VIRT is not set
 # CONFIG_ARM_PSCI is not set
 # CONFIG_ARM_UNWIND is not set
@@ -1551,6 +1552,7 @@ CONFIG_KERNEL_XZ=y
 # CONFIG_KGDB is not set
 # CONFIG_KMEMCHECK is not set
 # CONFIG_KPROBES is not set
+# CONFIG_KPROBES_SANITY_TEST is not set
 # CONFIG_KS8842 is not set
 # CONFIG_KS8851 is not set
 # CONFIG_KS8851_MLL is not set
@@ -2172,6 +2174,7 @@ CONFIG_NET_SCH_FQ_CODEL=y
 # CONFIG_NET_SCH_SFQ is not set
 # CONFIG_NET_SCH_TBF is not set
 # CONFIG_NET_SCH_TEQL is not set
+# CONFIG_NET_TCPPROBE is not set
 # CONFIG_NET_TEAM is not set
 # CONFIG_NET_TULIP is not set
 CONFIG_NET_VENDOR_3COM=y
@@ -2569,6 +2572,7 @@ CONFIG_PPP_MULTILINK=y
 # CONFIG_PPTP is not set
 # CONFIG_PREEMPT is not set
 CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_TRACER is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_PRINTK=y
diff --git a/target/linux/generic/config-3.14 b/target/linux/generic/config-3.14
index 150c6e3..846ea1e 100644
--- a/target/linux/generic/config-3.14
+++ b/target/linux/generic/config-3.14
@@ -229,6 +229,7 @@ CONFIG_ARM_DMA_MEM_BUFFERABLE=y
 # CONFIG_ARM_ERRATA_773022 is not set
 # CONFIG_ARM_ERRATA_775420 is not set
 # CONFIG_ARM_ERRATA_798181 is not set
+# CONFIG_ARM_KPROBES_TEST is not set
 # CONFIG_ARM_PATCH_PHYS_VIRT is not set
 # CONFIG_ARM_PSCI is not set
 # CONFIG_ARM_PTDUMP is not set
@@ -1687,6 +1688,7 @@ CONFIG_KERNEL_XZ=y
 # CONFIG_KGDB is not set
 # CONFIG_KMEMCHECK is not set
 # CONFIG_KPROBES is not set
+# CONFIG_KPROBES_SANITY_TEST is not set
 # CONFIG_KS8842 is not set
 # CONFIG_KS8851 is not set
 # CONFIG_KS8851_MLL is not set
@@ -2347,6 +2349,7 @@ CONFIG_NET_SCH_FQ_CODEL=y
 # CONFIG_NET_SCH_SFQ is not set
 # CONFIG_NET_SCH_TBF is not set
 # CONFIG_NET_SCH_TEQL is not set
+# CONFIG_NET_TCPPROBE is not set
 # CONFIG_NET_TEAM is not set
 # CONFIG_NET_TULIP is not set
 CONFIG_NET_VENDOR_3COM=y
@@ -2762,6 +2765,7 @@ CONFIG_PPP_MULTILINK=y
 # CONFIG_PPTP is not set
 # CONFIG_PREEMPT is not set
 CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_TRACER is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_PRINTK=y
diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18
index 15fea1d..de12bc7 100644
--- a/target/linux/generic/config-3.18
+++ b/target/linux/generic/config-3.18
@@ -247,6 +247,7 @@ CONFIG_ARM_DMA_MEM_BUFFERABLE=y
 # CONFIG_ARM_ERRATA_773022 is not set
 # CONFIG_ARM_ERRATA_775420 is not set
 # CONFIG_ARM_ERRATA_798181 is not set
+# CONFIG_ARM_KPROBES_TEST is not set
 # CONFIG_ARM_PATCH_PHYS_VIRT is not set
 # CONFIG_ARM_PSCI is not set
 # CONFIG_ARM_PTDUMP is not set
@@ -1767,6 +1768,7 @@ CONFIG_KERNFS=y
 # CONFIG_KGDB is not set
 # CONFIG_KMEMCHECK is not set
 # CONFIG_KPROBES is not set
+# CONFIG_KPROBES_SANITY_TEST is not set
 # CONFIG_KS8842 is not set
 # CONFIG_KS8851 is not set
 # CONFIG_KS8851_MLL is not set
@@ -2467,6 +2469,7 @@ CONFIG_NET_SCH_FQ_CODEL=y
 # CONFIG_NET_SCH_SFQ is not set
 # CONFIG_NET_SCH_TBF is not set
 # CONFIG_NET_SCH_TEQL is not set
+# CONFIG_NET_TCPPROBE is not set
 # CONFIG_NET_TEAM is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_NET_UDP_TUNNEL is not set
@@ -2895,6 +2898,7 @@ CONFIG_PPP_MULTILINK=y
 # CONFIG_PPTP is not set
 # CONFIG_PREEMPT is not set
 CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_TRACER is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_PRINTK=y
diff --git a/target/linux/generic/config-4.0 b/target/linux/generic/config-4.0
index f30abd7..4e55edc 100644
--- a/target/linux/generic/config-4.0
+++ b/target/linux/generic/config-4.0
@@ -249,6 +249,7 @@ CONFIG_ARM_DMA_MEM_BUFFERABLE=y
 # CONFIG_ARM_ERRATA_775420 is not set
 # CONFIG_ARM_ERRATA_798181 is not set
 # CONFIG_ARM_KERNMEM_PERMS is not set
+# CONFIG_ARM_KPROBES_TEST is not set
 # CONFIG_ARM_PATCH_PHYS_VIRT is not set
 # CONFIG_ARM_PSCI is not set
 # CONFIG_ARM_PTDUMP is not set
@@ -1788,6 +1789,7 @@ CONFIG_KERNFS=y
 # CONFIG_KGDB is not set
 # CONFIG_KMEMCHECK is not set
 # CONFIG_KPROBES is not set
+# CONFIG_KPROBES_SANITY_TEST is not set
 # CONFIG_KS8842 is not set
 # CONFIG_KS8851 is not set
 # CONFIG_KS8851_MLL is not set
@@ -2498,6 +2500,7 @@ CONFIG_NET_SCH_FQ_CODEL=y
 # CONFIG_NET_SCH_TBF is not set
 # CONFIG_NET_SCH_TEQL is not set
 # CONFIG_NET_SWITCHDEV is not set
+# CONFIG_NET_TCPPROBE is not set
 # CONFIG_NET_TEAM is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_NET_UDP_TUNNEL is not set
@@ -2931,6 +2934,7 @@ CONFIG_PPP_MULTILINK=y
 # CONFIG_PPTP is not set
 # CONFIG_PREEMPT is not set
 CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_TRACER is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_PRINTK=y
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list