diff options
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r-- | tools/perf/Makefile | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 147e3cf035d3..3dbb5c5bb8c6 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -177,8 +177,7 @@ endif | |||
177 | # Include saner warnings here, which can catch bugs: | 177 | # Include saner warnings here, which can catch bugs: |
178 | # | 178 | # |
179 | 179 | ||
180 | EXTRA_WARNINGS := -Wcast-align | 180 | EXTRA_WARNINGS := -Wformat |
181 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat | ||
182 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security | 181 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security |
183 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k | 182 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k |
184 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow | 183 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow |
@@ -208,7 +207,7 @@ ifndef PERF_DEBUG | |||
208 | CFLAGS_OPTIMIZE = -O6 | 207 | CFLAGS_OPTIMIZE = -O6 |
209 | endif | 208 | endif |
210 | 209 | ||
211 | CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) | 210 | CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) |
212 | LDFLAGS = -lpthread -lrt -lelf -lm | 211 | LDFLAGS = -lpthread -lrt -lelf -lm |
213 | ALL_CFLAGS = $(CFLAGS) | 212 | ALL_CFLAGS = $(CFLAGS) |
214 | ALL_LDFLAGS = $(LDFLAGS) | 213 | ALL_LDFLAGS = $(LDFLAGS) |
@@ -260,6 +259,9 @@ PTHREAD_LIBS = -lpthread | |||
260 | # explicitly what architecture to check for. Fix this up for yours.. | 259 | # explicitly what architecture to check for. Fix this up for yours.. |
261 | SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ | 260 | SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ |
262 | 261 | ||
262 | ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null >/dev/null 2>&1 && echo y"), y) | ||
263 | CFLAGS := $(CFLAGS) -fstack-protector-all | ||
264 | endif | ||
263 | 265 | ||
264 | 266 | ||
265 | ### --- END CONFIGURATION SECTION --- | 267 | ### --- END CONFIGURATION SECTION --- |
@@ -355,6 +357,7 @@ LIB_H += util/include/asm/swab.h | |||
355 | LIB_H += util/include/asm/system.h | 357 | LIB_H += util/include/asm/system.h |
356 | LIB_H += util/include/asm/uaccess.h | 358 | LIB_H += util/include/asm/uaccess.h |
357 | LIB_H += perf.h | 359 | LIB_H += perf.h |
360 | LIB_H += util/debugfs.h | ||
358 | LIB_H += util/event.h | 361 | LIB_H += util/event.h |
359 | LIB_H += util/types.h | 362 | LIB_H += util/types.h |
360 | LIB_H += util/levenshtein.h | 363 | LIB_H += util/levenshtein.h |
@@ -380,7 +383,9 @@ LIB_OBJS += util/abspath.o | |||
380 | LIB_OBJS += util/alias.o | 383 | LIB_OBJS += util/alias.o |
381 | LIB_OBJS += util/config.o | 384 | LIB_OBJS += util/config.o |
382 | LIB_OBJS += util/ctype.o | 385 | LIB_OBJS += util/ctype.o |
386 | LIB_OBJS += util/debugfs.o | ||
383 | LIB_OBJS += util/environment.o | 387 | LIB_OBJS += util/environment.o |
388 | LIB_OBJS += util/event.o | ||
384 | LIB_OBJS += util/exec_cmd.o | 389 | LIB_OBJS += util/exec_cmd.o |
385 | LIB_OBJS += util/help.o | 390 | LIB_OBJS += util/help.o |
386 | LIB_OBJS += util/levenshtein.o | 391 | LIB_OBJS += util/levenshtein.o |
@@ -417,8 +422,16 @@ LIB_OBJS += util/hist.o | |||
417 | LIB_OBJS += util/data_map.o | 422 | LIB_OBJS += util/data_map.o |
418 | 423 | ||
419 | BUILTIN_OBJS += builtin-annotate.o | 424 | BUILTIN_OBJS += builtin-annotate.o |
425 | |||
426 | BUILTIN_OBJS += builtin-bench.o | ||
427 | |||
428 | # Benchmark modules | ||
429 | BUILTIN_OBJS += bench/sched-messaging.o | ||
430 | BUILTIN_OBJS += bench/sched-pipe.o | ||
431 | |||
420 | BUILTIN_OBJS += builtin-help.o | 432 | BUILTIN_OBJS += builtin-help.o |
421 | BUILTIN_OBJS += builtin-sched.o | 433 | BUILTIN_OBJS += builtin-sched.o |
434 | BUILTIN_OBJS += builtin-buildid-list.o | ||
422 | BUILTIN_OBJS += builtin-list.o | 435 | BUILTIN_OBJS += builtin-list.o |
423 | BUILTIN_OBJS += builtin-record.o | 436 | BUILTIN_OBJS += builtin-record.o |
424 | BUILTIN_OBJS += builtin-report.o | 437 | BUILTIN_OBJS += builtin-report.o |
@@ -457,12 +470,16 @@ ifeq ($(uname_S),Darwin) | |||
457 | PTHREAD_LIBS = | 470 | PTHREAD_LIBS = |
458 | endif | 471 | endif |
459 | 472 | ||
473 | ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) | ||
460 | ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) | 474 | ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) |
461 | msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]); | 475 | msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]); |
462 | endif | 476 | endif |
463 | 477 | ||
464 | ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) | 478 | ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) |
465 | msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel); | 479 | BASIC_CFLAGS += -DLIBELF_NO_MMAP |
480 | endif | ||
481 | else | ||
482 | msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]); | ||
466 | endif | 483 | endif |
467 | 484 | ||
468 | ifneq ($(shell sh -c "(echo '\#include <libdwarf/dwarf.h>'; echo '\#include <libdwarf/libdwarf.h>'; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; Dwarf_Ranges *rng; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); dwarf_get_ranges(dbg, 0, &rng, 0, 0, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -ldwarf -lelf -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) | 485 | ifneq ($(shell sh -c "(echo '\#include <libdwarf/dwarf.h>'; echo '\#include <libdwarf/libdwarf.h>'; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; Dwarf_Ranges *rng; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); dwarf_get_ranges(dbg, 0, &rng, 0, 0, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -ldwarf -lelf -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) |