From: Steven Rostedt <rostedt@goodmis.org>
To: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v4 2/7] kernel-shark-qt: Add Plugin event handlers to session.
Date: Thu, 20 Sep 2018 09:49:52 -0400 [thread overview]
Message-ID: <20180920094952.151f38a5@gandalf.local.home> (raw)
In-Reply-To: <b5cbf76c-38d1-0c88-d455-18ba9833dcb2@gmail.com>
On Thu, 20 Sep 2018 16:29:00 +0300
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:
> On 20.09.2018 06:24, Steven Rostedt wrote:
> >> static size_t get_records(struct kshark_context *kshark_ctx,
> >> struct rec_list ***rec_list, enum rec_type type)
> >> {
> >> + struct kshark_event_handler *evt_handler;
> >> struct event_filter *adv_filter;
> >> struct kshark_task_list *task;
> >> struct tep_record *rec;
> >> @@ -608,6 +618,17 @@ static size_t get_records(struct kshark_context *kshark_ctx,
> >>
> >> entry = &temp_rec->entry;
> >> kshark_set_entry_values(kshark_ctx, rec, entry);
> >> +
> >> + /* Execute all plugin-provided actions (if any). */
> >> + evt_handler = kshark_ctx->event_handlers;
> >> + while ((evt_handler = find_event_handler(evt_handler,
> >> + entry->event_id))) {
> >> + evt_handler->event_func(kshark_ctx, rec, entry);
> >> +
> >> + if ((evt_handler = evt_handler->next))
> > Please break the above if, to remove the assignment. It's just easier
> > to read. That is:
> >
> > event_handler = event_hanndler->next;
> > if (event_handler)
> >> + entry->visible &= ~KS_PLUGIN_UNTOUCHED_MASK;
> >> + }
> >> +
>
> Actually this is a bug (typo). I meant to have
:-)
That's actually one of the reasons the combination is looked down upon
in the Linux kernel. It's more likely to hide bugs from reviewers.
-- Steve
>
> evt_handler = evt_handler->next;
> if (!evt_handler)
> entry->visible &= ~KS_PLUGIN_UNTOUCHED_MASK;
>
> This way the KS_PLUGIN_UNTOUCHED flag gets unset only once and it is
> guaranteed that the value of the bit cannot be changed by the plugin
> callback function.
>
next prev parent reply other threads:[~2018-09-20 19:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-19 14:36 [PATCH v4 0/7] Add infrastructure for plugins Yordan Karadzhov (VMware)
2018-09-19 14:36 ` [PATCH v4 1/7] kernel-shark-qt: Add plugin infrastructure to be used by the Qt-baset KS Yordan Karadzhov (VMware)
2018-09-20 3:13 ` Steven Rostedt
2018-09-19 14:36 ` [PATCH v4 2/7] kernel-shark-qt: Add Plugin event handlers to session Yordan Karadzhov (VMware)
2018-09-20 3:24 ` Steven Rostedt
2018-09-20 13:26 ` Yordan Karadzhov (VMware)
2018-09-20 13:48 ` Steven Rostedt
2018-09-20 13:29 ` Yordan Karadzhov (VMware)
2018-09-20 13:49 ` Steven Rostedt [this message]
2018-09-19 14:36 ` [PATCH v4 3/7] kernel-shark-qt: Add C++/C conversion for args of a plugin draw function Yordan Karadzhov (VMware)
2018-09-19 14:36 ` [PATCH v4 4/7] kernel-shark-qt: Make kshark_read_at() non-static Yordan Karadzhov (VMware)
2018-09-20 3:29 ` Steven Rostedt
2018-09-19 14:36 ` [PATCH v4 5/7] kernel-shark-qt: Add src/plugins dir. to hold the source code of the plugins Yordan Karadzhov (VMware)
2018-09-19 14:36 ` [PATCH v4 6/7] kernel-shark-qt: Tell Doxygen to enter ../src/plugins/ Yordan Karadzhov (VMware)
2018-09-19 14:36 ` [PATCH v4 7/7] kernel-shark-qt: Add a plugin for sched events Yordan Karadzhov (VMware)
2018-09-20 4:11 ` 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=20180920094952.151f38a5@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=y.karadz@gmail.com \
/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).