From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Tom Zanussi <zanussi@kernel.org>
Subject: [for-next][PATCH 06/12] tracing: Move is_good_name() from trace_probe.h to trace.h
Date: Wed, 14 Oct 2020 13:36:53 -0400 [thread overview]
Message-ID: <20201014173728.961779933@goodmis.org> (raw)
In-Reply-To: 20201014173647.955053902@goodmis.org
From: Tom Zanussi <zanussi@kernel.org>
is_good_name() is useful for other trace infrastructure, such as
synthetic events, so make it available via trace.h.
Link: https://lkml.kernel.org/r/cc6d6a2d7da6957fcbe1e2922e76d18d2bb459b4.1602598160.git.zanussi@kernel.org
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
kernel/trace/trace.h | 13 +++++++++++++
kernel/trace/trace_probe.h | 13 -------------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index f777bb68e660..34e0c4d5a6e7 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -19,6 +19,7 @@
#include <linux/glob.h>
#include <linux/irq_work.h>
#include <linux/workqueue.h>
+#include <linux/ctype.h>
#ifdef CONFIG_FTRACE_SYSCALLS
#include <asm/unistd.h> /* For NR_SYSCALLS */
@@ -2090,4 +2091,16 @@ static __always_inline void trace_iterator_reset(struct trace_iterator *iter)
iter->pos = -1;
}
+/* Check the name is good for event/group/fields */
+static inline bool is_good_name(const char *name)
+{
+ if (!isalpha(*name) && *name != '_')
+ return false;
+ while (*++name != '\0') {
+ if (!isalpha(*name) && !isdigit(*name) && *name != '_')
+ return false;
+ }
+ return true;
+}
+
#endif /* _LINUX_KERNEL_TRACE_H */
diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
index 04d00987da69..2f703a20c724 100644
--- a/kernel/trace/trace_probe.h
+++ b/kernel/trace/trace_probe.h
@@ -16,7 +16,6 @@
#include <linux/tracefs.h>
#include <linux/types.h>
#include <linux/string.h>
-#include <linux/ctype.h>
#include <linux/ptrace.h>
#include <linux/perf_event.h>
#include <linux/kprobes.h>
@@ -348,18 +347,6 @@ bool trace_probe_match_command_args(struct trace_probe *tp,
#define trace_probe_for_each_link_rcu(pos, tp) \
list_for_each_entry_rcu(pos, &(tp)->event->files, list)
-/* Check the name is good for event/group/fields */
-static inline bool is_good_name(const char *name)
-{
- if (!isalpha(*name) && *name != '_')
- return false;
- while (*++name != '\0') {
- if (!isalpha(*name) && !isdigit(*name) && *name != '_')
- return false;
- }
- return true;
-}
-
#define TPARG_FL_RETURN BIT(0)
#define TPARG_FL_KERNEL BIT(1)
#define TPARG_FL_FENTRY BIT(2)
--
2.28.0
next prev parent reply other threads:[~2020-10-14 17:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-14 17:36 [for-next][PATCH 00/12] tracing: Last minute updates before sending to Linus Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 01/12] tracing: Check return value of __create_val_fields() before using its result Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 02/12] tracing: Fix race in trace_open and buffer resize call Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 03/12] tracing/boot: Add ftrace.instance.*.alloc_snapshot option Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 04/12] tracing: Fix some typos in comments Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 05/12] tracing: Dont show dynamic string internals in synthetic event description Steven Rostedt
2020-10-14 17:36 ` Steven Rostedt [this message]
2020-10-14 17:36 ` [for-next][PATCH 07/12] tracing: Check that the synthetic event and field names are legal Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 08/12] tracing: Add synthetic event error logging Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 09/12] selftests/ftrace: Change synthetic event name for inter-event-combined test Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 10/12] tracing: Handle synthetic event array field type checking correctly Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 11/12] selftests/ftrace: Add test case for synthetic event syntax errors Steven Rostedt
2020-10-14 17:36 ` [for-next][PATCH 12/12] tracing: support "bool" type in synthetic trace events 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=20201014173728.961779933@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=zanussi@kernel.org \
/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).