From: Miroslav Benes <mbenes@suse.cz>
To: Petr Mladek <pmladek@suse.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
jikos@kernel.org, joe.lawrence@redhat.com, jpoimboe@redhat.com,
mingo@redhat.com, linux-kernel@vger.kernel.org,
live-patching@vger.kernel.org
Subject: Re: [PATCH v2] ftrace: Introduce PERMANENT ftrace_ops flag
Date: Tue, 15 Oct 2019 12:50:59 +0200 (CEST) [thread overview]
Message-ID: <alpine.LSU.2.21.1910151244550.30206@pobox.suse.cz> (raw)
In-Reply-To: <20191015074540.bxehllisibls3kk7@pathway.suse.cz>
On Tue, 15 Oct 2019, Petr Mladek wrote:
> On Mon 2019-10-14 11:17:19, Steven Rostedt wrote:
> > On Mon, 14 Oct 2019 12:59:23 +0200
> > Miroslav Benes <mbenes@suse.cz> wrote:
> >
> > > int
> > > ftrace_enable_sysctl(struct ctl_table *table, int write,
> > > void __user *buffer, size_t *lenp,
> > > @@ -6740,8 +6754,6 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
> > > if (ret || !write || (last_ftrace_enabled == !!ftrace_enabled))
> > > goto out;
> > >
> > > - last_ftrace_enabled = !!ftrace_enabled;
> > > -
> > > if (ftrace_enabled) {
> > >
> > > /* we are starting ftrace again */
> > > @@ -6752,12 +6764,19 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
> > > ftrace_startup_sysctl();
> > >
> > > } else {
> > > + if (is_permanent_ops_registered()) {
> > > + ftrace_enabled = last_ftrace_enabled;
> >
> > Although this is not incorrect, but may be somewhat confusing.
> >
> > At this location, last_ftrace_enabled is always true.
> >
> > I'm thinking this would be better to simply set it to false here.
>
> IMHO, we want to set ftrace_enabled = true here.
>
> It was set to "false" by writing to the sysfs file. But the change
> gets rejected. ftrace will stay enabled. So, we should set
> the value back to "true".
That's correct.
I can make it explicit as proposed. I just thought that 'ftrace_enabled =
last_ftrace_enabled' was clear enough given Petr's explanation.
> > > + ret = -EBUSY;
> > > + goto out;
> > > + }
> > > +
> > > /* stopping ftrace calls (just send to ftrace_stub) */
> > > ftrace_trace_function = ftrace_stub;
> > >
> > > ftrace_shutdown_sysctl();
> > > }
> > >
> > > + last_ftrace_enabled = !!ftrace_enabled;
> > > out:
> >
> > And move the assignment of last_ftrace_enabled to after the "out:"
> > label.
>
> This change might make sense anyway. But it is not strictly necessary
> from my POV.
If it stays before "out:" label, last_ftrace_enabled is set if and only if
it has to be set. I think it is better, but I can, of course, move it in
v3 if Steven prefers it.
Thanks
Miroslav
next prev parent reply other threads:[~2019-10-15 10:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-14 10:59 Miroslav Benes
2019-10-14 14:26 ` Petr Mladek
2019-10-14 15:17 ` Steven Rostedt
2019-10-15 7:45 ` Petr Mladek
2019-10-15 10:50 ` Miroslav Benes [this message]
2019-10-15 13:36 ` Steven Rostedt
2019-10-14 22:31 ` Joe Lawrence
2019-10-15 11:23 ` Miroslav Benes
2019-10-15 13:25 ` Joe Lawrence
2019-10-15 14:02 ` Miroslav Benes
2019-10-15 14:58 ` Joe Lawrence
2019-10-16 5:02 ` Kamalesh Babulal
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=alpine.LSU.2.21.1910151244550.30206@pobox.suse.cz \
--to=mbenes@suse.cz \
--cc=jikos@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pmladek@suse.com \
--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®