[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1396017924-7754-18-git-send-email-jovi.zhangwei@gmail.com>
Date: Fri, 28 Mar 2014 10:45:12 -0400
From: Jovi Zhangwei <jovi.zhangwei@...il.com>
To: Ingo Molnar <mingo@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Andi Kleen <andi@...stfloor.org>,
Jovi Zhangwei <jovi.zhangwei@...il.com>
Subject: [PATCH v2 17/29] ktap: add Makefile for kernel module(kernel/trace/ktap/Makefile)
This Makefile compiles kernel module and generate ktapvm.ko.
Signed-off-by: Jovi Zhangwei <jovi.zhangwei@...il.com>
---
kernel/trace/ktap/Makefile | 50 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
create mode 100644 kernel/trace/ktap/Makefile
diff --git a/kernel/trace/ktap/Makefile b/kernel/trace/ktap/Makefile
new file mode 100644
index 0000000..6168ac2
--- /dev/null
+++ b/kernel/trace/ktap/Makefile
@@ -0,0 +1,50 @@
+# Define amalg to enable amalgamation build, This compiles the ktapvm as
+# one huge C file and allows GCC to generate faster and shorter code. Also,
+# this requires lots of memory during the build.
+# Recommend to use amalgmation build as default.
+amalg = 1
+
+# Do not instrument the tracer itself:
+ifdef CONFIG_FUNCTION_TRACER
+ORIG_CFLAGS := $(KBUILD_CFLAGS)
+KBUILD_CFLAGS = $(subst -pg,,$(ORIG_CFLAGS))
+endif
+
+all: mod
+
+KTAP_LIBS = -lpthread
+
+LIB_OBJS += lib_base.o lib_kdebug.o lib_timer.o lib_ansi.o lib_table.o \
+ lib_net.o
+
+ifndef amalg
+RUNTIME_OBJS += ktap.o kp_bcread.o kp_obj.o kp_str.o kp_mempool.o \
+ kp_tab.o kp_vm.o kp_transport.o kp_events.o $(LIB_OBJS)
+else
+RUNTIME_OBJS += amalg.o
+endif
+
+obj-m += ktapvm.o
+ktapvm-y := $(RUNTIME_OBJS)
+
+KVERSION ?= $(shell uname -r)
+KERNEL_SRC ?= /lib/modules/$(KVERSION)/build
+PWD := $(shell pwd)
+mod:
+ $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules
+
+modules_install:
+ $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install
+
+load:
+ insmod ktapvm.ko
+
+unload:
+ rmmod ktapvm
+
+reload:
+ make unload; make load
+
+clean:
+ $(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean
+
--
1.8.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists