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 dabdf8d..f336f7a 100644
--- a/Makefile
+++ b/Makefile
@@ -273,16 +273,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)/lib/traceevent/plugins/traceevent_plugin_dir
 	$(Q)$(MAKE) -C $(src)/lib/traceevent $@
 
-$(LIBTRACEEVENT_STATIC): force
+$(LIBTRACEEVENT_STATIC): force $(obj)/lib/traceevent/plugins/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)
@@ -292,14 +292,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)/lib/traceevent/plugins/traceevent_plugin_dir $(obj)/lib/traceevent/plugins/trace_python_dir
+	$(Q)$(MAKE) -C $(src)/lib/traceevent/plugins
 
-$(obj)/plugins/trace_plugin_dir: force
-	$(Q)$(MAKE) -C $(src)/plugins $@
+$(obj)/lib/traceevent/plugins/traceevent_plugin_dir: force
+	$(Q)$(MAKE) -C $(src)/lib/traceevent/plugins $@
 
-$(obj)/plugins/trace_python_dir: force
-	$(Q)$(MAKE) -C $(src)/plugins $@
+$(obj)/lib/traceevent/plugins/trace_python_dir: force
+	$(Q)$(MAKE) -C $(src)/lib/traceevent/plugins $@
 
 show_gui_make:
 	@echo "Note: to build the gui, type \"make gui\""
@@ -325,7 +325,7 @@ cscope: force
 	$(call find_tag_files) | cscope -b -q
 
 install_plugins: force
-	$(Q)$(MAKE) -C $(src)/plugins $@
+	$(Q)$(MAKE) -C $(src)/lib/traceevent/plugins $@
 
 install_python: force
 	$(Q)$(MAKE) -C $(src)/python $@
@@ -372,7 +372,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)/lib/traceevent/plugins 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
@@ -421,8 +421,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)/lib/traceevent/plugins/trace_python_dir
+	$(Q)$(MAKE) -C $(src)/lib/traceevent/plugins $(obj)/lib/traceevent/plugins/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 78875e4..3b4b5aa 100644
--- a/lib/trace-cmd/Makefile
+++ b/lib/trace-cmd/Makefile
@@ -40,8 +40,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/lib/traceevent/plugins/Makefile
similarity index 93%
rename from plugins/Makefile
rename to lib/traceevent/plugins/Makefile
index 4598e83..e0a7566 100644
--- a/plugins/Makefile
+++ b/lib/traceevent/plugins/Makefile
@@ -1,6 +1,6 @@
 include $(src)/scripts/utils.mk
 
-bdir:=$(obj)/plugins
+bdir:=$(obj)/lib/traceevent/plugins
 
 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/lib/traceevent/plugins/plugin_blk.c
similarity index 100%
rename from plugins/plugin_blk.c
rename to lib/traceevent/plugins/plugin_blk.c
diff --git a/plugins/plugin_cfg80211.c b/lib/traceevent/plugins/plugin_cfg80211.c
similarity index 100%
rename from plugins/plugin_cfg80211.c
rename to lib/traceevent/plugins/plugin_cfg80211.c
diff --git a/plugins/plugin_function.c b/lib/traceevent/plugins/plugin_function.c
similarity index 100%
rename from plugins/plugin_function.c
rename to lib/traceevent/plugins/plugin_function.c
diff --git a/plugins/plugin_futex.c b/lib/traceevent/plugins/plugin_futex.c
similarity index 100%
rename from plugins/plugin_futex.c
rename to lib/traceevent/plugins/plugin_futex.c
diff --git a/plugins/plugin_hrtimer.c b/lib/traceevent/plugins/plugin_hrtimer.c
similarity index 100%
rename from plugins/plugin_hrtimer.c
rename to lib/traceevent/plugins/plugin_hrtimer.c
diff --git a/plugins/plugin_jbd2.c b/lib/traceevent/plugins/plugin_jbd2.c
similarity index 100%
rename from plugins/plugin_jbd2.c
rename to lib/traceevent/plugins/plugin_jbd2.c
diff --git a/plugins/plugin_kmem.c b/lib/traceevent/plugins/plugin_kmem.c
similarity index 100%
rename from plugins/plugin_kmem.c
rename to lib/traceevent/plugins/plugin_kmem.c
diff --git a/plugins/plugin_kvm.c b/lib/traceevent/plugins/plugin_kvm.c
similarity index 100%
rename from plugins/plugin_kvm.c
rename to lib/traceevent/plugins/plugin_kvm.c
diff --git a/plugins/plugin_mac80211.c b/lib/traceevent/plugins/plugin_mac80211.c
similarity index 100%
rename from plugins/plugin_mac80211.c
rename to lib/traceevent/plugins/plugin_mac80211.c
diff --git a/plugins/plugin_python.c b/lib/traceevent/plugins/plugin_python.c
similarity index 100%
rename from plugins/plugin_python.c
rename to lib/traceevent/plugins/plugin_python.c
diff --git a/plugins/plugin_sched_switch.c b/lib/traceevent/plugins/plugin_sched_switch.c
similarity index 100%
rename from plugins/plugin_sched_switch.c
rename to lib/traceevent/plugins/plugin_sched_switch.c
diff --git a/plugins/plugin_scsi.c b/lib/traceevent/plugins/plugin_scsi.c
similarity index 100%
rename from plugins/plugin_scsi.c
rename to lib/traceevent/plugins/plugin_scsi.c
diff --git a/plugins/plugin_tlb.c b/lib/traceevent/plugins/plugin_tlb.c
similarity index 100%
rename from plugins/plugin_tlb.c
rename to lib/traceevent/plugins/plugin_tlb.c
diff --git a/plugins/plugin_xen.c b/lib/traceevent/plugins/plugin_xen.c
similarity index 100%
rename from plugins/plugin_xen.c
rename to lib/traceevent/plugins/plugin_xen.c
