From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Ron Rechenmacher <ron@fnal.gov>
Cc: linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH] tracing: Export key trace event symbols
Date: Fri, 24 Apr 2015 21:39:07 +0000 (UTC) [thread overview]
Message-ID: <1990679701.35944.1429911547225.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <20150424172426.016da583@gandalf.local.home>
----- Original Message -----
> On Mon, 20 Apr 2015 16:38:11 -0500
> Ron Rechenmacher <ron@fnal.gov> wrote:
>
> > If symbols are not exported, modules can no longer register additional
> > (module specified) tracepoints like they use to be able to (i.e
> > linux-3.15.x).
> > Somewhere on or about commit de7b2973903c6cc50b31ee5682a69b2219b9919d
> > (Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> > Date: Tue Apr 8 17:26:21 2014 -0400
> > tracepoint: Use struct pointer instead of name hash for reg/unreg
> > tracepoints)
> > modules which attempted to register additional tracing functions would
> > get "Unknown symbol" errors. For example: "... Unknown symbol
> > __tracepoint_sched_switch (err 0)"
> > Symbols can be exported using the kernel's EXPORT_TRACEPOINT_SYMBOL_GPL
> > macro
> > to allow modules to once again register their own tracing functions (for at
> > least some key points in the kernel as provided by this patch).
> >
> > Signed-off-by: Ron Rechenmacher <ron@fnal.gov>
> > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96051
>
> Hi Ron,
>
> I was talking with Mathieu on IRC and asked him how LTTng gets its
> kernel tracepoints, and he told me he uses
> for_each_kernel_tracepoint(). That will iterate over all tracepoints
> that have been added in the kernel (and is exported GPL).
>
> You can still use that to get the handle onto any tracepoint you need.
> It's pretty straight forward (I just wrote a simple module to test it
> out), and just compare against the tp->name, to find what you want.
>
> I still would like to get more usage out of the internal code, but this
> is your work around you wanted. No need to export new symbols. Just a
> little more setup time on module load.
Hi Ron,
Quoting a snippet of your earlier emails:
"ftrace (if one considers ltt-ng) is probably capable of doing what my trace does
except that the timestamp is not TOD (Time Of Day) -- but probably/maybe could
be made to do so???"
FYI, LTTng and Ftrace are two different projects. LTTng features
am out-of-tree kernel and a user-space tracer, whereas Ftrace features
a kernel tracer, readily available from the Linux kernel sources.
The timestamps can now be the monotonic clock for each of perf, ftrace,
and lttng, thanks to the work on nmi-safe clock source done by Thomas
Gleixner (merged in 3.17).
With the nmi-safe clocks, you'll be able to correlate samples
and traces taken by perf, ftrace, and lttng-modules with LTTng
userspace traces (LTTng-UST). This has been one of the goals of the
Common Trace Format (CTF) since its creation. You might want to look
at the perf-to-ctf conversion feature merged in Linux 4.0.
Best regards,
Mathieu
>
> -- Steve
>
> Here's my mod....
>
>
> #include <linux/module.h>
> #include <linux/ftrace.h>
> #include <linux/tracepoint.h>
>
> static func(struct tracepoint *tp, void *ignore)
> {
> printk("tracepoint: %s\n", tp->name);
> }
>
> static int __init my_tp_init(void)
> {
> for_each_kernel_tracepoint(func, NULL);
> return 0;
> }
>
> static void __exit my_tp_exit(void)
> {
> }
>
> module_init(my_tp_init);
> module_exit(my_tp_exit);
>
> MODULE_AUTHOR("My name here");
> MODULE_DESCRIPTION("Me!");
> MODULE_LICENSE("GPL");
>
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
next prev parent reply other threads:[~2015-04-24 21:39 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-20 21:38 [PATCH] tracing: Export key trace event symbols Ron Rechenmacher
2015-04-21 6:10 ` Christoph Hellwig
2015-04-21 12:04 ` Ron Rechenmacher
2015-04-21 12:19 ` Ron Rechenmacher
2015-04-21 13:38 ` Steven Rostedt
2015-04-21 12:22 ` Christoph Hellwig
2015-04-21 13:13 ` Ron Rechenmacher
2015-04-21 13:23 ` Christoph Hellwig
2015-04-21 13:26 ` Ron Rechenmacher
2015-04-21 13:53 ` Steven Rostedt
2015-04-21 15:00 ` Ron Rechenmacher
2015-04-21 15:49 ` Steven Rostedt
2015-04-21 22:23 ` Ron Rechenmacher
2015-04-21 22:44 ` Steven Rostedt
2015-04-22 2:24 ` Ron Rechenmacher
2015-04-22 12:53 ` Steven Rostedt
2015-04-22 12:55 ` Steven Rostedt
2015-04-22 14:47 ` Arnaldo Carvalho de Melo
2015-04-22 15:36 ` David Ahern
2015-04-22 15:44 ` Steven Rostedt
2015-04-22 16:35 ` Ron Rechenmacher
2015-04-22 17:00 ` Steven Rostedt
2015-04-23 15:28 ` Pawel Moll
2015-04-23 15:33 ` Pawel Moll
2015-04-21 13:31 ` Steven Rostedt
2015-04-24 21:24 ` Steven Rostedt
2015-04-24 21:39 ` Mathieu Desnoyers [this message]
2015-04-27 19:12 ` Ron Rechenmacher
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=1990679701.35944.1429911547225.JavaMail.zimbra@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ron@fnal.gov \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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