From: Joel Fernandes <joel@joelfernandes.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Joel Fernandes <joelaf@google.com>,
linux-kernel@vger.kernel.org, kernel-team@android.com,
Ingo Molnar <mingo@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
tglx@linutronix.de, namhyung@kernel.org,
mathieu.desnoyers@efficios.com, linux-rt-users@vger.kernel.org,
Tom Zanussi <tom.zanussi@linux.intel.com>,
peterz@infradead.org
Subject: Re: [PATCH RFC] tracing: Call triggers only if event passes filter checks
Date: Sun, 17 Jun 2018 17:15:45 -0700 [thread overview]
Message-ID: <20180618001545.GA187086@joelaf.mtv.corp.google.com> (raw)
In-Reply-To: <20180616224329.02e37ef4aee72c7d5685818e@kernel.org>
On Sat, Jun 16, 2018 at 10:43:29PM +0900, Masami Hiramatsu wrote:
> On Thu, 14 Jun 2018 18:01:13 -0700
> Joel Fernandes <joelaf@google.com> wrote:
>
> > From: "Joel Fernandes (Google)" <joel@joelfernandes.org>
> >
> > Currently, trace event triggers are called regardless of if the event
> > filter checks pass or fail. Thus if one were to enable event triggers
> > and filters at the same time, then the triggers will always be called
> > even if the filter checks didn't pass.
> >
> > This is a problem for a usecase I was experimenting with: measuring the
> > time preemption is disabled using synthetic events and dump the stack
> > using the stacktrace trigger if the total preempt off time was greater
> > than a threshold. Following are the commands for the same:
> >
> > Create synthetic event:
> >
> > echo 'preemptdisable u64 lat' >> \
> > /sys/kernel/debug/tracing/synthetic_events
> >
> > echo 'hist:keys=cpu:ts0=common_timestamp.usecs:scpu=cpu' >> \
> > /sys/kernel/debug/tracing/events/preemptirq/preempt_disable/trigger
> >
> > echo 'hist:keys=cpu:wakeup_lat=common_timestamp.usecs-$ts0:\
> > onmatch(preemptirq.preempt_disable).preemptdisable($wakeup_lat)' >> \
> > /sys/kernel/debug/tracing/events/preemptirq/preempt_enable/trigger
> >
> > Enable synthetic event:
> >
> > echo stacktrace > /sys/kernel/debug/tracing/events/synthetic/preemptdisable/trigger
> > echo 'lat > 400' > /sys/kernel/debug/tracing/events/synthetic/preemptdisable/filter
>
> Have you tried if statement as below?
>
> echo "stacktrace if lat > 400" > /sys/kernel/debug/tracing/events/synthetic/preemptdisable/trigger
>
Yes I tried this and it works, thanks!
Steven also suggested the same thing in his reply as well.
thanks,
- Joel
prev parent reply other threads:[~2018-06-18 0:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 1:01 Joel Fernandes
2018-06-15 16:16 ` Steven Rostedt
2018-06-15 18:18 ` Joel Fernandes
2018-06-16 13:43 ` Masami Hiramatsu
2018-06-18 0:15 ` Joel Fernandes [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=20180618001545.GA187086@joelaf.mtv.corp.google.com \
--to=joel@joelfernandes.org \
--cc=joelaf@google.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tom.zanussi@linux.intel.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
all inboxes | Powered by JetHome®