From: Steven Rostedt <rostedt@goodmis.org>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v2] tracing: uninline trace_trigger_soft_disabled() partly
Date: Fri, 11 Feb 2022 15:40:05 -0500 [thread overview]
Message-ID: <20220211154005.01fd3c24@gandalf.local.home> (raw)
In-Reply-To: <69ce0986a52d026d381d612801d978aa4f977460.1644563295.git.christophe.leroy@csgroup.eu>
On Fri, 11 Feb 2022 08:10:18 +0100
Christophe Leroy <christophe.leroy@csgroup.eu> wrote:
> diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
> index 70c069aef02c..dcea51fb60e2 100644
> --- a/include/linux/trace_events.h
> +++ b/include/linux/trace_events.h
> @@ -699,6 +699,8 @@ event_triggers_post_call(struct trace_event_file *file,
>
> bool trace_event_ignore_this_pid(struct trace_event_file *trace_file);
>
> +bool __trace_trigger_soft_disabled(struct trace_event_file *file);
> +
> /**
> * trace_trigger_soft_disabled - do triggers and test if soft disabled
> * @file: The file pointer of the event to test
> @@ -708,20 +710,20 @@ bool trace_event_ignore_this_pid(struct trace_event_file *trace_file);
> * triggers that require testing the fields, it will return true,
> * otherwise false.
> */
> -static inline bool
> +static __always_inline bool
> trace_trigger_soft_disabled(struct trace_event_file *file)
> {
> unsigned long eflags = file->flags;
>
> - if (!(eflags & EVENT_FILE_FL_TRIGGER_COND)) {
> - if (eflags & EVENT_FILE_FL_TRIGGER_MODE)
> - event_triggers_call(file, NULL, NULL, NULL);
> - if (eflags & EVENT_FILE_FL_SOFT_DISABLED)
> - return true;
> - if (eflags & EVENT_FILE_FL_PID_FILTER)
> - return trace_event_ignore_this_pid(file);
> - }
> - return false;
> + if (likely(!(eflags & (EVENT_FILE_FL_TRIGGER_MODE |
> + EVENT_FILE_FL_SOFT_DISABLED |
> + EVENT_FILE_FL_PID_FILTER))))
> + return false;
> +
> + if (likely(eflags & EVENT_FILE_FL_TRIGGER_COND))
> + return false;
> +
> + return __trace_trigger_soft_disabled(file);
> }
>
> #ifdef CONFIG_BPF_EVENTS
> diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
> index d00fee705f9c..55de490e25ca 100644
> --- a/kernel/trace/trace_events_trigger.c
> +++ b/kernel/trace/trace_events_trigger.c
> @@ -84,6 +84,20 @@ event_triggers_call(struct trace_event_file *file,
> }
> EXPORT_SYMBOL_GPL(event_triggers_call);
>
> +bool __trace_trigger_soft_disabled(struct trace_event_file *file)
> +{
> + unsigned long eflags = file->flags;
> +
> + if (eflags & EVENT_FILE_FL_TRIGGER_MODE)
> + event_triggers_call(file, NULL, NULL, NULL);
> + if (eflags & EVENT_FILE_FL_SOFT_DISABLED)
> + return true;
> + if (eflags & EVENT_FILE_FL_PID_FILTER)
> + return trace_event_ignore_this_pid(file);
> + return false;
> +}
> +EXPORT_SYMBOL_GPL(__trace_trigger_soft_disabled);
> +
> /**
> * event_triggers_post_call - Call 'post_triggers' for a trace event
> * @file: The trace_event_file associated with the event
> --
This version looks fine to me. I'll pull it into my queue.
Thanks!
-- Steve
prev parent reply other threads:[~2022-02-11 20:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-11 7:10 Christophe Leroy
2022-02-11 20:40 ` Steven Rostedt [this message]
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=20220211154005.01fd3c24@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=christophe.leroy@csgroup.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.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