Arnaldo Carvalho de Meloperf ui browser: Use libslang to read keyscf9580015 years agoHistory
918 lines · 29.6 KB · Makefile
RawDownload
ifeq ("$(origin O)", "command line")	OUTPUT := $(O)/endif # The default target of this Makefile is...all: include config/utilities.mak ifneq ($(OUTPUT),)# check that the output directory actually existsOUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))endif # Define V to have a more verbose compile.## 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. $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE	@$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)-include $(OUTPUT)PERF-VERSION-FILE uname_M := $(shell uname -m 2>/dev/null || echo not) ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \				  -e s/arm.*/arm/ -e s/sa110/arm/ \				  -e s/s390x/s390/ -e s/parisc64/parisc/ \				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \				  -e s/sh[234].*/sh/ ) CC = $(CROSS_COMPILE)gccAR = $(CROSS_COMPILE)ar # Additional ARCH settings for x86ifeq ($(ARCH),i386)        ARCH := x86endififeq ($(ARCH),x86_64)	ARCH := x86	IS_X86_64 := 0	ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))		IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)	endif	ifeq (${IS_X86_64}, 1)		RAW_ARCH := x86_64		ARCH_CFLAGS := -DARCH_X86_64		ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S	endifendif # Treat warnings as errors unless directed not toifneq ($(WERROR),0)	CFLAGS_WERROR := -Werrorendif ## Include saner warnings here, which can catch bugs:# EXTRA_WARNINGS := -WformatEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-securityEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2kEXTRA_WARNINGS := $(EXTRA_WARNINGS) -WshadowEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Winit-selfEXTRA_WARNINGS := $(EXTRA_WARNINGS) -WpackedEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wredundant-declsEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-aliasing=3EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-defaultEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-enumEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wno-system-headersEXTRA_WARNINGS := $(EXTRA_WARNINGS) -WundefEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wwrite-stringsEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wbad-function-castEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-declarationsEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-prototypesEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wnested-externsEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definitionEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypesEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement ifeq ("$(origin DEBUG)", "command line")  PERF_DEBUG = $(DEBUG)endififndef PERF_DEBUG  CFLAGS_OPTIMIZE = -O6endif CFLAGS = -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)EXTLIBS = -lpthread -lrt -lelf -lmALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64ALL_LDFLAGS = $(LDFLAGS)STRIP ?= strip # Among the variables below, these:#   perfexecdir#   template_dir#   mandir#   infodir#   htmldir#   ETC_PERFCONFIG (but not sysconfdir)# can be specified as a relative path some/where/else;# this is interpreted as relative to $(prefix) and "perf" at# runtime figures out where they are based on the path to the executable.# This can help installing the suite in a relocatable way. # Make the path relative to DESTDIR, not to prefixifndef DESTDIRprefix = $(HOME)endifbindir_relative = binbindir = $(prefix)/$(bindir_relative)mandir = share/maninfodir = share/infoperfexecdir = libexec/perf-coresharedir = $(prefix)/sharetemplate_dir = share/perf-core/templateshtmldir = share/doc/perf-docifeq ($(prefix),/usr)sysconfdir = /etcETC_PERFCONFIG = $(sysconfdir)/perfconfigelsesysconfdir = $(prefix)/etcETC_PERFCONFIG = etc/perfconfigendiflib = lib export prefix bindir sharedir sysconfdir RM = rm -fMKDIR = mkdirFIND = findINSTALL = install # 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__ -include config/feature-tests.mak ifeq ($(call try-cc,$(SOURCE_HELLO),-Werror -fstack-protector-all),y)	CFLAGS := $(CFLAGS) -fstack-protector-allendif ifeq ($(call try-cc,$(SOURCE_HELLO),-Werror -Wstack-protector),y)       CFLAGS := $(CFLAGS) -Wstack-protectorendif ifeq ($(call try-cc,$(SOURCE_HELLO),-Werror -Wvolatile-register-var),y)       CFLAGS := $(CFLAGS) -Wvolatile-register-varendif ### --- END CONFIGURATION SECTION --- # Those must not be GNU-specific; they are shared with perl/ which may# be built by a different compiler. (Note that this is an artifact now# but it still might be nice to keep that distinction.)BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/includeBASIC_LDFLAGS = # Guard against environment variablesBUILTIN_OBJS =LIB_H =LIB_OBJS =PYRF_OBJS =SCRIPT_SH = SCRIPT_SH += perf-archive.sh grep-libs = $(filter -l%,$(1))strip-libs = $(filter-out -l%,$(1)) $(OUTPUT)python/perf.so: $(PYRF_OBJS)	$(QUIET_GEN)CFLAGS='$(BASIC_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 LANG_BINDINGS = # 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 LIB_FILE=$(OUTPUT)libperf.a LIB_H += ../../include/linux/perf_event.hLIB_H += ../../include/linux/rbtree.hLIB_H += ../../include/linux/list.hLIB_H += ../../include/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/module.hLIB_H += util/include/linux/poison.hLIB_H += util/include/linux/prefetch.hLIB_H += util/include/linux/rbtree.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 += 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/debugfs.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/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/run-command.hLIB_H += util/sigchain.hLIB_H += util/symbol.hLIB_H += util/color.hLIB_H += util/values.hLIB_H += util/sort.hLIB_H += util/hist.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.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/debugfs.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/symbol.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/map.oLIB_OBJS += $(OUTPUT)util/pstack.oLIB_OBJS += $(OUTPUT)util/session.oLIB_OBJS += $(OUTPUT)util/thread.oLIB_OBJS += $(OUTPUT)util/thread_map.oLIB_OBJS += $(OUTPUT)util/trace-event-parse.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.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o BUILTIN_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.oendifBUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.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-test.oBUILTIN_OBJS += $(OUTPUT)builtin-inject.o PERFLIBS = $(LIB_FILE) # Files needed for the python binding, perf.so# pyrf is just an internal name needed for all those wrappers.# This has to be in sync with what is in the 'sources' variable in# tools/perf/util/setup.py PYRF_OBJS += $(OUTPUT)util/cpumap.oPYRF_OBJS += $(OUTPUT)util/ctype.oPYRF_OBJS += $(OUTPUT)util/evlist.oPYRF_OBJS += $(OUTPUT)util/evsel.oPYRF_OBJS += $(OUTPUT)util/python.oPYRF_OBJS += $(OUTPUT)util/thread_map.oPYRF_OBJS += $(OUTPUT)util/util.oPYRF_OBJS += $(OUTPUT)util/xyarray.o ## Platform specific tweaks# # 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 config.mak.autogen-include config.mak ifndef NO_DWARFFLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y)	msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);	NO_DWARF := 1endif # Dwarf supportendif # NO_DWARF -include arch/$(ARCH)/Makefile ifneq ($(OUTPUT),)	BASIC_CFLAGS += -I$(OUTPUT)endif FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y)	FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS)	ifneq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC)),y)		msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);	else		msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel);	endifendif ifneq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON)),y)	BASIC_CFLAGS += -DLIBELF_NO_MMAPendif ifndef NO_DWARFifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)	msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);else	BASIC_CFLAGS += -DDWARF_SUPPORT	EXTLIBS += -lelf -ldw	LIB_OBJS += $(OUTPUT)util/probe-finder.o	LIB_OBJS += $(OUTPUT)util/dwarf-aux.oendif # PERF_HAVE_DWARF_REGSendif # NO_DWARF ifdef NO_NEWT	BASIC_CFLAGS += -DNO_NEWT_SUPPORTelse	FLAGS_NEWT=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lnewt	ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT)),y)		msg := $(warning newt not found, disables TUI support. Please install newt-devel or libnewt-dev);		BASIC_CFLAGS += -DNO_NEWT_SUPPORT	else		# Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h		BASIC_CFLAGS += -I/usr/include/slang		EXTLIBS += -lnewt -lslang		LIB_OBJS += $(OUTPUT)util/ui/setup.o		LIB_OBJS += $(OUTPUT)util/ui/browser.o		LIB_OBJS += $(OUTPUT)util/ui/browsers/annotate.o		LIB_OBJS += $(OUTPUT)util/ui/browsers/hists.o		LIB_OBJS += $(OUTPUT)util/ui/browsers/map.o		LIB_OBJS += $(OUTPUT)util/ui/helpline.o		LIB_OBJS += $(OUTPUT)util/ui/progress.o		LIB_OBJS += $(OUTPUT)util/ui/util.o		LIB_H += util/ui/browser.h		LIB_H += util/ui/browsers/map.h		LIB_H += util/ui/helpline.h		LIB_H += util/ui/keysyms.h		LIB_H += util/ui/libslang.h		LIB_H += util/ui/progress.h		LIB_H += util/ui/util.h		LIB_H += util/ui/ui.h	endifendif ifdef NO_LIBPERL	BASIC_CFLAGS += -DNO_LIBPERLelse       PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)       PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))       PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))	PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`	FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) 	ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED)),y)		BASIC_CFLAGS += -DNO_LIBPERL	else               ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS)               EXTLIBS += $(PERL_EMBED_LIBADD)		LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o		LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o	endifendif

Lines 1–500 of 918.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t