diff mbox series

[v2,4/6] trace-cmd: Move libtraceevent plugins in its own directory.

Message ID 20190802110101.14759-5-tz.stoyanov@gmail.com (mailing list archive)
State Superseded
Headers show
Series Remove redundant trace-cmd plugin handling logic | expand

Commit Message

Tzvetomir Stoyanov (VMware) Aug. 2, 2019, 11 a.m. UTC
All existing plugins are moved from plugins/ to plugins/traceevent/
directory, as all of them (except plugin_python) are designed to be
used with the traceevent library. This change paves the way for
implementing trace-cmd specific plugins.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 .gitignore                                    |  2 +-
 Makefile                                      | 28 +++++++++----------
 lib/trace-cmd/Makefile                        |  2 --
 plugins/{ => traceevent}/Makefile             |  6 ++--
 plugins/{ => traceevent}/plugin_blk.c         |  0
 plugins/{ => traceevent}/plugin_cfg80211.c    |  0
 plugins/{ => traceevent}/plugin_function.c    |  0
 plugins/{ => traceevent}/plugin_futex.c       |  0
 plugins/{ => traceevent}/plugin_hrtimer.c     |  0
 plugins/{ => traceevent}/plugin_jbd2.c        |  0
 plugins/{ => traceevent}/plugin_kmem.c        |  0
 plugins/{ => traceevent}/plugin_kvm.c         |  0
 plugins/{ => traceevent}/plugin_mac80211.c    |  0
 plugins/{ => traceevent}/plugin_python.c      |  0
 .../{ => traceevent}/plugin_sched_switch.c    |  0
 plugins/{ => traceevent}/plugin_scsi.c        |  0
 plugins/{ => traceevent}/plugin_tlb.c         |  0
 plugins/{ => traceevent}/plugin_xen.c         |  0
 18 files changed, 18 insertions(+), 20 deletions(-)
 rename plugins/{ => traceevent}/Makefile (93%)
 rename plugins/{ => traceevent}/plugin_blk.c (100%)
 rename plugins/{ => traceevent}/plugin_cfg80211.c (100%)
 rename plugins/{ => traceevent}/plugin_function.c (100%)
 rename plugins/{ => traceevent}/plugin_futex.c (100%)
 rename plugins/{ => traceevent}/plugin_hrtimer.c (100%)
 rename plugins/{ => traceevent}/plugin_jbd2.c (100%)
 rename plugins/{ => traceevent}/plugin_kmem.c (100%)
 rename plugins/{ => traceevent}/plugin_kvm.c (100%)
 rename plugins/{ => traceevent}/plugin_mac80211.c (100%)
 rename plugins/{ => traceevent}/plugin_python.c (100%)
 rename plugins/{ => traceevent}/plugin_sched_switch.c (100%)
 rename plugins/{ => traceevent}/plugin_scsi.c (100%)
 rename plugins/{ => traceevent}/plugin_tlb.c (100%)
 rename plugins/{ => traceevent}/plugin_xen.c (100%)

Comments

Steven Rostedt Aug. 30, 2019, 3:23 p.m. UTC | #1
On Fri,  2 Aug 2019 14:00:59 +0300
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:

> All existing plugins are moved from plugins/ to plugins/traceevent/
> directory, as all of them (except plugin_python) are designed to be
> used with the traceevent library. This change paves the way for
> implementing trace-cmd specific plugins.
> 
> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
>

To make this more consistent with the kernel, let's move it to:

 lib/traceevent/plugins

and I would suggest making a patch for the kernel to move all the
plugin code to:

 tools/lib/traceevent/plugins

We could then have the trace-cmd plugins be in:

 lib/trace-cmd/plugins

That way we know what goes with what library.

-- Steve
diff mbox series

Patch

diff --git a/.gitignore b/.gitignore
index b7b405f..20bb5a3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,5 +18,5 @@  ctracecmdgui_wrap.c
 tags
 TAGS
 cscope*
-trace_plugin_dir
+traceevent_plugin_dir
 trace_python_dir
diff --git a/Makefile b/Makefile
index ad74a96..8b228f5 100644
--- a/Makefile
+++ b/Makefile
@@ -266,16 +266,16 @@  gui: force $(CMD_TARGETS) $(kshark-dir)/build/Makefile
 trace-cmd: force $(LIBTRACEEVENT_STATIC) $(LIBTRACECMD_STATIC)
 	$(Q)$(MAKE) -C $(src)/tracecmd $(obj)/tracecmd/$@
 
