From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752445AbcIIFwV (ORCPT ); Fri, 9 Sep 2016 01:52:21 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37342 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752105AbcIIFwT (ORCPT ); Fri, 9 Sep 2016 01:52:19 -0400 Date: Thu, 8 Sep 2016 22:52:08 -0700 From: tip-bot for Wang Nan Message-ID: Cc: linux-kernel@vger.kernel.org, nilayvaish@gmail.com, hpa@zytor.com, lizefan@huawei.com, houpengyang@huawei.com, wangnan0@huawei.com, tglx@linutronix.de, hekuang@huawei.com, acme@redhat.com, mingo@kernel.org Reply-To: houpengyang@huawei.com, wangnan0@huawei.com, lizefan@huawei.com, hpa@zytor.com, linux-kernel@vger.kernel.org, nilayvaish@gmail.com, mingo@kernel.org, acme@redhat.com, hekuang@huawei.com, tglx@linutronix.de In-Reply-To: <1473137909-142064-3-git-send-email-wangnan0@huawei.com> References: <1473137909-142064-3-git-send-email-wangnan0@huawei.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] tools lib api fs: Add hugetlbfs filesystem detector Git-Commit-ID: 5e7be3e1f9d71ed03fac27df25e143815be662d2 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 5e7be3e1f9d71ed03fac27df25e143815be662d2 Gitweb: http://git.kernel.org/tip/5e7be3e1f9d71ed03fac27df25e143815be662d2 Author: Wang Nan AuthorDate: Tue, 6 Sep 2016 04:58:28 +0000 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 8 Sep 2016 12:34:43 -0300 tools lib api fs: Add hugetlbfs filesystem detector Detect hugetlbfs. hugetlbfs__mountpoint() will be used during recording to help identifying hugetlb mmaps: which should be recognized as anon mapping. Signed-off-by: Wang Nan Reviewed-by: Nilay Vaish Cc: He Kuang Cc: Hou Pengyang Cc: Zefan Li Link: http://lkml.kernel.org/r/1473137909-142064-3-git-send-email-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/api/fs/fs.c | 15 +++++++++++++++ tools/lib/api/fs/fs.h | 1 + 2 files changed, 16 insertions(+) diff --git a/tools/lib/api/fs/fs.c b/tools/lib/api/fs/fs.c index ba7094b..f99f49e4 100644 --- a/tools/lib/api/fs/fs.c +++ b/tools/lib/api/fs/fs.c @@ -34,6 +34,10 @@ #define TRACEFS_MAGIC 0x74726163 #endif +#ifndef HUGETLBFS_MAGIC +#define HUGETLBFS_MAGIC 0x958458f6 +#endif + static const char * const sysfs__fs_known_mountpoints[] = { "/sys", 0, @@ -67,6 +71,10 @@ static const char * const tracefs__known_mountpoints[] = { 0, }; +static const char * const hugetlbfs__known_mountpoints[] = { + 0, +}; + struct fs { const char *name; const char * const *mounts; @@ -80,6 +88,7 @@ enum { FS__PROCFS = 1, FS__DEBUGFS = 2, FS__TRACEFS = 3, + FS__HUGETLBFS = 4, }; #ifndef TRACEFS_MAGIC @@ -107,6 +116,11 @@ static struct fs fs__entries[] = { .mounts = tracefs__known_mountpoints, .magic = TRACEFS_MAGIC, }, + [FS__HUGETLBFS] = { + .name = "hugetlbfs", + .mounts = hugetlbfs__known_mountpoints, + .magic = HUGETLBFS_MAGIC, + }, }; static bool fs__read_mounts(struct fs *fs) @@ -265,6 +279,7 @@ FS(sysfs, FS__SYSFS); FS(procfs, FS__PROCFS); FS(debugfs, FS__DEBUGFS); FS(tracefs, FS__TRACEFS); +FS(hugetlbfs, FS__HUGETLBFS); int filename__read_int(const char *filename, int *value) { diff --git a/tools/lib/api/fs/fs.h b/tools/lib/api/fs/fs.h index 16c9c2e..a63269f 100644 --- a/tools/lib/api/fs/fs.h +++ b/tools/lib/api/fs/fs.h @@ -21,6 +21,7 @@ FS(sysfs) FS(procfs) FS(debugfs) FS(tracefs) +FS(hugetlbfs) #undef FS