diff options
author | Jiri Olsa <jolsa@redhat.com> | 2013-12-03 08:09:21 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-04 13:19:35 -0500 |
commit | 3d7c0144491bd8c21d53b43032274a85efdfe434 (patch) | |
tree | c916a6cb3415685a44b61a99f52eff6450a10df3 | |
parent | f33c5cd73172c4fb81daa83a4f6d322210172fa0 (diff) |
perf tools: Add build and install plugins targets
Adding 'plugins' target along with the libtraceevent.a, so plugins are
built together with traceevent library.
Adding 'install-traceevent-plugins' Makefile install target, instructing
perf to install plugins into:
$(HOME)/.traceevent/plugins
- If installed localy under $HOME
$(DESTDIR)/$(prefix)/$(libdir)/traceevent/plugins
- If installed globally
Examples:
$ make install
...
$ find ~/.traceevent/plugins/
/home/jolsa/.traceevent/plugins/
/home/jolsa/.traceevent/plugins/plugin_mac80211.so
/home/jolsa/.traceevent/plugins/plugin_kvm.so
/home/jolsa/.traceevent/plugins/plugin_scsi.so
/home/jolsa/.traceevent/plugins/plugin_sched_switch.so
/home/jolsa/.traceevent/plugins/plugin_xen.so
/home/jolsa/.traceevent/plugins/plugin_cfg80211.so
/home/jolsa/.traceevent/plugins/plugin_function.so
/home/jolsa/.traceevent/plugins/plugin_kmem.so
/home/jolsa/.traceevent/plugins/plugin_hrtimer.so
/home/jolsa/.traceevent/plugins/plugin_jbd2.so
$ sudo make install DESTDIR=/opt/perf/
...
$ find /opt/perf/lib64/traceevent/plugins/
/opt/perf/lib64/traceevent/plugins/
/opt/perf/lib64/traceevent/plugins/plugin_kvm.so
/opt/perf/lib64/traceevent/plugins/plugin_scsi.so
/opt/perf/lib64/traceevent/plugins/plugin_mac80211.so
/opt/perf/lib64/traceevent/plugins/plugin_hrtimer.so
/opt/perf/lib64/traceevent/plugins/plugin_kmem.so
/opt/perf/lib64/traceevent/plugins/plugin_jbd2.so
/opt/perf/lib64/traceevent/plugins/plugin_sched_switch.so
/opt/perf/lib64/traceevent/plugins/plugin_function.so
/opt/perf/lib64/traceevent/plugins/plugin_cfg80211.so
/opt/perf/lib64/traceevent/plugins/plugin_xen.so
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1386076182-14484-8-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/Makefile.perf | 17 | ||||
-rw-r--r-- | tools/perf/config/Makefile | 8 |
2 files changed, 20 insertions, 5 deletions
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index e416ccc7d831..abc7ac3713ad 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf | |||
@@ -105,7 +105,7 @@ ifeq ($(config),1) | |||
105 | include config/Makefile | 105 | include config/Makefile |
106 | endif | 106 | endif |
107 | 107 | ||
108 | export prefix bindir sharedir sysconfdir | 108 | export prefix bindir sharedir sysconfdir DESTDIR |
109 | 109 | ||
110 | # sparse is architecture-neutral, which means that we need to tell it | 110 | # sparse is architecture-neutral, which means that we need to tell it |
111 | # explicitly what architecture to check for. Fix this up for yours.. | 111 | # explicitly what architecture to check for. Fix this up for yours.. |
@@ -710,13 +710,20 @@ $(LIB_FILE): $(LIB_OBJS) | |||
710 | # libtraceevent.a | 710 | # libtraceevent.a |
711 | TE_SOURCES = $(wildcard $(TRACE_EVENT_DIR)*.[ch]) | 711 | TE_SOURCES = $(wildcard $(TRACE_EVENT_DIR)*.[ch]) |
712 | 712 | ||
713 | $(LIBTRACEEVENT): $(TE_SOURCES) | 713 | LIBTRACEEVENT_FLAGS = $(QUIET_SUBDIR1) O=$(OUTPUT) |
714 | $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(QUIET_SUBDIR1) O=$(OUTPUT) CFLAGS="-g -Wall $(EXTRA_CFLAGS)" libtraceevent.a | 714 | LIBTRACEEVENT_FLAGS += CFLAGS="-g -Wall $(EXTRA_CFLAGS)" |
715 | LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) | ||
716 | |||
717 | $(LIBTRACEEVENT): $(TE_SOURCES) $(OUTPUT)PERF-CFLAGS | ||
718 | $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) libtraceevent.a plugins | ||
715 | 719 | ||
716 | $(LIBTRACEEVENT)-clean: | 720 | $(LIBTRACEEVENT)-clean: |
717 | $(call QUIET_CLEAN, libtraceevent) | 721 | $(call QUIET_CLEAN, libtraceevent) |
718 | @$(MAKE) -C $(TRACE_EVENT_DIR) O=$(OUTPUT) clean >/dev/null | 722 | @$(MAKE) -C $(TRACE_EVENT_DIR) O=$(OUTPUT) clean >/dev/null |
719 | 723 | ||
724 | install-traceevent-plugins: | ||
725 | $(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) install_plugins | ||
726 | |||
720 | LIBLK_SOURCES = $(wildcard $(LK_PATH)*.[ch]) | 727 | LIBLK_SOURCES = $(wildcard $(LK_PATH)*.[ch]) |
721 | 728 | ||
722 | # if subdir is set, we've been called from above so target has been built | 729 | # if subdir is set, we've been called from above so target has been built |
@@ -785,7 +792,7 @@ cscope: | |||
785 | 792 | ||
786 | ### Detect prefix changes | 793 | ### Detect prefix changes |
787 | TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\ | 794 | TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\ |
788 | $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) | 795 | $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):$(plugindir_SQ) |
789 | 796 | ||
790 | $(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS | 797 | $(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS |
791 | @FLAGS='$(TRACK_CFLAGS)'; \ | 798 | @FLAGS='$(TRACK_CFLAGS)'; \ |
@@ -849,7 +856,7 @@ endif | |||
849 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \ | 856 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \ |
850 | $(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr' | 857 | $(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr' |
851 | 858 | ||
852 | install: install-bin try-install-man | 859 | install: install-bin try-install-man install-traceevent-plugins |
853 | 860 | ||
854 | install-python_ext: | 861 | install-python_ext: |
855 | $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)' | 862 | $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)' |
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 0761d57e5fb6..bae10720a136 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
@@ -593,3 +593,11 @@ else | |||
593 | perfexec_instdir = $(prefix)/$(perfexecdir) | 593 | perfexec_instdir = $(prefix)/$(perfexecdir) |
594 | endif | 594 | endif |
595 | perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir)) | 595 | perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir)) |
596 | |||
597 | # If we install to $(HOME) we keep the traceevent default: | ||
598 | # $(HOME)/.traceevent/plugins | ||
599 | # Otherwise we install plugins into the global $(libdir). | ||
600 | ifdef DESTDIR | ||
601 | plugindir=$(libdir)/traceevent/plugins | ||
602 | plugindir_SQ= $(subst ','\'',$(prefix)/$(plugindir)) | ||
603 | endif | ||