From: tip-bot for Wang Nan <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:perf/core] tools lib api fs: Add hugetlbfs filesystem detector
Date: Thu, 8 Sep 2016 22:52:08 -0700 [thread overview]
Message-ID: <tip-5e7be3e1f9d71ed03fac27df25e143815be662d2@git.kernel.org> (raw)
In-Reply-To: <1473137909-142064-3-git-send-email-wangnan0@huawei.com>
Commit-ID: 5e7be3e1f9d71ed03fac27df25e143815be662d2
Gitweb: http://git.kernel.org/tip/5e7be3e1f9d71ed03fac27df25e143815be662d2
Author: Wang Nan <wangnan0@huawei.com>
AuthorDate: Tue, 6 Sep 2016 04:58:28 +0000
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
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 <wangnan0@huawei.com>
Reviewed-by: Nilay Vaish <nilayvaish@gmail.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Hou Pengyang <houpengyang@huawei.com>
Cc: Zefan Li <lizefan@huawei.com>
Link: http://lkml.kernel.org/r/1473137909-142064-3-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
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
next prev parent reply other threads:[~2016-09-09 5:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 4:58 [PATCH v2 0/3] perf report: Recognize hugetlb mapping as anon mapping Wang Nan
2016-09-06 4:58 ` [PATCH v2 1/3] perf tools: " Wang Nan
2016-09-09 5:51 ` [tip:perf/core] " tip-bot for Wang Nan
2016-09-06 4:58 ` [PATCH v2 2/3] tools lib api fs: Add hugetlbfs filesystem detector Wang Nan
2016-09-09 5:52 ` tip-bot for Wang Nan [this message]
2016-09-06 4:58 ` [PATCH v2 3/3] perf record: Mark MAP_HUGETLB during synthesizing mmap events Wang Nan
2016-09-09 5:52 ` [tip:perf/core] perf record: Mark MAP_HUGETLB when " tip-bot for Wang Nan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-5e7be3e1f9d71ed03fac27df25e143815be662d2@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=hekuang@huawei.com \
--cc=houpengyang@huawei.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=mingo@kernel.org \
--cc=nilayvaish@gmail.com \
--cc=tglx@linutronix.de \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).