From: "Vladislav Valtchev (VMware)" <vladislav.valtchev@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org, y.karadz@gmail.com,
"Vladislav Valtchev (VMware)" <vladislav.valtchev@gmail.com>
Subject: [PATCH v2 08/24] trace-cmd: Move libtracecmd *.c files in lib/trace-cmd
Date: Tue, 6 Feb 2018 10:48:50 +0200 [thread overview]
Message-ID: <20180206084906.9854-9-vladislav.valtchev@gmail.com> (raw)
In-Reply-To: <20180206084906.9854-1-vladislav.valtchev@gmail.com>
This patch moves all the source files belonging to the trace-cmd library into
the dedicated directory lib/trace-cmd. The build system has been updated to
support this new directory structure by adding a dedicated Makefile in
lib/trace-cmd and by making the parent Makefile to invoke it.
Signed-off-by: Vladislav Valtchev (VMware) <vladislav.valtchev@gmail.com>
---
Makefile | 54 ++++++++++------------
lib/trace-cmd/Makefile | 45 ++++++++++++++++++
trace-blk-hack.c => lib/trace-cmd/trace-blk-hack.c | 0
trace-ftrace.c => lib/trace-cmd/trace-ftrace.c | 0
trace-hash.c => lib/trace-cmd/trace-hash.c | 0
trace-hooks.c => lib/trace-cmd/trace-hooks.c | 0
trace-input.c => lib/trace-cmd/trace-input.c | 0
trace-recorder.c => lib/trace-cmd/trace-recorder.c | 0
trace-util.c => lib/trace-cmd/trace-util.c | 0
9 files changed, 70 insertions(+), 29 deletions(-)
create mode 100644 lib/trace-cmd/Makefile
rename trace-blk-hack.c => lib/trace-cmd/trace-blk-hack.c (100%)
rename trace-ftrace.c => lib/trace-cmd/trace-ftrace.c (100%)
rename trace-hash.c => lib/trace-cmd/trace-hash.c (100%)
rename trace-hooks.c => lib/trace-cmd/trace-hooks.c (100%)
rename trace-input.c => lib/trace-cmd/trace-input.c (100%)
rename trace-recorder.c => lib/trace-cmd/trace-recorder.c (100%)
rename trace-util.c => lib/trace-cmd/trace-util.c (100%)
diff --git a/Makefile b/Makefile
index 26b97e5..2c08162 100644
--- a/Makefile
+++ b/Makefile
@@ -186,7 +186,9 @@ LIBTRACEEVENT_DIR = $(obj)/lib/traceevent
LIBTRACEEVENT_STATIC = $(LIBTRACEEVENT_DIR)/libtraceevent.a
LIBTRACEEVENT_SHARED = $(LIBTRACEEVENT_DIR)/libtraceevent.so
-LIB_FILE = libtracecmd.a
+LIBTRACECMD_DIR = $(obj)/lib/trace-cmd
+LIBTRACECMD_STATIC = $(LIBTRACECMD_DIR)/libtracecmd.a
+LIBTRACECMD_SHARED = $(LIBTRACECMD_DIR)/libtracecmd.so
PACKAGES= gtk+-2.0 libxml-2.0 gthread-2.0
@@ -301,8 +303,9 @@ TRACE_GUI_OBJS = trace-filter.o trace-compat.o trace-filter-hash.o trace-dialog.
trace-xml.o
TRACE_CMD_OBJS = trace-cmd.o trace-record.o trace-read.o trace-split.o trace-listen.o \
trace-stack.o trace-hist.o trace-mem.o trace-snapshot.o trace-stat.o \
- trace-hash.o trace-profile.o trace-stream.o trace-record.o trace-restore.o \
- trace-check-events.o trace-show.o trace-list.o
+ trace-profile.o trace-stream.o trace-record.o trace-restore.o \
+ trace-check-events.o trace-show.o trace-list.o \
+ trace-output.o trace-usage.o trace-msg.o
TRACE_VIEW_OBJS = trace-view.o trace-view-store.o
TRACE_GRAPH_OBJS = trace-graph.o trace-plot.o trace-plot-cpu.o trace-plot-task.o
TRACE_VIEW_MAIN_OBJS = trace-view-main.o $(TRACE_VIEW_OBJS) $(TRACE_GUI_OBJS)
@@ -310,11 +313,6 @@ TRACE_GRAPH_MAIN_OBJS = trace-graph-main.o $(TRACE_GRAPH_OBJS) $(TRACE_GUI_OBJS)
KERNEL_SHARK_OBJS = $(TRACE_VIEW_OBJS) $(TRACE_GRAPH_OBJS) $(TRACE_GUI_OBJS) \
trace-capture.o kernel-shark.o
-TCMD_LIB_OBJS = trace-util.o trace-input.o trace-ftrace.o \
- trace-output.o trace-recorder.o \
- trace-usage.o trace-blk-hack.o \
- trace-hooks.o trace-msg.o
-
PLUGIN_OBJS =
PLUGIN_OBJS += plugin_jbd2.o
PLUGIN_OBJS += plugin_hrtimer.o
@@ -332,9 +330,9 @@ PLUGIN_OBJS += plugin_tlb.o
PLUGINS := $(PLUGIN_OBJS:.o=.so)
ALL_OBJS = $(TRACE_CMD_OBJS) $(KERNEL_SHARK_OBJS) $(TRACE_VIEW_MAIN_OBJS) \
- $(TRACE_GRAPH_MAIN_OBJS) $(TCMD_LIB_OBJS) $(PLUGIN_OBJS)
+ $(TRACE_GRAPH_MAIN_OBJS) $(PLUGIN_OBJS)
-CMD_TARGETS = trace_plugin_dir trace_python_dir tc_version.h $(LIB_FILE) \
+CMD_TARGETS = trace_plugin_dir trace_python_dir tc_version.h \
trace-cmd $(PLUGINS) $(BUILD_PYTHON)
GUI_TARGETS = ks_version.h trace-graph trace-view kernelshark
@@ -375,10 +373,10 @@ trace-view: $(TRACE_VIEW_MAIN_OBJS)
trace-graph: $(TRACE_GRAPH_MAIN_OBJS)
$(Q)$(G)$(do_app_build)
-trace-cmd: libtracecmd.a $(LIBTRACEEVENT_STATIC)
-kernelshark: libtracecmd.a $(LIBTRACEEVENT_STATIC)
-trace-view: libtracecmd.a $(LIBTRACEEVENT_STATIC)
-trace-graph: libtracecmd.a $(LIBTRACEEVENT_STATIC)
+trace-cmd: $(LIBTRACECMD_STATIC) $(LIBTRACEEVENT_STATIC)
+kernelshark: $(LIBTRACECMD_STATIC) $(LIBTRACEEVENT_STATIC)
+trace-view: $(LIBTRACECMD_STATIC) $(LIBTRACEEVENT_STATIC)
+trace-graph: $(LIBTRACECMD_STATIC) $(LIBTRACEEVENT_STATIC)
$(LIBTRACEEVENT_SHARED): force
$(Q)$(MAKE) -C $(src)/lib/traceevent libtraceevent.so
@@ -386,21 +384,18 @@ $(LIBTRACEEVENT_SHARED): force
$(LIBTRACEEVENT_STATIC): force
$(Q)$(MAKE) -C $(src)/lib/traceevent libtraceevent.a
+$(LIBTRACECMD_STATIC): force trace_plugin_dir
+ $(Q)$(MAKE) -C $(src)/lib/trace-cmd libtracecmd.a
+
+$(LIBTRACECMD_SHARED): force trace_plugin_dir
+ $(Q)$(MAKE) -C $(src)/lib/trace-cmd libtracecmd.so
+
libtraceevent.so: $(LIBTRACEEVENT_SHARED)
libtraceevent.a: $(LIBTRACEEVENT_STATIC)
+libtracecmd.a: $(LIBTRACECMD_STATIC)
+libtracecmd.so: $(LIBTRACECMD_SHARED)
-$(TCMD_LIB_OBJS): %.o: $(src)/%.c
- $(Q)$(do_fpic_compile)
-
-libtracecmd.so: $(TCMD_LIB_OBJS)
- $(Q)$(do_compile_shared_library)
-
-libtracecmd.a: $(TCMD_LIB_OBJS)
- $(Q)$(do_build_static_lib)
-
-libs: libtracecmd.so $(LIBTRACEEVENT_SHARED)
-
-trace-util.o: trace_plugin_dir
+libs: $(LIBTRACECMD_SHARED) $(LIBTRACEEVENT_SHARED)
$(PLUGIN_OBJS): %.o : $(src)/%.c
$(Q)$(do_compile_plugin_obj)
@@ -568,7 +563,7 @@ install_gui: install_cmd gui
$(Q)$(call do_install,kernelshark,$(bindir_SQ))
install_libs: libs
- $(Q)$(call do_install,libtracecmd.so,$(libdir_SQ))
+ $(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ))
$(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ))
$(Q)$(call do_install,$(src)/include/traceevent/event-parse.h,$(includedir_SQ))
$(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(includedir_SQ))
@@ -586,6 +581,7 @@ clean:
$(RM) *.o *~ $(TARGETS) *.a *.so ctracecmd_wrap.c .*.d
$(RM) tags TAGS cscope*
$(MAKE) -C $(src)/lib/traceevent clean
+ $(MAKE) -C $(src)/lib/trace-cmd clean
##### PYTHON STUFF #####
@@ -603,9 +599,9 @@ PYGTK_CFLAGS = `pkg-config --cflags pygtk-2.0`
ctracecmd.so: $(TCMD_LIB_OBJS) ctracecmd.i
swig -Wall -python -noproxy -I$(src)/include/traceevent -I$(src)/include/trace-cmd ctracecmd.i
$(CC) -fpic -c $(CPPFLAGS) $(CFLAGS) $(PYTHON_INCLUDES) ctracecmd_wrap.c
- $(CC) --shared $(TCMD_LIB_OBJS) $(LDFLAGS) ctracecmd_wrap.o -o ctracecmd.so
+ $(CC) --shared $(LIBTRACECMD_STATIC) $(LDFLAGS) ctracecmd_wrap.o -o ctracecmd.so
-ctracecmdgui.so: $(TRACE_VIEW_OBJS) $(LIB_FILE)
+ctracecmdgui.so: $(TRACE_VIEW_OBJS) $(LIBTRACECMD_STATIC)
swig -Wall -python -noproxy ctracecmdgui.i
$(CC) -fpic -c $(CPPFLAGS) $(CFLAGS) $(INCLUDES) $(PYTHON_INCLUDES) $(PYGTK_CFLAGS) ctracecmdgui_wrap.c
$(CC) --shared $^ $(LDFLAGS) $(LIBS) $(CONFIG_LIBS) ctracecmdgui_wrap.o -o ctracecmdgui.so
diff --git a/lib/trace-cmd/Makefile b/lib/trace-cmd/Makefile
new file mode 100644
index 0000000..dcb5cd5
--- /dev/null
+++ b/lib/trace-cmd/Makefile
@@ -0,0 +1,45 @@
+
+
+include $(src)/scripts/utils.mk
+
+DEFAULT_TARGET = libtracecmd.a
+
+OBJS =
+OBJS += trace-hash.o
+OBJS += trace-hooks.o
+OBJS += trace-input.o
+OBJS += trace-recorder.o
+OBJS += trace-util.o
+
+# Additional util objects
+OBJS += trace-blk-hack.o
+OBJS += trace-ftrace.o
+
+DEPS := $(OBJS:%.o=.%.d)
+
+all: $(DEFAULT_TARGET)
+
+libtracecmd.a: $(OBJS)
+ $(Q)$(call do_build_static_lib)
+
+libtracecmd.so: $(OBJS)
+ $(Q)$(call do_compile_shared_library)
+
+%.o: %.c
+ $(Q)$(call do_fpic_compile)
+
+$(DEPS): .%.d: %.c
+ $(Q)$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@
+
+$(OBJS): %.o : .%.d
+
+dep_includes := $(wildcard $(DEPS))
+
+ifneq ($(dep_includes),)
+ include $(dep_includes)
+endif
+
+clean:
+ $(RM) *.a *.so *.o .*.d
+
+.PHONY: clean
diff --git a/trace-blk-hack.c b/lib/trace-cmd/trace-blk-hack.c
similarity index 100%
rename from trace-blk-hack.c
rename to lib/trace-cmd/trace-blk-hack.c
diff --git a/trace-ftrace.c b/lib/trace-cmd/trace-ftrace.c
similarity index 100%
rename from trace-ftrace.c
rename to lib/trace-cmd/trace-ftrace.c
diff --git a/trace-hash.c b/lib/trace-cmd/trace-hash.c
similarity index 100%
rename from trace-hash.c
rename to lib/trace-cmd/trace-hash.c
diff --git a/trace-hooks.c b/lib/trace-cmd/trace-hooks.c
similarity index 100%
rename from trace-hooks.c
rename to lib/trace-cmd/trace-hooks.c
diff --git a/trace-input.c b/lib/trace-cmd/trace-input.c
similarity index 100%
rename from trace-input.c
rename to lib/trace-cmd/trace-input.c
diff --git a/trace-recorder.c b/lib/trace-cmd/trace-recorder.c
similarity index 100%
rename from trace-recorder.c
rename to lib/trace-cmd/trace-recorder.c
diff --git a/trace-util.c b/lib/trace-cmd/trace-util.c
similarity index 100%
rename from trace-util.c
rename to lib/trace-cmd/trace-util.c
--
2.14.1
next prev parent reply other threads:[~2018-02-06 8:49 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 8:48 [PATCH v2 00/24] trace-cmd: restructure the project's source tree Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 01/24] trace-cmd: Rename libparsevent to libtraceevent Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 02/24] trace-cmd: Move libtraceevent headers in include/traceevent Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 03/24] trace-cmd: Move trace-cmd headers in include/trace-cmd Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 04/24] trace-cmd: Move event-utils.h in lib/traceevent/include Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 05/24] trace-cmd: Extract part of Makefile in scripts/utils.mk Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 06/24] trace-cmd: Move libtraceevent *.c files in lib/traceevent Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 07/24] trace-cmd: Move trace-hash-local.h in lib/trace-cmd/include Vladislav Valtchev (VMware)
2018-02-06 8:48 ` Vladislav Valtchev (VMware) [this message]
2018-02-06 8:48 ` [PATCH v2 09/24] trace-cmd: Move GUI headers in kernel-shark/include Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 10/24] trace-cmd: Move GUI *.c files in kernel-shark/ Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 11/24] trace-cmd: Move plugin_* files in plugins/ Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 12/24] trace-cmd: Fix the broken target ctracecmdgui.so Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 13/24] trace-cmd: Move python-related files in python/ Vladislav Valtchev (VMware)
2018-02-07 19:22 ` Steven Rostedt
2018-02-07 19:36 ` Steven Rostedt
2018-02-08 7:17 ` Vladislav K. Valtchev
2018-02-07 20:11 ` Steven Rostedt
2018-02-08 7:29 ` Vladislav K. Valtchev
2018-02-06 8:48 ` [PATCH v2 14/24] trace-cmd: Move tracecmd headers in tracecmd/include Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 15/24] trace-cmd: Move version.h in include/ Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 16/24] trace-cmd: Move trace-cmd app files in tracecmd/ Vladislav Valtchev (VMware)
2018-02-06 8:48 ` [PATCH v2 17/24] trace-cmd: Fix the logic behind SWIG_DEFINED in the Makefile Vladislav Valtchev (VMware)
2018-02-06 8:49 ` [PATCH v2 18/24] trace-cmd: Make the build to tell when python-dev is missing Vladislav Valtchev (VMware)
2018-02-06 8:49 ` [PATCH v2 19/24] trace-cmd: Make libtraceevent builable out-of-tree Vladislav Valtchev (VMware)
2018-02-06 8:49 ` [PATCH v2 20/24] trace-cmd: Make the plugins buildable out-of-tree Vladislav Valtchev (VMware)
2018-02-06 8:49 ` [PATCH v2 21/24] trace-cmd: Make libtracecmd " Vladislav Valtchev (VMware)
2018-02-06 8:49 ` [PATCH v2 22/24] trace-cmd: Make the trace-cmd target " Vladislav Valtchev (VMware)
2018-02-06 8:49 ` [PATCH v2 23/24] trace-cmd: Make the python targets " Vladislav Valtchev (VMware)
2018-02-06 8:49 ` [PATCH v2 24/24] trace-cmd: Make the GUI " Vladislav Valtchev (VMware)
2018-02-07 0:27 ` [PATCH v2 00/24] trace-cmd: restructure the project's source tree Steven Rostedt
2018-02-07 13:15 ` Vladislav Valtchev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180206084906.9854-9-vladislav.valtchev@gmail.com \
--to=vladislav.valtchev@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=y.karadz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).