diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-10-30 15:11:59 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-10-31 08:57:52 -0400 |
commit | fbd7458db75790e37903c75be68513a4c087737c (patch) | |
tree | a5f41313e49eee36d7418a4169bd31d4fd76ec38 | |
parent | 80ee5668b8a755039ca6180c6272a6e8efee5aad (diff) |
perf beauty: Wire up the mmap flags table generator to the Makefile
Now when we run 'make -C tools/perf O=/tmp/build/perf' we end up with:
$ cat /tmp/build/perf/trace/beauty/generated/mmap_flags_array.c
static const char *mmap_flags[] = {
[ilog2(0x40) + 1] = "32BIT",
[ilog2(0x01) + 1] = "SHARED",
[ilog2(0x02) + 1] = "PRIVATE",
[ilog2(0x10) + 1] = "FIXED",
[ilog2(0x20) + 1] = "ANONYMOUS",
[ilog2(0x100000) + 1] = "FIXED_NOREPLACE",
[ilog2(0x0100) + 1] = "GROWSDOWN",
[ilog2(0x0800) + 1] = "DENYWRITE",
[ilog2(0x1000) + 1] = "EXECUTABLE",
[ilog2(0x2000) + 1] = "LOCKED",
[ilog2(0x4000) + 1] = "NORESERVE",
[ilog2(0x8000) + 1] = "POPULATE",
[ilog2(0x10000) + 1] = "NONBLOCK",
[ilog2(0x20000) + 1] = "STACK",
[ilog2(0x40000) + 1] = "HUGETLB",
[ilog2(0x80000) + 1] = "SYNC",
};
$
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-t3fn7u3tjsupio6e6vkufx9m@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/Makefile.perf | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index a31c5c29d53a..3ccb4f0bf088 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf | |||
@@ -1,4 +1,5 @@ | |||
1 | include ../scripts/Makefile.include | 1 | include ../scripts/Makefile.include |
2 | include ../scripts/Makefile.arch | ||
2 | 3 | ||
3 | # The default target of this Makefile is... | 4 | # The default target of this Makefile is... |
4 | all: | 5 | all: |
@@ -385,6 +386,8 @@ export INSTALL SHELL_PATH | |||
385 | SHELL = $(SHELL_PATH) | 386 | SHELL = $(SHELL_PATH) |
386 | 387 | ||
387 | linux_uapi_dir := $(srctree)/tools/include/uapi/linux | 388 | linux_uapi_dir := $(srctree)/tools/include/uapi/linux |
389 | asm_generic_uapi_dir := $(srctree)/tools/include/uapi/asm-generic | ||
390 | arch_asm_uapi_dir := $(srctree)/tools/arch/$(ARCH)/include/uapi/asm/ | ||
388 | 391 | ||
389 | beauty_outdir := $(OUTPUT)trace/beauty/generated | 392 | beauty_outdir := $(OUTPUT)trace/beauty/generated |
390 | beauty_ioctl_outdir := $(beauty_outdir)/ioctl | 393 | beauty_ioctl_outdir := $(beauty_outdir)/ioctl |
@@ -460,6 +463,12 @@ madvise_behavior_tbl := $(srctree)/tools/perf/trace/beauty/madvise_behavior.sh | |||
460 | $(madvise_behavior_array): $(madvise_hdr_dir)/mman-common.h $(madvise_behavior_tbl) | 463 | $(madvise_behavior_array): $(madvise_hdr_dir)/mman-common.h $(madvise_behavior_tbl) |
461 | $(Q)$(SHELL) '$(madvise_behavior_tbl)' $(madvise_hdr_dir) > $@ | 464 | $(Q)$(SHELL) '$(madvise_behavior_tbl)' $(madvise_hdr_dir) > $@ |
462 | 465 | ||
466 | mmap_flags_array := $(beauty_outdir)/mmap_flags_array.c | ||
467 | mmap_flags_tbl := $(srctree)/tools/perf/trace/beauty/mmap_flags.sh | ||
468 | |||
469 | $(mmap_flags_array): $(asm_generic_uapi_dir)/mman.h $(asm_generic_uapi_dir)/mman-common.h $(arch_asm_uapi_dir)/mman.h $(mmap_flags_tbl) | ||
470 | $(Q)$(SHELL) '$(mmap_flags_tbl)' $(asm_generic_uapi_dir) $(arch_asm_uapi_dir) > $@ | ||
471 | |||
463 | mount_flags_array := $(beauty_outdir)/mount_flags_array.c | 472 | mount_flags_array := $(beauty_outdir)/mount_flags_array.c |
464 | mount_flags_tbl := $(srctree)/tools/perf/trace/beauty/mount_flags.sh | 473 | mount_flags_tbl := $(srctree)/tools/perf/trace/beauty/mount_flags.sh |
465 | 474 | ||
@@ -583,6 +592,7 @@ prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioc | |||
583 | $(socket_ipproto_array) \ | 592 | $(socket_ipproto_array) \ |
584 | $(vhost_virtio_ioctl_array) \ | 593 | $(vhost_virtio_ioctl_array) \ |
585 | $(madvise_behavior_array) \ | 594 | $(madvise_behavior_array) \ |
595 | $(mmap_flags_array) \ | ||
586 | $(mount_flags_array) \ | 596 | $(mount_flags_array) \ |
587 | $(perf_ioctl_array) \ | 597 | $(perf_ioctl_array) \ |
588 | $(prctl_option_array) \ | 598 | $(prctl_option_array) \ |
@@ -870,6 +880,7 @@ clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clea | |||
870 | $(OUTPUT)tests/llvm-src-{base,kbuild,prologue,relocation}.c \ | 880 | $(OUTPUT)tests/llvm-src-{base,kbuild,prologue,relocation}.c \ |
871 | $(OUTPUT)pmu-events/pmu-events.c \ | 881 | $(OUTPUT)pmu-events/pmu-events.c \ |
872 | $(OUTPUT)$(madvise_behavior_array) \ | 882 | $(OUTPUT)$(madvise_behavior_array) \ |
883 | $(OUTPUT)$(mmap_flags_array) \ | ||
873 | $(OUTPUT)$(mount_flags_array) \ | 884 | $(OUTPUT)$(mount_flags_array) \ |
874 | $(OUTPUT)$(drm_ioctl_array) \ | 885 | $(OUTPUT)$(drm_ioctl_array) \ |
875 | $(OUTPUT)$(pkey_alloc_access_rights_array) \ | 886 | $(OUTPUT)$(pkey_alloc_access_rights_array) \ |