892 lines · 29.5 KB · Text
RawDownload
include ../scripts/Makefile.include # The default target of this Makefile is...all: include config/utilities.mak # Define V to have a more verbose compile.## Define O to save output files in a separate directory.## Define ARCH as name of target architecture if you want cross-builds.## Define CROSS_COMPILE as prefix name of compiler if you want cross-builds.## Define NO_LIBPERL to disable perl script extension.## Define NO_LIBPYTHON to disable python script extension.## Define PYTHON to point to the python binary if the default# `python' is not correct; for example: PYTHON=python2## Define PYTHON_CONFIG to point to the python-config binary if# the default `$(PYTHON)-config' is not correct.## Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8## Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.## Define LDFLAGS=-static to build a static binary.## Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.## Define NO_DWARF if you do not want debug-info analysis feature at all.## Define WERROR=0 to disable treating any warnings as errors.## Define NO_NEWT if you do not want TUI support. (deprecated)## Define NO_SLANG if you do not want TUI support.## Define NO_GTK2 if you do not want GTK+ GUI support.## Define NO_DEMANGLE if you do not want C++ symbol demangling.## Define NO_LIBELF if you do not want libelf dependency (e.g. cross-builds)## Define NO_LIBUNWIND if you do not want libunwind dependency for dwarf# backtrace post unwind.## Define NO_BACKTRACE if you do not want stack backtrace debug feature## Define NO_LIBNUMA if you do not want numa perf benchmark## Define NO_LIBAUDIT if you do not want libaudit support## Define NO_LIBBIONIC if you do not want bionic support ifeq ($(srctree),)srctree := $(patsubst %/,%,$(dir $(shell pwd)))srctree := $(patsubst %/,%,$(dir $(srctree)))#$(info Determined 'srctree' to be $(srctree))endif ifneq ($(objtree),)#$(info Determined 'objtree' to be $(objtree))endif ifneq ($(OUTPUT),)#$(info Determined 'OUTPUT' to be $(OUTPUT))endif $(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD	@$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)	@touch $(OUTPUT)PERF-VERSION-FILE CC = $(CROSS_COMPILE)gccAR = $(CROSS_COMPILE)ar RM      = rm -fLN      = ln -fMKDIR   = mkdirFIND    = findINSTALL = installFLEX    = flexBISON   = bisonSTRIP   = strip LK_DIR          = $(srctree)/tools/lib/lk/TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/ # include config/Makefile by default and rule out# non-config casesconfig := 1 NON_CONFIG_TARGETS := clean TAGS tags cscope help ifdef MAKECMDGOALSifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),)  config := 0endifendif ifeq ($(config),1)include config/Makefileendif export prefix bindir sharedir sysconfdir # sparse is architecture-neutral, which means that we need to tell it# explicitly what architecture to check for. Fix this up for yours..SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ # Guard against environment variablesBUILTIN_OBJS =LIB_H =LIB_OBJS =GTK_OBJS =PYRF_OBJS =SCRIPT_SH = SCRIPT_SH += perf-archive.sh grep-libs = $(filter -l%,$(1))strip-libs = $(filter-out -l%,$(1)) ifneq ($(OUTPUT),)  TE_PATH=$(OUTPUT)ifneq ($(subdir),)  LK_PATH=$(OUTPUT)/../lib/lk/else  LK_PATH=$(OUTPUT)endifelse  TE_PATH=$(TRACE_EVENT_DIR)  LK_PATH=$(LK_DIR)endif LIBTRACEEVENT = $(TE_PATH)libtraceevent.aexport LIBTRACEEVENT LIBLK = $(LK_PATH)liblk.aexport LIBLK # python extension build directoriesPYTHON_EXTBUILD     := $(OUTPUT)python_ext_build/PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/PYTHON_EXTBUILD_TMP := $(PYTHON_EXTBUILD)tmp/export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf.so PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) $(LIBLK) $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)	$(QUIET_GEN)CFLAGS='$(CFLAGS)' $(PYTHON_WORD) util/setup.py \	  --quiet build_ext; \	mkdir -p $(OUTPUT)python && \	cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/## No Perl scripts right now:# SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) ## Single 'perf' binary right now:#PROGRAMS += $(OUTPUT)perf # what 'all' will build and 'install' will install, in perfexecdirALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) # what 'all' will build but not install in perfexecdirOTHER_PROGRAMS = $(OUTPUT)perf # Set paths to tools early so that they can be used for version tests.ifndef SHELL_PATH  SHELL_PATH = /bin/shendififndef PERL_PATH  PERL_PATH = /usr/bin/perlendif export PERL_PATH $(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c	$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c: util/parse-events.y	$(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -p parse_events_ $(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c	$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c: util/pmu.y	$(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_ $(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c LIB_FILE=$(OUTPUT)libperf.a LIB_H += ../../include/uapi/linux/perf_event.hLIB_H += ../../include/linux/rbtree.hLIB_H += ../../include/linux/list.hLIB_H += ../../include/uapi/linux/const.hLIB_H += ../../include/linux/hash.hLIB_H += ../../include/linux/stringify.hLIB_H += util/include/linux/bitmap.hLIB_H += util/include/linux/bitops.hLIB_H += util/include/linux/compiler.hLIB_H += util/include/linux/const.hLIB_H += util/include/linux/ctype.hLIB_H += util/include/linux/kernel.hLIB_H += util/include/linux/list.hLIB_H += util/include/linux/export.hLIB_H += util/include/linux/magic.hLIB_H += util/include/linux/poison.hLIB_H += util/include/linux/prefetch.hLIB_H += util/include/linux/rbtree.hLIB_H += util/include/linux/rbtree_augmented.hLIB_H += util/include/linux/string.hLIB_H += util/include/linux/types.hLIB_H += util/include/linux/linkage.hLIB_H += util/include/asm/asm-offsets.hLIB_H += util/include/asm/bug.hLIB_H += util/include/asm/byteorder.hLIB_H += util/include/asm/hweight.hLIB_H += util/include/asm/swab.hLIB_H += util/include/asm/system.hLIB_H += util/include/asm/uaccess.hLIB_H += util/include/dwarf-regs.hLIB_H += util/include/asm/dwarf2.hLIB_H += util/include/asm/cpufeature.hLIB_H += util/include/asm/unistd_32.hLIB_H += util/include/asm/unistd_64.hLIB_H += perf.hLIB_H += util/annotate.hLIB_H += util/cache.hLIB_H += util/callchain.hLIB_H += util/build-id.hLIB_H += util/debug.hLIB_H += util/fs.hLIB_H += util/pmu.hLIB_H += util/event.hLIB_H += util/evsel.hLIB_H += util/evlist.hLIB_H += util/exec_cmd.hLIB_H += util/types.hLIB_H += util/levenshtein.hLIB_H += util/machine.hLIB_H += util/map.hLIB_H += util/parse-options.hLIB_H += util/parse-events.hLIB_H += util/quote.hLIB_H += util/util.hLIB_H += util/xyarray.hLIB_H += util/header.hLIB_H += util/help.hLIB_H += util/session.hLIB_H += util/strbuf.hLIB_H += util/strlist.hLIB_H += util/strfilter.hLIB_H += util/svghelper.hLIB_H += util/tool.hLIB_H += util/run-command.hLIB_H += util/sigchain.hLIB_H += util/dso.hLIB_H += util/symbol.hLIB_H += util/color.hLIB_H += util/values.hLIB_H += util/sort.hLIB_H += util/hist.hLIB_H += util/comm.hLIB_H += util/thread.hLIB_H += util/thread_map.hLIB_H += util/trace-event.hLIB_H += util/probe-finder.hLIB_H += util/dwarf-aux.hLIB_H += util/probe-event.hLIB_H += util/pstack.hLIB_H += util/cpumap.hLIB_H += util/top.hLIB_H += $(ARCH_INCLUDE)LIB_H += util/cgroup.hLIB_H += $(LIB_INCLUDE)traceevent/event-parse.hLIB_H += util/target.hLIB_H += util/rblist.hLIB_H += util/intlist.hLIB_H += util/perf_regs.hLIB_H += util/unwind.hLIB_H += util/vdso.hLIB_H += ui/helpline.hLIB_H += ui/progress.hLIB_H += ui/util.hLIB_H += ui/ui.hLIB_H += util/data.h LIB_OBJS += $(OUTPUT)util/abspath.oLIB_OBJS += $(OUTPUT)util/alias.oLIB_OBJS += $(OUTPUT)util/annotate.oLIB_OBJS += $(OUTPUT)util/build-id.oLIB_OBJS += $(OUTPUT)util/config.oLIB_OBJS += $(OUTPUT)util/ctype.oLIB_OBJS += $(OUTPUT)util/fs.oLIB_OBJS += $(OUTPUT)util/pmu.oLIB_OBJS += $(OUTPUT)util/environment.oLIB_OBJS += $(OUTPUT)util/event.oLIB_OBJS += $(OUTPUT)util/evlist.oLIB_OBJS += $(OUTPUT)util/evsel.oLIB_OBJS += $(OUTPUT)util/exec_cmd.oLIB_OBJS += $(OUTPUT)util/help.oLIB_OBJS += $(OUTPUT)util/levenshtein.oLIB_OBJS += $(OUTPUT)util/parse-options.oLIB_OBJS += $(OUTPUT)util/parse-events.oLIB_OBJS += $(OUTPUT)util/path.oLIB_OBJS += $(OUTPUT)util/rbtree.oLIB_OBJS += $(OUTPUT)util/bitmap.oLIB_OBJS += $(OUTPUT)util/hweight.oLIB_OBJS += $(OUTPUT)util/run-command.oLIB_OBJS += $(OUTPUT)util/quote.oLIB_OBJS += $(OUTPUT)util/strbuf.oLIB_OBJS += $(OUTPUT)util/string.oLIB_OBJS += $(OUTPUT)util/strlist.oLIB_OBJS += $(OUTPUT)util/strfilter.oLIB_OBJS += $(OUTPUT)util/top.oLIB_OBJS += $(OUTPUT)util/usage.oLIB_OBJS += $(OUTPUT)util/wrapper.oLIB_OBJS += $(OUTPUT)util/sigchain.oLIB_OBJS += $(OUTPUT)util/dso.oLIB_OBJS += $(OUTPUT)util/symbol.oLIB_OBJS += $(OUTPUT)util/symbol-elf.oLIB_OBJS += $(OUTPUT)util/color.oLIB_OBJS += $(OUTPUT)util/pager.oLIB_OBJS += $(OUTPUT)util/header.oLIB_OBJS += $(OUTPUT)util/callchain.oLIB_OBJS += $(OUTPUT)util/values.oLIB_OBJS += $(OUTPUT)util/debug.oLIB_OBJS += $(OUTPUT)util/machine.oLIB_OBJS += $(OUTPUT)util/map.oLIB_OBJS += $(OUTPUT)util/pstack.oLIB_OBJS += $(OUTPUT)util/session.oLIB_OBJS += $(OUTPUT)util/comm.oLIB_OBJS += $(OUTPUT)util/thread.oLIB_OBJS += $(OUTPUT)util/thread_map.oLIB_OBJS += $(OUTPUT)util/trace-event-parse.oLIB_OBJS += $(OUTPUT)util/parse-events-flex.oLIB_OBJS += $(OUTPUT)util/parse-events-bison.oLIB_OBJS += $(OUTPUT)util/pmu-flex.oLIB_OBJS += $(OUTPUT)util/pmu-bison.oLIB_OBJS += $(OUTPUT)util/trace-event-read.oLIB_OBJS += $(OUTPUT)util/trace-event-info.oLIB_OBJS += $(OUTPUT)util/trace-event-scripting.oLIB_OBJS += $(OUTPUT)util/svghelper.oLIB_OBJS += $(OUTPUT)util/sort.oLIB_OBJS += $(OUTPUT)util/hist.oLIB_OBJS += $(OUTPUT)util/probe-event.oLIB_OBJS += $(OUTPUT)util/util.oLIB_OBJS += $(OUTPUT)util/xyarray.oLIB_OBJS += $(OUTPUT)util/cpumap.oLIB_OBJS += $(OUTPUT)util/cgroup.oLIB_OBJS += $(OUTPUT)util/target.oLIB_OBJS += $(OUTPUT)util/rblist.oLIB_OBJS += $(OUTPUT)util/intlist.oLIB_OBJS += $(OUTPUT)util/vdso.oLIB_OBJS += $(OUTPUT)util/stat.oLIB_OBJS += $(OUTPUT)util/record.oLIB_OBJS += $(OUTPUT)util/srcline.oLIB_OBJS += $(OUTPUT)util/data.o LIB_OBJS += $(OUTPUT)ui/setup.oLIB_OBJS += $(OUTPUT)ui/helpline.oLIB_OBJS += $(OUTPUT)ui/progress.oLIB_OBJS += $(OUTPUT)ui/util.oLIB_OBJS += $(OUTPUT)ui/hist.oLIB_OBJS += $(OUTPUT)ui/stdio/hist.o LIB_OBJS += $(OUTPUT)arch/common.o LIB_OBJS += $(OUTPUT)tests/parse-events.oLIB_OBJS += $(OUTPUT)tests/dso-data.oLIB_OBJS += $(OUTPUT)tests/attr.oLIB_OBJS += $(OUTPUT)tests/vmlinux-kallsyms.oLIB_OBJS += $(OUTPUT)tests/open-syscall.oLIB_OBJS += $(OUTPUT)tests/open-syscall-all-cpus.oLIB_OBJS += $(OUTPUT)tests/open-syscall-tp-fields.oLIB_OBJS += $(OUTPUT)tests/mmap-basic.oLIB_OBJS += $(OUTPUT)tests/perf-record.oLIB_OBJS += $(OUTPUT)tests/rdpmc.oLIB_OBJS += $(OUTPUT)tests/evsel-roundtrip-name.oLIB_OBJS += $(OUTPUT)tests/evsel-tp-sched.oLIB_OBJS += $(OUTPUT)tests/pmu.oLIB_OBJS += $(OUTPUT)tests/hists_link.oLIB_OBJS += $(OUTPUT)tests/python-use.oLIB_OBJS += $(OUTPUT)tests/bp_signal.oLIB_OBJS += $(OUTPUT)tests/bp_signal_overflow.oLIB_OBJS += $(OUTPUT)tests/task-exit.oLIB_OBJS += $(OUTPUT)tests/sw-clock.oifeq ($(ARCH),x86)LIB_OBJS += $(OUTPUT)tests/perf-time-to-tsc.oendifLIB_OBJS += $(OUTPUT)tests/code-reading.oLIB_OBJS += $(OUTPUT)tests/sample-parsing.oLIB_OBJS += $(OUTPUT)tests/parse-no-sample-id-all.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.oBUILTIN_OBJS += $(OUTPUT)builtin-bench.o# Benchmark modulesBUILTIN_OBJS += $(OUTPUT)bench/sched-messaging.oBUILTIN_OBJS += $(OUTPUT)bench/sched-pipe.oifeq ($(RAW_ARCH),x86_64)BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy-x86-64-asm.oBUILTIN_OBJS += $(OUTPUT)bench/mem-memset-x86-64-asm.oendifBUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.oBUILTIN_OBJS += $(OUTPUT)bench/mem-memset.o BUILTIN_OBJS += $(OUTPUT)builtin-diff.oBUILTIN_OBJS += $(OUTPUT)builtin-evlist.oBUILTIN_OBJS += $(OUTPUT)builtin-help.oBUILTIN_OBJS += $(OUTPUT)builtin-sched.oBUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.oBUILTIN_OBJS += $(OUTPUT)builtin-buildid-cache.oBUILTIN_OBJS += $(OUTPUT)builtin-list.oBUILTIN_OBJS += $(OUTPUT)builtin-record.oBUILTIN_OBJS += $(OUTPUT)builtin-report.oBUILTIN_OBJS += $(OUTPUT)builtin-stat.oBUILTIN_OBJS += $(OUTPUT)builtin-timechart.oBUILTIN_OBJS += $(OUTPUT)builtin-top.oBUILTIN_OBJS += $(OUTPUT)builtin-script.oBUILTIN_OBJS += $(OUTPUT)builtin-probe.oBUILTIN_OBJS += $(OUTPUT)builtin-kmem.oBUILTIN_OBJS += $(OUTPUT)builtin-lock.oBUILTIN_OBJS += $(OUTPUT)builtin-kvm.oBUILTIN_OBJS += $(OUTPUT)builtin-inject.oBUILTIN_OBJS += $(OUTPUT)tests/builtin-test.oBUILTIN_OBJS += $(OUTPUT)builtin-mem.o PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT) # We choose to avoid "if .. else if .. else .. endif endif"# because maintaining the nesting to match is a pain.  If# we had "elif" things would have been much nicer... -include arch/$(ARCH)/Makefile ifneq ($(OUTPUT),)  CFLAGS += -I$(OUTPUT)endif ifdef NO_LIBELFEXTLIBS := $(filter-out -lelf,$(EXTLIBS)) # Remove ELF/DWARF dependent codesLIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS))LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS))LIB_OBJS := $(filter-out $(OUTPUT)util/probe-event.o,$(LIB_OBJS))LIB_OBJS := $(filter-out $(OUTPUT)util/probe-finder.o,$(LIB_OBJS)) BUILTIN_OBJS := $(filter-out $(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS)) # Use minimal symbol handlingLIB_OBJS += $(OUTPUT)util/symbol-minimal.o else # NO_LIBELFifndef NO_DWARF  LIB_OBJS += $(OUTPUT)util/probe-finder.o  LIB_OBJS += $(OUTPUT)util/dwarf-aux.oendif # NO_DWARFendif # NO_LIBELF ifndef NO_LIBUNWIND  LIB_OBJS += $(OUTPUT)util/unwind.oendifLIB_OBJS += $(OUTPUT)tests/keep-tracking.o ifndef NO_LIBAUDIT  BUILTIN_OBJS += $(OUTPUT)builtin-trace.oendif ifndef NO_SLANG  LIB_OBJS += $(OUTPUT)ui/browser.o  LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o  LIB_OBJS += $(OUTPUT)ui/browsers/hists.o  LIB_OBJS += $(OUTPUT)ui/browsers/map.o  LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o  LIB_OBJS += $(OUTPUT)ui/tui/setup.o  LIB_OBJS += $(OUTPUT)ui/tui/util.o  LIB_OBJS += $(OUTPUT)ui/tui/helpline.o  LIB_OBJS += $(OUTPUT)ui/tui/progress.o  LIB_H += ui/tui/tui.h  LIB_H += ui/browser.h  LIB_H += ui/browsers/map.h  LIB_H += ui/keysyms.h  LIB_H += ui/libslang.hendif ifndef NO_GTK2

Lines 1–500 of 892.