Skip to content

Commit d0e7b85

Browse files
Steven Rostedtfweisbec
authored andcommitted
perf: Build libtraceevent.a
Have building perf also build libtraceevent.a. Currently, perf does not use the code within libtraceevent.a, but it soon will. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Arun Sharma <asharma@fb.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
1 parent f7d8235 commit d0e7b85

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎tools/perf/Makefile‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ $(OUTPUT)python/perf.so: $(PYRF_OBJS) $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
178178

179179
SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
180180

181+
EVENT_PARSE_DIR = ../lib/traceevent/
182+
LIBTRACEEVENT = $(OUTPUT)$(EVENT_PARSE_DIR)libtraceevent.a
183+
181184
#
182185
# Single 'perf' binary right now:
183186
#
@@ -301,6 +304,7 @@ LIB_H += util/cpumap.h
301304
LIB_H += util/top.h
302305
LIB_H += $(ARCH_INCLUDE)
303306
LIB_H += util/cgroup.h
307+
LIB_H += $(EVENT_PARSE_DIR)event-parse.h
304308

305309
LIB_OBJS += $(OUTPUT)util/abspath.o
306310
LIB_OBJS += $(OUTPUT)util/alias.o
@@ -695,7 +699,7 @@ $(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
695699
'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
696700
$(ALL_CFLAGS) -c $(filter %.c,$^) -o $@
697701

698-
$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
702+
$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) $(LIBTRACEEVENT)
699703
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \
700704
$(BUILTIN_OBJS) $(LIBS) -o $@
701705

@@ -801,6 +805,10 @@ $(sort $(dir $(DIRECTORY_DEPS))):
801805
$(LIB_FILE): $(LIB_OBJS)
802806
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
803807

808+
# libparsevent.a
809+
$(LIBTRACEEVENT):
810+
make -C $(EVENT_PARSE_DIR) $(COMMAND_O) libtraceevent.a
811+
804812
help:
805813
@echo 'Perf make targets:'
806814
@echo ' doc - make *all* documentation (see below)'

‎tools/scripts/Makefile.include‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ifeq ("$(origin O)", "command line")
22
OUTPUT := $(O)/
3+
COMMAND_O := O=$(O)
34
endif
45

56
ifneq ($(OUTPUT),)

0 commit comments

Comments
 (0)