From: Alexandre Courbot <gnurou@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Is there a notification mechanism for enabled/disabled trace events?
Date: Thu, 7 Nov 2013 17:42:54 +0900 [thread overview]
Message-ID: <CAAVeFuJWKwAQ338R86O3WMarFDP2ZJDayLddGio9uXiXPsuyFA@mail.gmail.com> (raw)
Hi everyone,
Trace events can be enabled through debugfs by e.g. writing '1' into
their enable node. This is a very useful feature as some tracing
functions can introduce overhead and we only want them active when
needed.
There is one additional thing that I would need though, which is to be
notified when a given trace event is enabled or disabled.
Here is why: I have a power monitoring hardware that can report how
much power is currently used by the system. Having this information
correlated with other traces (cpufreq, cpuidle, ...) is very useful ;
it can be done by repeatedly scheduling a work that probes the power
usage and traces it. The job should only be running when the power
monitoring trace event is enabled, but AFAIK there is no way to be
notified when it is enabled or disabled. So here are a few questions:
1) Is there such a notification mechanism for trace events that I have missed?
2) If not, is there any objection to having one? I'd say my use-case
is not so uncommon and others would certainly benefit from it.
3) What would be the right place to have it? ftrace_event_reg() looks
like a good place to call a notifier chain, however I'm not sure where
the notifier head should be stored, due to my poor understanding of
ftrace.
Any answer/comments greatly appreciated!
Thanks,
Alex.
next reply other threads:[~2013-11-07 8:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-07 8:42 Alexandre Courbot [this message]
2013-11-07 14:04 ` Steven Rostedt
2013-11-10 4:17 ` Alexandre Courbot
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=CAAVeFuJWKwAQ338R86O3WMarFDP2ZJDayLddGio9uXiXPsuyFA@mail.gmail.com \
--to=gnurou@gmail.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.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®