-$(LIBTRACEEVENT_SHARED): force
+$(LIBTRACEEVENT_SHARED): force $(obj)/plugins/traceevent/traceevent_plugin_dir
 	$(Q)$(MAKE) -C $(src)/lib/traceevent $@
 
-$(LIBTRACEEVENT_STATIC): force
+$(LIBTRACEEVENT_STATIC): force $(obj)/plugins/traceevent/traceevent_plugin_dir
 	$(Q)$(MAKE) -C $(src)/lib/traceevent $@
 
-$(LIBTRACECMD_STATIC): force $(obj)/plugins/trace_plugin_dir
+$(LIBTRACECMD_STATIC): force
 	$(Q)$(MAKE) -C $(src)/lib/trace-cmd $@
 
-$(LIBTRACECMD_SHARED): force $(obj)/plugins/trace_plugin_dir
+$(LIBTRACECMD_SHARED): force
 	$(Q)$(MAKE) -C $(src)/lib/trace-cmd $@
 
 libtraceevent.so: $(LIBTRACEEVENT_SHARED)
@@ -285,14 +285,14 @@  libtracecmd.so: $(LIBTRACECMD_SHARED)
 
 libs: $(LIBTRACECMD_SHARED) $(LIBTRACEEVENT_SHARED)
 
-plugins: force $(obj)/plugins/trace_plugin_dir $(obj)/plugins/trace_python_dir
-	$(Q)$(MAKE) -C $(src)/plugins
+plugins: force $(obj)/plugins/traceevent/traceevent_plugin_dir $(obj)/plugins/traceevent/trace_python_dir
+	$(Q)$(MAKE) -C $(src)/plugins/traceevent
 
-$(obj)/plugins/trace_plugin_dir: force
-	$(Q)$(MAKE) -C $(src)/plugins $@
+$(obj)/plugins/traceevent/traceevent_plugin_dir: force
+	$(Q)$(MAKE) -C $(src)/plugins/traceevent $@
 
-$(obj)/plugins/trace_python_dir: force
-	$(Q)$(MAKE) -C $(src)/plugins $@
+$(obj)/plugins/traceevent/trace_python_dir: force
+	$(Q)$(MAKE) -C $(src)/plugins/traceevent $@
 
 show_gui_make:
 	@echo "Note: to build the gui, type \"make gui\""
@@ -318,7 +318,7 @@  cscope: force
 	$(call find_tag_files) | cscope -b -q
 
 install_plugins: force
-	$(Q)$(MAKE) -C $(src)/plugins $@
+	$(Q)$(MAKE) -C $(src)/plugins/traceevent $@
 
 install_python: force
 	$(Q)$(MAKE) -C $(src)/python $@
@@ -356,7 +356,7 @@  clean:
 	$(RM) tags TAGS cscope*
 	$(MAKE) -C $(src)/lib/traceevent clean
 	$(MAKE) -C $(src)/lib/trace-cmd clean
-	$(MAKE) -C $(src)/plugins clean
+	$(MAKE) -C $(src)/plugins/traceevent clean
 	$(MAKE) -C $(src)/python clean
 	$(MAKE) -C $(src)/tracecmd clean
 	if [ -f $(kshark-dir)/build/Makefile ]; then $(MAKE) -C $(kshark-dir)/build clean; fi
@@ -405,8 +405,8 @@  python-gui: $(PYTHON_GUI)
 PHONY += python-plugin
 python-plugin: $(PYTHON_PLUGINS)
 
-plugin_python.so: force $(obj)/plugins/trace_python_dir
-	$(Q)$(MAKE) -C $(src)/plugins $(obj)/plugins/plugin_python.so
+plugin_python.so: force $(obj)/plugins/traceevent/trace_python_dir
+	$(Q)$(MAKE) -C $(src)/plugins/traceevent $(obj)/plugins/traceevent/plugin_python.so
 
 dist:
 	git archive --format=tar --prefix=trace-cmd-$(TRACECMD_VERSION)/ HEAD \
diff --git a/lib/trace-cmd/Makefile b/lib/trace-cmd/Makefile
index 44c1332..6f9a013 100644
--- a/lib/trace-cmd/Makefile
+++ b/lib/trace-cmd/Makefile
@@ -38,8 +38,6 @@  $(bdir)/libtracecmd.so: $(OBJS)
 $(bdir)/%.o: %.c
 	$(Q)$(call do_fpic_compile)
 
-$(bdir)/trace-util.o: $(obj)/plugins/trace_plugin_dir
-
 $(DEPS): $(bdir)/.%.d: %.c
 	$(Q)$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@
 
