From: Mark Rutland <mark.rutland@arm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, mhiramat@kernel.org, revest@chromium.org
Subject: Re: [PATCH 2/3] ftrace: export ftrace_free_filter() to modules
Date: Tue, 3 Jan 2023 11:34:37 +0000 [thread overview]
Message-ID: <Y7QSzYIHwQVWXAjf@FVFF77S0Q05N> (raw)
In-Reply-To: <20221122165938.353ee7c0@gandalf.local.home>
On Tue, Nov 22, 2022 at 04:59:38PM -0500, Steven Rostedt wrote:
> On Thu, 3 Nov 2022 17:09:06 +0000
> Mark Rutland <mark.rutland@arm.com> wrote:
>
> FYI, the subject should start with a capital letter.
>
> ftrace: Export ftrace_free_filter() to modules
Ah; I'll fix all three patches for v2.
[...]
> > *
> > * Filters denote which functions should be enabled when tracing is enabled
> > * If @ip is NULL, it fails to update filter.
> > + *
> > + * This can allocate memory which must be freed before @ops can be freed,
> > + * either by remvoing eached filtered addr or by using
> > + * ftrace_free_filter(@ops).
> > */
> > int ftrace_set_filter_ip(struct ftrace_ops *ops, unsigned long ip,
> > int remove, int reset)
> > @@ -5856,7 +5865,11 @@ EXPORT_SYMBOL_GPL(ftrace_set_filter_ip);
> > *
> > * Filters denote which functions should be enabled when tracing is enabled
> > * If @ips array or any ip specified within is NULL , it fails to update filter.
> > - */
> > + *
> > + * This can allocate memory which must be freed before @ops can be freed,
> > + * either by remvoing eached filtered addr or by using
> > + * ftrace_free_filter(@ops).
> > +*/
> > int ftrace_set_filter_ips(struct ftrace_ops *ops, unsigned long *ips,
> > unsigned int cnt, int remove, int reset)
> > {
> > @@ -5898,6 +5911,10 @@ 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.
> > + *
> > + * This can allocate memory which must be freed before @ops can be freed,
> > + * either by remvoing eached filtered addr or by using
> > + * ftrace_free_filter(@ops).
> > */
> > int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf,
> > int len, int reset)
> > @@ -5917,6 +5934,10 @@ EXPORT_SYMBOL_GPL(ftrace_set_filter);
> > * Notrace Filters denote which functions should not be enabled when tracing
> > * is enabled. If @buf is NULL and reset is set, all functions will be enabled
> > * for tracing.
> > + *
> > + * This can allocate memory which must be freed before @ops can be freed,
> > + * either by remvoing eached filtered addr or by using
>
> I love how you cut and pasted two typos four times. ;-)
Ugh; that is the power of automation and little sleep...
I'll fix that up.
Mark.
>
> -- Steve
>
> > + * ftrace_free_filter(@ops).
> > */
> > int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf,
> > int len, int reset)
> > diff --git a/samples/ftrace/ftrace-direct-multi-modify.c b/samples/ftrace/ftrace-direct-multi-modify.c
> > index d52370cad0b6e..a825dbd2c9cfd 100644
> > --- a/samples/ftrace/ftrace-direct-multi-modify.c
> > +++ b/samples/ftrace/ftrace-direct-multi-modify.c
> > @@ -152,6 +152,7 @@ static void __exit ftrace_direct_multi_exit(void)
> > {
> > kthread_stop(simple_tsk);
> > unregister_ftrace_direct_multi(&direct, my_tramp);
> > + ftrace_free_filter(&direct);
> > }
> >
> > module_init(ftrace_direct_multi_init);
> > diff --git a/samples/ftrace/ftrace-direct-multi.c b/samples/ftrace/ftrace-direct-multi.c
> > index ec1088922517d..d955a26506053 100644
> > --- a/samples/ftrace/ftrace-direct-multi.c
> > +++ b/samples/ftrace/ftrace-direct-multi.c
> > @@ -79,6 +79,7 @@ static int __init ftrace_direct_multi_init(void)
> > static void __exit ftrace_direct_multi_exit(void)
> > {
> > unregister_ftrace_direct_multi(&direct, (unsigned long) my_tramp);
> > + ftrace_free_filter(&direct);
> > }
> >
> > module_init(ftrace_direct_multi_init);
>
next prev parent reply other threads:[~2023-01-03 11:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 17:09 [PATCH 0/3] ftrace: add sample code with dynamic ftrace_ops Mark Rutland
2022-11-03 17:09 ` [PATCH 1/3] ftrace: maintain samples/ftrace Mark Rutland
2022-11-03 17:09 ` [PATCH 2/3] ftrace: export ftrace_free_filter() to modules Mark Rutland
2022-11-22 21:59 ` Steven Rostedt
2022-11-22 22:07 ` Steven Rostedt
2023-01-03 11:34 ` Mark Rutland [this message]
2022-11-03 17:09 ` [PATCH 3/3] ftrace: add sample with custom ops Mark Rutland
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=Y7QSzYIHwQVWXAjf@FVFF77S0Q05N \
--to=mark.rutland@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=revest@chromium.org \
--cc=rostedt@goodmis.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
all inboxes | Powered by JetHome®