From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH v3 4/5] trace-cmd: Change plugin install directories
Date: Wed, 2 Oct 2019 14:41:51 +0300 [thread overview]
Message-ID: <20191002114152.30048-5-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20191002114152.30048-1-tz.stoyanov@gmail.com>
From: Tzvetomir Stoyanov <tstoyanov@vmware.com>
To be compliant with XDG user directory layout,
the user's plugin directory is changed from
~/.traceevent/plugins to ~/.local/lib/traceevent/plugins/
Thanks to Patrick McLean:
https://lore.kernel.org/linux-trace-devel/20190313144206.41e75cf8@patrickm/
The system plugin directory is changed from
(install_prefix)/lib/trace-cmd/plugins to (install_prefix)/lib/traceevent/plugins
This change paves the way for implementing trace-cmd specific plugins.
Suggested-by: Patrick McLean <chutzpah@gentoo.org>
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
Makefile | 16 ++++++++--------
lib/traceevent/event-plugin.c | 6 +++---
lib/traceevent/plugins/Makefile | 4 ++--
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile
index e20eced..cb5b07b 100644
--- a/Makefile
+++ b/Makefile
@@ -56,15 +56,15 @@ export img_install img_install_SQ
export DESTDIR DESTDIR_SQ
ifeq ($(prefix),$(HOME))
-plugin_dir = $(HOME)/.trace-cmd/plugins
+plugin_traceevent_dir = $(HOME)/.local/lib/traceevent/plugins
python_dir = $(HOME)/.trace-cmd/python
var_dir = $(HOME)/.trace-cmd/
else
-plugin_dir = $(libdir)/trace-cmd/plugins
+plugin_traceevent_dir = $(libdir)/traceevent/plugins
python_dir ?= $(libdir)/trace-cmd/python
-PLUGIN_DIR = -DPLUGIN_DIR="$(plugin_dir)"
+PLUGIN_DIR_TRACEEVENT = -DPLUGIN_TRACEEVENT_DIR="$(plugin_traceevent_dir)"
PYTHON_DIR = -DPYTHON_DIR="$(python_dir)"
-PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))'
+PLUGIN_DIR_TRACEEVENT_SQ = '$(subst ','\'',$(PLUGIN_DIR_TRACEEVENT))'
PYTHON_DIR_SQ = '$(subst ','\'',$(PYTHON_DIR))'
var_dir = /var
endif
@@ -72,7 +72,7 @@ endif
# Shell quotes
bindir_SQ = $(subst ','\'',$(bindir))
bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
-plugin_dir_SQ = $(subst ','\'',$(plugin_dir))
+plugin_traceevent_dir_SQ = $(subst ','\'',$(plugin_traceevent_dir))
python_dir_SQ = $(subst ','\'',$(python_dir))
VAR_DIR = -DVAR_DIR="$(var_dir)"
@@ -85,10 +85,10 @@ HELP_DIR_SQ = '$(subst ','\'',$(HELP_DIR))'
BASH_COMPLETE_DIR ?= /etc/bash_completion.d
-export PLUGIN_DIR
+export PLUGIN_DIR_TRACEEVENT
export PYTHON_DIR
export PYTHON_DIR_SQ
-export plugin_dir_SQ
+export plugin_traceevent_dir_SQ
export python_dir_SQ
export var_dir
@@ -239,7 +239,7 @@ LIBS += -laudit
endif
# Append required CFLAGS
-override CFLAGS += $(INCLUDES) $(PLUGIN_DIR_SQ) $(VAR_DIR)
+override CFLAGS += $(INCLUDES) $(PLUGIN_DIR_TRACEEVENT_SQ) $(VAR_DIR)
override CFLAGS += $(udis86-flags) $(blk-flags)
override LDFLAGS += $(udis86-ldflags)
diff --git a/lib/traceevent/event-plugin.c b/lib/traceevent/event-plugin.c
index 4fc4ee3..88cd5f0 100644
--- a/lib/traceevent/event-plugin.c
+++ b/lib/traceevent/event-plugin.c
@@ -20,7 +20,7 @@
#include "event-utils.h"
#include "trace-seq.h"
-#define LOCAL_PLUGIN_DIR ".traceevent/plugins"
+#define LOCAL_PLUGIN_DIR ".local/lib/traceevent/plugins/"
static struct registered_plugin_options {
struct registered_plugin_options *next;
@@ -579,9 +579,9 @@ void tep_load_plugins_hook(struct tep_handle *tep, const char *suffix,
* If a system plugin directory was defined,
* check that first.
*/
-#ifdef PLUGIN_DIR
+#ifdef PLUGIN_TRACEEVENT_DIR
if (!tep || !(tep->flags & TEP_DISABLE_SYS_PLUGINS))
- load_plugins_dir(tep, suffix, PLUGIN_DIR,
+ load_plugins_dir(tep, suffix, PLUGIN_TRACEEVENT_DIR,
load_plugin, data);
#endif
diff --git a/lib/traceevent/plugins/Makefile b/lib/traceevent/plugins/Makefile
index 061d919..4050019 100644
--- a/lib/traceevent/plugins/Makefile
+++ b/lib/traceevent/plugins/Makefile
@@ -53,11 +53,11 @@ $(bdir)/plugin_python_loader.so: $(bdir)/%.so: $(bdir)/%.o
PLUGINS_INSTALL = $(subst .so,.install,$(PLUGINS))
$(PLUGINS_INSTALL): $(bdir)/%.install : $(bdir)/%.so force
- $(Q)$(call do_install_data,$<,$(plugin_dir_SQ))
+ $(Q)$(call do_install_data,$<,$(plugin_traceevent_dir_SQ))
install_plugins: $(PLUGINS_INSTALL)
-# The following targets are necessary to trigger a rebuild when $(PLUGIN_DIR)
+# The following targets are necessary to trigger a rebuild when $(PLUGIN_DIR_TRACEEVENT)
# and $(PYTHON_DIR) change. Without them, a full clean build would necessary
# in order to get the binaries updated.
--
2.21.0
next prev parent reply other threads:[~2019-10-02 11:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-02 11:41 [PATCH v3 0/5] Remove redundant trace-cmd plugin handling logic Tzvetomir Stoyanov (VMware)
2019-10-02 11:41 ` [PATCH v3 1/5] trace-cmd: Move libtraceevent plugins in its own directory Tzvetomir Stoyanov (VMware)
2019-10-02 11:41 ` [PATCH v3 2/5] trace-cmd: Rename plugin_python to plugin_python_loader Tzvetomir Stoyanov (VMware)
2019-10-02 11:41 ` [PATCH v3 3/5] trace-cmd: Load libtraceevent plugins from build folder, if exists Tzvetomir Stoyanov (VMware)
2019-10-02 23:49 ` Steven Rostedt
2019-10-04 8:32 ` Tzvetomir Stoyanov
2019-10-03 0:01 ` Steven Rostedt
2019-10-02 11:41 ` Tzvetomir Stoyanov (VMware) [this message]
2019-10-02 11:41 ` [PATCH v3 5/5] trace-cmd: Add initial infrastructure for trace-cmd specific plugins Tzvetomir Stoyanov (VMware)
2019-10-03 0:12 ` Steven Rostedt
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=20191002114152.30048-5-tz.stoyanov@gmail.com \
--to=tz.stoyanov@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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).