LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RFC][PATCHES] constifying ftrace globs
@ 2015-02-05 19:49 Al Viro
  2015-02-05 19:56 ` [RFC][PATCH 1/7] trace: fix the glob match in __unregister_ftrace_function_probe() Al Viro
                   ` (7 more replies)
  0 siblings, 8 replies; 31+ messages in thread
From: Al Viro @ 2015-02-05 19:49 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel

	We don't really need to NUL-terminate the substring we are
matching against; all it takes is introducing memmem(3) and using it
instead of str[n]str().

	It's not that much work - see vfs.git#ftrace_glob.  The reason
I went there is rather amusing; it all started with making do_execve()
take arrays of const strings for argv and envp.  After all, we never
change them *and* we often enough pass arrays of string literals that
way.  It exploded into a series of 75 commits, with the final ripple
being argv_split() and argv_free().  OK, turns out that ftrace is
using those as well, fortunately it's done to get arrays of regexes,
so it should be trivial to constify as well, right?  Imagine the amount of
swearing when I noticed that it *does* modify the resulting strings...

	This series deals with that problem, providing the missing prereq for
the patchbomb from hell...

	Could you review #ftrace_glob?  It's not large - seven commits,
boiling down to
 include/linux/ftrace.h             |  8 ++---
 include/linux/string.h             |  1 +
 kernel/trace/ftrace.c              | 68 ++++++++++++++++++--------------------
 kernel/trace/trace.h               |  2 +-
 kernel/trace/trace_events_filter.c | 26 +++++++++------
 lib/string.c                       | 34 ++++++++++++-------
 6 files changed, 75 insertions(+), 64 deletions(-)

Patches in followups.

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2020-01-24 23:45 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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           ` [RFC][PATCH v2 7/7] trace: constify glob arguments all way up to ftrace_function_set_regexp() Al Viro
2015-02-05 19:56 ` [RFC][PATCH 6/7] trace: constify filter_parse_regex(), match_records(), ftrace_match() and ftrace_match_record() 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

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