diff --git a/plugins/Makefile b/plugins/traceevent/Makefile
similarity index 93%
rename from plugins/Makefile
rename to plugins/traceevent/Makefile
index 4598e83..8ed65d3 100644
--- a/plugins/Makefile
+++ b/plugins/traceevent/Makefile
@@ -1,6 +1,6 @@ 
 include $(src)/scripts/utils.mk
 
-bdir:=$(obj)/plugins
+bdir:=$(obj)/plugins/traceevent
 
 PLUGIN_OBJS =
 PLUGIN_OBJS += plugin_jbd2.o
@@ -61,7 +61,7 @@  install_plugins: $(PLUGINS_INSTALL)
 # and $(PYTHON_DIR) change. Without them, a full clean build would necessary
 # in order to get the binaries updated.
 
-$(bdir)/trace_plugin_dir: $(bdir) force
+$(bdir)/traceevent_plugin_dir: $(bdir) force
 	$(Q)$(N)$(call update_dir, 'PLUGIN_DIR=$(PLUGIN_DIR)')
 
 $(bdir)/trace_python_dir: $(bdir) force
@@ -75,7 +75,7 @@  ifneq ($(dep_includes),)
 endif
 
 clean:
-	$(RM) -f $(bdir)/*.a $(bdir)/*.so $(bdir)/*.o $(bdir)/.*.d $(bdir)/trace_plugin_dir $(bdir)/trace_python_dir
+	$(RM) -f $(bdir)/*.a $(bdir)/*.so $(bdir)/*.o $(bdir)/.*.d $(bdir)/traceevent_plugin_dir $(bdir)/trace_python_dir
 
 force:
 .PHONY: clean force
diff --git a/plugins/plugin_blk.c b/plugins/traceevent/plugin_blk.c
similarity index 100%
rename from plugins/plugin_blk.c
rename to plugins/traceevent/plugin_blk.c
diff --git a/plugins/plugin_cfg80211.c b/plugins/traceevent/plugin_cfg80211.c
similarity index 100%
rename from plugins/plugin_cfg80211.c
rename to plugins/traceevent/plugin_cfg80211.c
diff --git a/plugins/plugin_function.c b/plugins/traceevent/plugin_function.c
similarity index 100%
rename from plugins/plugin_function.c
rename to plugins/traceevent/plugin_function.c
diff --git a/plugins/plugin_futex.c b/plugins/traceevent/plugin_futex.c
similarity index 100%
rename from plugins/plugin_futex.c
rename to plugins/traceevent/plugin_futex.c
diff --git a/plugins/plugin_hrtimer.c b/plugins/traceevent/plugin_hrtimer.c
similarity index 100%
rename from plugins/plugin_hrtimer.c
rename to plugins/traceevent/plugin_hrtimer.c
diff --git a/plugins/plugin_jbd2.c b/plugins/traceevent/plugin_jbd2.c
similarity index 100%
rename from plugins/plugin_jbd2.c
rename to plugins/traceevent/plugin_jbd2.c
diff --git a/plugins/plugin_kmem.c b/plugins/traceevent/plugin_kmem.c
similarity index 100%
rename from plugins/plugin_kmem.c
rename to plugins/traceevent/plugin_kmem.c
diff --git a/plugins/plugin_kvm.c b/plugins/traceevent/plugin_kvm.c
similarity index 100%
rename from plugins/plugin_kvm.c
rename to plugins/traceevent/plugin_kvm.c
diff --git a/plugins/plugin_mac80211.c b/plugins/traceevent/plugin_mac80211.c
similarity index 100%
rename from plugins/plugin_mac80211.c
rename to plugins/traceevent/plugin_mac80211.c
diff --git a/plugins/plugin_python.c b/plugins/traceevent/plugin_python.c
similarity index 100%
rename from plugins/plugin_python.c
rename to plugins/traceevent/plugin_python.c
diff --git a/plugins/plugin_sched_switch.c b/plugins/traceevent/plugin_sched_switch.c
similarity index 100%
rename from plugins/plugin_sched_switch.c
rename to plugins/traceevent/plugin_sched_switch.c
diff --git a/plugins/plugin_scsi.c b/plugins/traceevent/plugin_scsi.c
similarity index 100%
rename from plugins/plugin_scsi.c
rename to plugins/traceevent/plugin_scsi.c
diff --git a/plugins/plugin_tlb.c b/plugins/traceevent/plugin_tlb.c
similarity index 100%
rename from plugins/plugin_tlb.c
rename to plugins/traceevent/plugin_tlb.c
diff --git a/plugins/plugin_xen.c b/plugins/traceevent/plugin_xen.c
similarity index 100%
rename from plugins/plugin_xen.c
rename to plugins/traceevent/plugin_xen.c