From patchwork Tue Sep 6 05:48:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 75461 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp375241qgf; Mon, 5 Sep 2016 22:49:50 -0700 (PDT) X-Received: by 10.66.189.104 with SMTP id gh8mr69139208pac.125.1473140989965; Mon, 05 Sep 2016 22:49:49 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dj4si33485187pad.195.2016.09.05.22.49.47; Mon, 05 Sep 2016 22:49:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932227AbcIFFtd (ORCPT + 27 others); Tue, 6 Sep 2016 01:49:33 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:7718 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755074AbcIFFt1 (ORCPT ); Tue, 6 Sep 2016 01:49:27 -0400 Received: from 172.24.1.137 (EHLO SZXEML424-HUB.china.huawei.com) ([172.24.1.137]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CHJ94776; Tue, 06 Sep 2016 13:49:07 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by SZXEML424-HUB.china.huawei.com (10.82.67.153) with Microsoft SMTP Server id 14.3.235.1; Tue, 6 Sep 2016 13:48:58 +0800 From: Wang Nan To: CC: , , , Wang Nan , Hou Pengyang , He Kuang , "Arnaldo Carvalho de Melo" Subject: [PATCH 1/2] perf tools: Introduce memory mapping macros in mman-fix.h Date: Tue, 6 Sep 2016 05:48:51 +0000 Message-ID: <1473140932-143524-2-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1473140932-143524-1-git-send-email-wangnan0@huawei.com> References: <1473140932-143524-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090206.57CE58D4.0057, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a51f18f84db221942041f59f33e7409b Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org tools/perf/trace/beauty/mmap.c, tools/perf/util/event.c and tools/perf/util/map.c depend on several macros in mman.h, which are lost on old systems like ubuntu 12.04. They are architecture dependened macros. Importing ./arch/*/include/uapi/asm/mman.h into tools/ is not easy because mman.h for some unusual archs (like tile) have extra dependencies. This patch introduces only required macros into mman-fix.h. Macros list is gotten from tools/perf/trace/beauty/mmap.c. This patch is gnerated using following bash script: #!/bin/bash function begin_mman_fix_header() { echo "#ifndef $1" > $2 echo "#define $1" >> $2 echo "#include " >> $2 } function finish_mman_fix_header() { echo "#endif // $1" >> $2 echo "Finish writing $2" } function build_mman_fix_header() { guard=$1 shift target=$1 shift begin_mman_fix_header $guard $target for src in $@ do if [ -f $src ] then for macro in $macros do if grep '#define[ \t]*'$macro $src > /dev/null 2>&1 then echo "#ifndef $macro" >> $target grep '#define[ \t]*'$macro $src | sed 's/[ \t]*\/\*.*$//g' >> $target echo "#endif" >> $target fi done fi done } macros=`grep ifndef tools/perf/trace/beauty/mmap.c | awk '{print $2}'` baseheader=tools/include/uapi/asm-generic/mman-fix.h build_mman_fix_header __TOOLS_UAPI_ASM_MMAN_FIX_H $baseheader include/uapi/asm-generic/mman* echo "#ifndef MAP_UNINITIALIZED" >> $baseheader echo "#define MAP_UNINITIALIZED 0x4000000" >> $baseheader echo "#endif" >> $baseheader finish_mman_fix_header __TOOLS_UAPI_ASM_MMAN_FIX_H $baseheader archs=`ls tools/arch` for arch in $archs do archheader=tools/arch/$arch/include/uapi/asm/mman-fix.h if [ ! -d tools/arch/$arch/include/uapi/asm ] then mkdir -p tools/arch/$arch/include/uapi/asm fi uppercase=`echo $arch | awk '{print toupper($0)}'` build_mman_fix_header TOOLS_ARCH_${uppercase}_UAPI_ASM_MMAN_FIX_H $archheader arch/$arch/include/uapi/asm/mman.h echo "#include " >> $archheader finish_mman_fix_header TOOLS_ARCH_${uppercase}_UAPI_ASM_MMAN_FIX_H $archheader done Signed-off-by: Wang Nan Cc: Nilay Vaish Cc: Hou Pengyang Cc: He Kuang Cc: Arnaldo Carvalho de Melo --- tools/arch/alpha/include/uapi/asm/mman-fix.h | 38 +++++++++++++++++++ tools/arch/arm/include/uapi/asm/mman-fix.h | 5 +++ tools/arch/arm64/include/uapi/asm/mman-fix.h | 5 +++ tools/arch/frv/include/uapi/asm/mman-fix.h | 5 +++ tools/arch/h8300/include/uapi/asm/mman-fix.h | 5 +++ tools/arch/hexagon/include/uapi/asm/mman-fix.h | 5 +++ tools/arch/ia64/include/uapi/asm/mman-fix.h | 5 +++ tools/arch/m32r/include/uapi/asm/mman-fix.h | 5 +++ tools/arch/microblaze/include/uapi/asm/mman-fix.h | 5 +++ tools/arch/mips/include/uapi/asm/mman-fix.h | 41 ++++++++++++++++++++ tools/arch/mn10300/include/uapi/asm/mman-fix.h | 5 +++ tools/arch/parisc/include/uapi/asm/mman-fix.h | 38 +++++++++++++++++++ tools/arch/powerpc/include/uapi/asm/mman-fix.h | 11 ++++++ tools/arch/s390/include/uapi/asm/mman-fix.h | 5 +++ tools/arch/score/include/uapi/asm/mman-fix.h | 5 +++ tools/arch/sh/include/uapi/asm/mman-fix.h | 5 +++ tools/arch/sparc/include/uapi/asm/mman-fix.h | 11 ++++++ tools/arch/tile/include/uapi/asm/mman-fix.h | 11 ++++++ tools/arch/x86/include/uapi/asm/mman-fix.h | 8 ++++ tools/arch/xtensa/include/uapi/asm/mman-fix.h | 38 +++++++++++++++++++ tools/include/uapi/asm-generic/mman-fix.h | 46 +++++++++++++++++++++++ tools/perf/MANIFEST | 2 + 22 files changed, 304 insertions(+) create mode 100644 tools/arch/alpha/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/arm/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/arm64/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/frv/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/h8300/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/hexagon/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/ia64/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/m32r/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/microblaze/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/mips/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/mn10300/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/parisc/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/powerpc/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/s390/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/score/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/sh/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/sparc/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/tile/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/x86/include/uapi/asm/mman-fix.h create mode 100644 tools/arch/xtensa/include/uapi/asm/mman-fix.h create mode 100644 tools/include/uapi/asm-generic/mman-fix.h -- 1.8.3.4 diff --git a/tools/arch/alpha/include/uapi/asm/mman-fix.h b/tools/arch/alpha/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..f807a71 --- /dev/null +++ b/tools/arch/alpha/include/uapi/asm/mman-fix.h @@ -0,0 +1,38 @@ +#ifndef TOOLS_ARCH_ALPHA_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_ALPHA_UAPI_ASM_MMAN_FIX_H +#include +#ifndef PROT_SEM +#define PROT_SEM 0x8 +#endif +#ifndef MAP_FIXED +#define MAP_FIXED 0x100 +#endif +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS 0x10 +#endif +#ifndef MAP_STACK +#define MAP_STACK 0x80000 +#endif +#ifndef MAP_HUGETLB +#define MAP_HUGETLB 0x100000 +#endif +#ifndef MADV_MERGEABLE +#define MADV_MERGEABLE 12 +#endif +#ifndef MADV_UNMERGEABLE +#define MADV_UNMERGEABLE 13 +#endif +#ifndef MADV_HUGEPAGE +#define MADV_HUGEPAGE 14 +#endif +#ifndef MADV_NOHUGEPAGE +#define MADV_NOHUGEPAGE 15 +#endif +#ifndef MADV_DONTDUMP +#define MADV_DONTDUMP 16 +#endif +#ifndef MADV_DODUMP +#define MADV_DODUMP 17 +#endif +#include +#endif // TOOLS_ARCH_ALPHA_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/arm/include/uapi/asm/mman-fix.h b/tools/arch/arm/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..a29dae1 --- /dev/null +++ b/tools/arch/arm/include/uapi/asm/mman-fix.h @@ -0,0 +1,5 @@ +#ifndef TOOLS_ARCH_ARM_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_ARM_UAPI_ASM_MMAN_FIX_H +#include +#include +#endif // TOOLS_ARCH_ARM_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/arm64/include/uapi/asm/mman-fix.h b/tools/arch/arm64/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..e50c0d1 --- /dev/null +++ b/tools/arch/arm64/include/uapi/asm/mman-fix.h @@ -0,0 +1,5 @@ +#ifndef TOOLS_ARCH_ARM64_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_ARM64_UAPI_ASM_MMAN_FIX_H +#include +#include +#endif // TOOLS_ARCH_ARM64_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/frv/include/uapi/asm/mman-fix.h b/tools/arch/frv/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..8c2eb44 --- /dev/null +++ b/tools/arch/frv/include/uapi/asm/mman-fix.h @@ -0,0 +1,5 @@ +#ifndef TOOLS_ARCH_FRV_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_FRV_UAPI_ASM_MMAN_FIX_H +#include +#include +#endif // TOOLS_ARCH_FRV_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/h8300/include/uapi/asm/mman-fix.h b/tools/arch/h8300/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..e639fe6 --- /dev/null +++ b/tools/arch/h8300/include/uapi/asm/mman-fix.h @@ -0,0 +1,5 @@ +#ifndef TOOLS_ARCH_H8300_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_H8300_UAPI_ASM_MMAN_FIX_H +#include +#include +#endif // TOOLS_ARCH_H8300_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/hexagon/include/uapi/asm/mman-fix.h b/tools/arch/hexagon/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..dda9359 --- /dev/null +++ b/tools/arch/hexagon/include/uapi/asm/mman-fix.h @@ -0,0 +1,5 @@ +#ifndef TOOLS_ARCH_HEXAGON_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_HEXAGON_UAPI_ASM_MMAN_FIX_H +#include +#include +#endif // TOOLS_ARCH_HEXAGON_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/ia64/include/uapi/asm/mman-fix.h b/tools/arch/ia64/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..1e98f36 --- /dev/null +++ b/tools/arch/ia64/include/uapi/asm/mman-fix.h @@ -0,0 +1,5 @@ +#ifndef TOOLS_ARCH_IA64_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_IA64_UAPI_ASM_MMAN_FIX_H +#include +#include +#endif // TOOLS_ARCH_IA64_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/m32r/include/uapi/asm/mman-fix.h b/tools/arch/m32r/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..74aa94d --- /dev/null +++ b/tools/arch/m32r/include/uapi/asm/mman-fix.h @@ -0,0 +1,5 @@ +#ifndef TOOLS_ARCH_M32R_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_M32R_UAPI_ASM_MMAN_FIX_H +#include +#include +#endif // TOOLS_ARCH_M32R_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/microblaze/include/uapi/asm/mman-fix.h b/tools/arch/microblaze/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..90b7a53 --- /dev/null +++ b/tools/arch/microblaze/include/uapi/asm/mman-fix.h @@ -0,0 +1,5 @@ +#ifndef TOOLS_ARCH_MICROBLAZE_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_MICROBLAZE_UAPI_ASM_MMAN_FIX_H +#include +#include +#endif // TOOLS_ARCH_MICROBLAZE_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/mips/include/uapi/asm/mman-fix.h b/tools/arch/mips/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..ef58cd7 --- /dev/null +++ b/tools/arch/mips/include/uapi/asm/mman-fix.h @@ -0,0 +1,41 @@ +#ifndef TOOLS_ARCH_MIPS_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_MIPS_UAPI_ASM_MMAN_FIX_H +#include +#ifndef PROT_SEM +#define PROT_SEM 0x10 +#endif +#ifndef MAP_FIXED +#define MAP_FIXED 0x010 +#endif +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS 0x0800 +#endif +#ifndef MAP_STACK +#define MAP_STACK 0x40000 +#endif +#ifndef MAP_HUGETLB +#define MAP_HUGETLB 0x80000 +#endif +#ifndef MADV_HWPOISON +#define MADV_HWPOISON 100 +#endif +#ifndef MADV_MERGEABLE +#define MADV_MERGEABLE 12 +#endif +#ifndef MADV_UNMERGEABLE +#define MADV_UNMERGEABLE 13 +#endif +#ifndef MADV_HUGEPAGE +#define MADV_HUGEPAGE 14 +#endif +#ifndef MADV_NOHUGEPAGE +#define MADV_NOHUGEPAGE 15 +#endif +#ifndef MADV_DONTDUMP +#define MADV_DONTDUMP 16 +#endif +#ifndef MADV_DODUMP +#define MADV_DODUMP 17 +#endif +#include +#endif // TOOLS_ARCH_MIPS_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/mn10300/include/uapi/asm/mman-fix.h b/tools/arch/mn10300/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..86a2903 --- /dev/null +++ b/tools/arch/mn10300/include/uapi/asm/mman-fix.h @@ -0,0 +1,5 @@ +#ifndef TOOLS_ARCH_MN10300_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_MN10300_UAPI_ASM_MMAN_FIX_H +#include +#include +#endif // TOOLS_ARCH_MN10300_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/parisc/include/uapi/asm/mman-fix.h b/tools/arch/parisc/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..c157a03 --- /dev/null +++ b/tools/arch/parisc/include/uapi/asm/mman-fix.h @@ -0,0 +1,38 @@ +#ifndef TOOLS_ARCH_PARISC_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_PARISC_UAPI_ASM_MMAN_FIX_H +#include +#ifndef PROT_SEM +#define PROT_SEM 0x8 +#endif +#ifndef MAP_FIXED +#define MAP_FIXED 0x04 +#endif +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS 0x10 +#endif +#ifndef MAP_STACK +#define MAP_STACK 0x40000 +#endif +#ifndef MAP_HUGETLB +#define MAP_HUGETLB 0x80000 +#endif +#ifndef MADV_MERGEABLE +#define MADV_MERGEABLE 65 +#endif +#ifndef MADV_UNMERGEABLE +#define MADV_UNMERGEABLE 66 +#endif +#ifndef MADV_HUGEPAGE +#define MADV_HUGEPAGE 67 +#endif +#ifndef MADV_NOHUGEPAGE +#define MADV_NOHUGEPAGE 68 +#endif +#ifndef MADV_DONTDUMP +#define MADV_DONTDUMP 69 +#endif +#ifndef MADV_DODUMP +#define MADV_DODUMP 70 +#endif +#include +#endif // TOOLS_ARCH_PARISC_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/powerpc/include/uapi/asm/mman-fix.h b/tools/arch/powerpc/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..4b552fa --- /dev/null +++ b/tools/arch/powerpc/include/uapi/asm/mman-fix.h @@ -0,0 +1,11 @@ +#ifndef TOOLS_ARCH_POWERPC_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_POWERPC_UAPI_ASM_MMAN_FIX_H +#include +#ifndef MAP_STACK +#define MAP_STACK 0x20000 +#endif +#ifndef MAP_HUGETLB +#define MAP_HUGETLB 0x40000 +#endif +#include +#endif // TOOLS_ARCH_POWERPC_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/s390/include/uapi/asm/mman-fix.h b/tools/arch/s390/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..d7755dd --- /dev/null +++ b/tools/arch/s390/include/uapi/asm/mman-fix.h @@ -0,0 +1,5 @@ +#ifndef TOOLS_ARCH_S390_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_S390_UAPI_ASM_MMAN_FIX_H +#include +#include +#endif // TOOLS_ARCH_S390_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/score/include/uapi/asm/mman-fix.h b/tools/arch/score/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..97ad192 --- /dev/null +++ b/tools/arch/score/include/uapi/asm/mman-fix.h @@ -0,0 +1,5 @@ +#ifndef TOOLS_ARCH_SCORE_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_SCORE_UAPI_ASM_MMAN_FIX_H +#include +#include +#endif // TOOLS_ARCH_SCORE_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/sh/include/uapi/asm/mman-fix.h b/tools/arch/sh/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..d17bca8 --- /dev/null +++ b/tools/arch/sh/include/uapi/asm/mman-fix.h @@ -0,0 +1,5 @@ +#ifndef TOOLS_ARCH_SH_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_SH_UAPI_ASM_MMAN_FIX_H +#include +#include +#endif // TOOLS_ARCH_SH_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/sparc/include/uapi/asm/mman-fix.h b/tools/arch/sparc/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..3ac4ba0 --- /dev/null +++ b/tools/arch/sparc/include/uapi/asm/mman-fix.h @@ -0,0 +1,11 @@ +#ifndef TOOLS_ARCH_SPARC_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_SPARC_UAPI_ASM_MMAN_FIX_H +#include +#ifndef MAP_STACK +#define MAP_STACK 0x20000 +#endif +#ifndef MAP_HUGETLB +#define MAP_HUGETLB 0x40000 +#endif +#include +#endif // TOOLS_ARCH_SPARC_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/tile/include/uapi/asm/mman-fix.h b/tools/arch/tile/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..105a3b0e --- /dev/null +++ b/tools/arch/tile/include/uapi/asm/mman-fix.h @@ -0,0 +1,11 @@ +#ifndef TOOLS_ARCH_TILE_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_TILE_UAPI_ASM_MMAN_FIX_H +#include +#ifndef MAP_STACK +#define MAP_STACK MAP_GROWSDOWN +#endif +#ifndef MAP_HUGETLB +#define MAP_HUGETLB 0x4000 +#endif +#include +#endif // TOOLS_ARCH_TILE_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/x86/include/uapi/asm/mman-fix.h b/tools/arch/x86/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..0cda2bf --- /dev/null +++ b/tools/arch/x86/include/uapi/asm/mman-fix.h @@ -0,0 +1,8 @@ +#ifndef TOOLS_ARCH_X86_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_X86_UAPI_ASM_MMAN_FIX_H +#include +#ifndef MAP_32BIT +#define MAP_32BIT 0x40 +#endif +#include +#endif // TOOLS_ARCH_X86_UAPI_ASM_MMAN_FIX_H diff --git a/tools/arch/xtensa/include/uapi/asm/mman-fix.h b/tools/arch/xtensa/include/uapi/asm/mman-fix.h new file mode 100644 index 0000000..9ec9051 --- /dev/null +++ b/tools/arch/xtensa/include/uapi/asm/mman-fix.h @@ -0,0 +1,38 @@ +#ifndef TOOLS_ARCH_XTENSA_UAPI_ASM_MMAN_FIX_H +#define TOOLS_ARCH_XTENSA_UAPI_ASM_MMAN_FIX_H +#include +#ifndef PROT_SEM +#define PROT_SEM 0x10 +#endif +#ifndef MAP_FIXED +#define MAP_FIXED 0x010 +#endif +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS 0x0800 +#endif +#ifndef MAP_STACK +#define MAP_STACK 0x40000 +#endif +#ifndef MAP_HUGETLB +#define MAP_HUGETLB 0x80000 +#endif +#ifndef MADV_MERGEABLE +#define MADV_MERGEABLE 12 +#endif +#ifndef MADV_UNMERGEABLE +#define MADV_UNMERGEABLE 13 +#endif +#ifndef MADV_HUGEPAGE +#define MADV_HUGEPAGE 14 +#endif +#ifndef MADV_NOHUGEPAGE +#define MADV_NOHUGEPAGE 15 +#endif +#ifndef MADV_DONTDUMP +#define MADV_DONTDUMP 16 +#endif +#ifndef MADV_DODUMP +#define MADV_DODUMP 17 +#endif +#include +#endif // TOOLS_ARCH_XTENSA_UAPI_ASM_MMAN_FIX_H diff --git a/tools/include/uapi/asm-generic/mman-fix.h b/tools/include/uapi/asm-generic/mman-fix.h new file mode 100644 index 0000000..f47eb4c --- /dev/null +++ b/tools/include/uapi/asm-generic/mman-fix.h @@ -0,0 +1,46 @@ +#ifndef __TOOLS_UAPI_ASM_MMAN_FIX_H +#define __TOOLS_UAPI_ASM_MMAN_FIX_H +#include +#ifndef PROT_SEM +#define PROT_SEM 0x8 +#endif +#ifndef MAP_FIXED +#define MAP_FIXED 0x10 +#endif +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS 0x20 +#endif +#ifndef MADV_HWPOISON +#define MADV_HWPOISON 100 +#endif +#ifndef MADV_SOFT_OFFLINE +#define MADV_SOFT_OFFLINE 101 +#endif +#ifndef MADV_MERGEABLE +#define MADV_MERGEABLE 12 +#endif +#ifndef MADV_UNMERGEABLE +#define MADV_UNMERGEABLE 13 +#endif +#ifndef MADV_HUGEPAGE +#define MADV_HUGEPAGE 14 +#endif +#ifndef MADV_NOHUGEPAGE +#define MADV_NOHUGEPAGE 15 +#endif +#ifndef MADV_DONTDUMP +#define MADV_DONTDUMP 16 +#endif +#ifndef MADV_DODUMP +#define MADV_DODUMP 17 +#endif +#ifndef MAP_STACK +#define MAP_STACK 0x20000 +#endif +#ifndef MAP_HUGETLB +#define MAP_HUGETLB 0x40000 +#endif +#ifndef MAP_UNINITIALIZED +#define MAP_UNINITIALIZED 0x4000000 +#endif +#endif // __TOOLS_UAPI_ASM_MMAN_FIX_H diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST index ff200c6..56ac24f 100644 --- a/tools/perf/MANIFEST +++ b/tools/perf/MANIFEST @@ -66,6 +66,7 @@ tools/include/linux/hash.h tools/include/linux/kernel.h tools/include/linux/list.h tools/include/linux/log2.h +tools/include/uapi/asm-generic/mman-fix.h tools/include/uapi/linux/bpf.h tools/include/uapi/linux/bpf_common.h tools/include/uapi/linux/hw_breakpoint.h @@ -80,3 +81,4 @@ tools/include/linux/err.h tools/include/linux/bitmap.h tools/include/linux/time64.h tools/arch/*/include/uapi/asm/perf_regs.h +tools/arch/*/include/uapi/asm/mman-fix.h