Bug 16844 - Adapt to tracepoint API changes in 3.15
Summary: Adapt to tracepoint API changes in 3.15
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Josh Stone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-15 17:20 UTC by Josh Stone
Modified: 2014-05-01 20:32 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
proposed PR16844 fix (6.11 KB, patch)
2014-04-22 16:16 UTC, Josh Stone
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Stone 2014-04-15 17:20:00 UTC
The basic register_trace_foo() interface is unchanged, but that inline now uses the __tracepoint_##foo data symbol rather than a #foo string for the underlying tracepoint_probe_register() call, and not many tracepoints actually declare EXPORT_TRACEPOINT_SYMBOL[_GPL].

The new, apparently preferred, option is to use for_each_kernel_tracepoint() to iterate the built-in tracepoints, and use the new tracepoint module notifier to examine mod->tracepoints_ptrs[] for the rest.  Clients are also responsible for unregistering tracepoints in modules that are unloading.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1087623
Comment 1 Josh Stone 2014-04-22 16:16:18 UTC
Created attachment 7558 [details]
proposed PR16844 fix

This patch hides the tracepoint version adaptations in stp_tracepoint.h.  For older kernel versions, that header is sufficient.  With 3.15 we have to do extra bookkeeping ourselves, so it pulls in stp_tracepoints.c, which is borrowed almost verbatim from lttng.  It seems to work well, but we can still decide if we want to take a different approach.
Comment 2 Josh Stone 2014-05-01 20:32:13 UTC
This was fixed in systemtap 2.5, with these commits:

3ef9830ac5b1 PR16844: Initial adaptation for kernel 3.15 tracepoints
c1c2b124a44a PR16844: Use _stp_kmalloc_gfp and _stp_kfree
ede033416a20 PR16844: Direct messages to _stp_dbug
e5c509dca169 Merge branch 'jistone/pr16844'