mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jianyu Zhan <nasa4836@gmail.com>
To: mmarek@suse.cz
Cc: akpm@linux-foundation.org, michael.opdenacker@free-electrons.com,
	tkhai@yandex.ru, linux-kernel@vger.kernel.org,
	nasa4836@gmail.com
Subject: [PATCH] scripts/tags.sh: add regular expression replacement pattern for memcg
Date: Thu, 10 Apr 2014 16:11:36 +0800	[thread overview]
Message-ID: <1397117496-22616-1-git-send-email-nasa4836@gmail.com> (raw)

Currently, no regular expression replacement pattern for PageCgroug*
defined, which causes quite a few pain while reading code. Just get
rid of it.

Also, add a comment to inform people to add pattern for whatever new
flags they add.

Signed-off-by: Jianyu Zhan <nasa4836@gmail.com>
---
 include/linux/page_cgroup.h | 6 ++++++
 scripts/tags.sh             | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index 777a524..16b4f15 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -44,6 +44,12 @@ static inline void __init page_cgroup_init(void)
 struct page_cgroup *lookup_page_cgroup(struct page *page);
 struct page *lookup_cgroup_page(struct page_cgroup *pc);
 
+/*
+ * Note, whenever you add a new flag here, please add a
+ * regular expression replacement pattern in scripts/tags.sh
+ * to inform our friendly and smart tags generator.
+ */
+
 #define TESTPCGFLAG(uname, lname)			\
 static inline int PageCgroup##uname(struct page_cgroup *pc)	\
 	{ return test_bit(PCG_##lname, &pc->flags); }
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 58c4559..c0d52d1 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -171,12 +171,16 @@ exuberant()
 	--regex-c++='/PAGEFLAG\(([^,)]*).*/ClearPage\1/'		\
 	--regex-c++='/TESTSETFLAG\(([^,)]*).*/TestSetPage\1/'		\
 	--regex-c++='/TESTPAGEFLAG\(([^,)]*).*/Page\1/'			\
+	--regex-c++='/TESTPCGFLAG\(([^,)]*).*/PageCgroup\1/'		\
 	--regex-c++='/SETPAGEFLAG\(([^,)]*).*/SetPage\1/'		\
 	--regex-c++='/__SETPAGEFLAG\(([^,)]*).*/__SetPage\1/'		\
+	--regex-c++='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/'		\
 	--regex-c++='/TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/'	\
 	--regex-c++='/__TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/'	\
+	--regex-c++='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \
 	--regex-c++='/CLEARPAGEFLAG\(([^,)]*).*/ClearPage\1/'		\
 	--regex-c++='/__CLEARPAGEFLAG\(([^,)]*).*/__ClearPage\1/'	\
+	--regex-c++='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/'	\
 	--regex-c++='/__PAGEFLAG\(([^,)]*).*/__SetPage\1/'		\
 	--regex-c++='/__PAGEFLAG\(([^,)]*).*/__ClearPage\1/'		\
 	--regex-c++='/PAGEFLAG_FALSE\(([^,)]*).*/Page\1/'		\
@@ -229,12 +233,16 @@ emacs()
 	--regex='/PAGEFLAG(\([^,)]*\).*/ClearPage\1/'		\
 	--regex='/TESTSETFLAG(\([^,)]*\).*/TestSetPage\1/'	\
 	--regex='/TESTPAGEFLAG(\([^,)]*\).*/Page\1/'		\
+	--regex='/TESTPCGFLAG\(([^,)]*).*/PageCgroup\1/'	\
 	--regex='/SETPAGEFLAG(\([^,)]*\).*/SetPage\1/'		\
 	--regex='/__SETPAGEFLAG(\([^,)]*\).*/__SetPage\1/'	\
+	--regex='/SETPCGFLAG\(([^,)]*).*/SetPageCgroup\1/'	\
 	--regex='/TESTCLEARFLAG(\([^,)]*\).*/TestClearPage\1/'	\
 	--regex='/__TESTCLEARFLAG(\([^,)]*\).*/TestClearPage\1/'	\
+	--regex='/TESTCLEARPCGFLAG\(([^,)]*).*/TestClearPageCgroup\1/' \
 	--regex='/CLEARPAGEFLAG(\([^,)]*\).*/ClearPage\1/'	\
 	--regex='/__CLEARPAGEFLAG(\([^,)]*\).*/__ClearPage\1/'	\
+	--regex='/CLEARPCGFLAG\(([^,)]*).*/ClearPageCgroup\1/'	\
 	--regex='/__PAGEFLAG(\([^,)]*\).*/__SetPage\1/'		\
 	--regex='/__PAGEFLAG(\([^,)]*\).*/__ClearPage\1/'	\
 	--regex='/PAGEFLAG_FALSE(\([^,)]*\).*/Page\1/'		\
-- 
1.9.0.GIT


             reply	other threads:[~2014-04-10  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10  8:11 Jianyu Zhan [this message]
2014-04-10 12:58 Jianyu Zhan
2014-04-16 21:24 ` Michal Marek
2014-04-17 13:37 Jianyu Zhan
2014-05-13 13:26 Jianyu Zhan
2014-05-14 11:50 ` Michal Marek

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=1397117496-22616-1-git-send-email-nasa4836@gmail.com \
    --to=nasa4836@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.opdenacker@free-electrons.com \
    --cc=mmarek@suse.cz \
    --cc=tkhai@yandex.ru \
    /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

all inboxes | Powered by JetHome®