LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org
Subject: [RFC][PATCH v2 7/7] trace: constify glob arguments all way up to ftrace_function_set_regexp()
Date: Fri,  6 Feb 2015 04:00:15 +0000	[thread overview]
Message-ID: <1423195215-25134-7-git-send-email-viro@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20150205224632.GW29656@ZenIV.linux.org.uk>

From: Al Viro <viro@zeniv.linux.org.uk>

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 include/linux/ftrace.h             |  8 ++++----
 kernel/trace/ftrace.c              | 14 +++++++-------
 kernel/trace/trace_events_filter.c |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 1da6029..ca33305 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -360,12 +360,12 @@ struct dyn_ftrace {
 int ftrace_force_update(void);
 int ftrace_set_filter_ip(struct ftrace_ops *ops, unsigned long ip,
 			 int remove, int reset);
-int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf,
+int ftrace_set_filter(struct ftrace_ops *ops, const unsigned char *buf,
 		       int len, int reset);
-int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf,
+int ftrace_set_notrace(struct ftrace_ops *ops, const unsigned char *buf,
 			int len, int reset);
-void ftrace_set_global_filter(unsigned char *buf, int len, int reset);
-void ftrace_set_global_notrace(unsigned char *buf, int len, int reset);
+void ftrace_set_global_filter(const unsigned char *buf, int len, int reset);
+void ftrace_set_global_notrace(const unsigned char *buf, int len, int reset);
 void ftrace_free_filter(struct ftrace_ops *ops);
 
 int register_ftrace_command(struct ftrace_func_command *cmd);
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index b5b0aca..6035c08 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3473,7 +3473,7 @@ match_records(struct ftrace_hash *hash, const char *buff,
 }
 
 static int
-ftrace_match_records(struct ftrace_hash *hash, char *buff, int len)
+ftrace_match_records(struct ftrace_hash *hash, const char *buff, int len)
 {
 	return match_records(hash, buff, len, NULL, 0);
 }
@@ -4040,7 +4040,7 @@ static void ftrace_ops_update_code(struct ftrace_ops *ops,
 }
 
 static int
-ftrace_set_hash(struct ftrace_ops *ops, unsigned char *buf, int len,
+ftrace_set_hash(struct ftrace_ops *ops, const unsigned char *buf, int len,
 		unsigned long ip, int remove, int reset, int enable)
 {
 	struct ftrace_hash **orig_hash;
@@ -4123,7 +4123,7 @@ int ftrace_set_filter_ip(struct ftrace_ops *ops, unsigned long ip,
 EXPORT_SYMBOL_GPL(ftrace_set_filter_ip);
 
 static int
-ftrace_set_regex(struct ftrace_ops *ops, unsigned char *buf, int len,
+ftrace_set_regex(struct ftrace_ops *ops, const unsigned char *buf, int len,
 		 int reset, int enable)
 {
 	return ftrace_set_hash(ops, buf, len, 0, 0, reset, enable);
@@ -4139,7 +4139,7 @@ ftrace_set_regex(struct ftrace_ops *ops, unsigned char *buf, int len,
  * Filters denote which functions should be enabled when tracing is enabled.
  * If @buf is NULL and reset is set, all functions will be enabled for tracing.
  */
-int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf,
+int ftrace_set_filter(struct ftrace_ops *ops, const unsigned char *buf,
 		       int len, int reset)
 {
 	ftrace_ops_init(ops);
@@ -4158,7 +4158,7 @@ EXPORT_SYMBOL_GPL(ftrace_set_filter);
  * is enabled. If @buf is NULL and reset is set, all functions will be enabled
  * for tracing.
  */
-int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf,
+int ftrace_set_notrace(struct ftrace_ops *ops, const unsigned char *buf,
 			int len, int reset)
 {
 	ftrace_ops_init(ops);
@@ -4174,7 +4174,7 @@ EXPORT_SYMBOL_GPL(ftrace_set_notrace);
  * Filters denote which functions should be enabled when tracing is enabled.
  * If @buf is NULL and reset is set, all functions will be enabled for tracing.
  */
-void ftrace_set_global_filter(unsigned char *buf, int len, int reset)
+void ftrace_set_global_filter(const unsigned char *buf, int len, int reset)
 {
 	ftrace_set_regex(&global_ops, buf, len, reset, 1);
 }
@@ -4190,7 +4190,7 @@ EXPORT_SYMBOL_GPL(ftrace_set_global_filter);
  * is enabled. If @buf is NULL and reset is set, all functions will be enabled
  * for tracing.
  */
-void ftrace_set_global_notrace(unsigned char *buf, int len, int reset)
+void ftrace_set_global_notrace(const unsigned char *buf, int len, int reset)
 {
 	ftrace_set_regex(&global_ops, buf, len, reset, 0);
 }
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 5cefdd8..96ce797 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -2098,7 +2098,7 @@ ftrace_function_filter_re(char *buf, int len, int *count)
 }
 
 static int ftrace_function_set_regexp(struct ftrace_ops *ops, int filter,
-				      int reset, char *re, int len)
+				      int reset, const char *re, int len)
 {
 	int ret;
 
-- 
2.1.4


  parent reply	other threads:[~2015-02-06  4:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 19:49 [RFC][PATCHES] constifying ftrace globs Al Viro
2015-02-05 19:56 ` [RFC][PATCH 1/7] trace: fix the glob match in __unregister_ftrace_function_probe() Al Viro
2015-02-05 20:43   ` Steven Rostedt
2015-02-05 22:30     ` Al Viro
2015-02-05 22:52       ` Steven Rostedt
2015-02-05 19:56 ` [RFC][PATCH 2/7] implement memmem() Al Viro
2015-02-05 19:56 ` [RFC][PATCH 3/7] trace_events_filter.c: switch to memcmp() and memmem() for matching Al Viro
2015-02-05 19:56 ` [RFC][PATCH 4/7] ftrace: switch matching to memcmp() and memmem() Al Viro
2015-02-05 19:56 ` [RFC][PATCH 5/7] trace: make filter_parse_regex() provide the length of substring to compare with Al Viro
2015-02-05 21:29   ` Steven Rostedt
2015-02-05 21:44     ` Al Viro
2015-02-05 22:07       ` Steven Rostedt
2015-02-05 22:46         ` Al Viro
2015-02-06  4:00           ` [RFC][PATCH v2 1/7] trace: fix the glob match in __unregister_ftrace_function_probe() Al Viro
2015-02-06  4:00           ` [RFC][PATCH v2 2/7] implement memmem() Al Viro
2015-02-06 16:19             ` Steven Rostedt
2015-02-06 22:30             ` Rasmus Villemoes
2015-02-06 22:55               ` Steven Rostedt
2015-02-06 23:14                 ` Rasmus Villemoes
2015-02-06  4:00           ` [RFC][PATCH v2 3/7] trace_events_filter.c: switch to memcmp() and memmem() for matching Al Viro
2015-02-06 16:24             ` Steven Rostedt
2015-02-06  4:00           ` [RFC][PATCH v2 4/7] ftrace: switch matching to memcmp() and memmem() Al Viro
2015-02-06  4:00           ` [RFC][PATCH v2 5/7] trace: make filter_parse_regex() provide the length of substring to compare with Al Viro
2015-02-06 18:55             ` Steven Rostedt
2015-02-06  4:00           ` [RFC][PATCH v2 6/7] trace: constify filter_parse_regex(), match_records(), ftrace_match() and ftrace_match_record() Al Viro
2015-02-06 18:56             ` Steven Rostedt
2015-02-06  4:00           ` Al Viro [this message]
2015-02-05 19:56 ` [RFC][PATCH " Al Viro
2015-02-05 21:31   ` Steven Rostedt
2015-02-05 19:56 ` [RFC][PATCH 7/7] trace: constify glob arguments all way up to ftrace_function_set_regexp() Al Viro
2020-01-24 23:45 ` [RFC][PATCHES] constifying ftrace globs Steven Rostedt

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=1423195215-25134-7-git-send-email-viro@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --subject='Re: [RFC][PATCH v2 7/7] trace: constify glob arguments all way up to ftrace_function_set_regexp()' \
    /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

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).