This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/13155] conflicting tracepoint headers block stap -l / stap -p4
- From: "jistone at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Wed, 05 Oct 2011 19:47:40 +0000
- Subject: [Bug translator/13155] conflicting tracepoint headers block stap -l / stap -p4
- Auto-submitted: auto-generated
- References: <bug-13155-6586@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=13155
Josh Stone <jistone at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jistone at redhat dot com
--- Comment #8 from Josh Stone <jistone at redhat dot com> 2011-10-05 19:47:40 UTC ---
If we accept that the kernel will continue creating issues like this, then
we'll need to start segregating the tracepoint registration and callbacks into
separate compile units. Those that come from the same tracepoint header could
still share, as an optimization, but they don't necessarily need to.
Our current generated code looks like this for trace("sys_enter"):
> #include <trace/events/syscalls.h>
> #ifdef DECLARE_TRACE_NOARGS
> #define STAP_TP_DATA , NULL
> #define STAP_TP_PROTO void *cb_data __attribute__ ((unused)),
> #else
> #define STAP_TP_DATA
> #define STAP_TP_PROTO
> #endif
> static void enter_tracepoint_probe_1(
> STAP_TP_PROTO
> struct pt_regs* __tracepoint_arg_regs,
> long int __tracepoint_arg_id
> )
> {
[... common entry boilerplate]
> c->marker_name = "sys_enter";
> c->probe_locals.probe_2904.__tracepoint_arg_regs = (int64_t)(intptr_t)__tracepoint_arg_regs;
> c->probe_locals.probe_2904.__tracepoint_arg_id = (int64_t)__tracepoint_arg_id;
> (*probe->ph) (c);
[... common exit boilerplate]
> }
> static int register_tracepoint_probe_1(void) {
> return register_trace_sys_enter(enter_tracepoint_probe_1 STAP_TP_DATA);
> }
> static void unregister_tracepoint_probe_1(void) {
> (void) unregister_trace_sys_enter(enter_tracepoint_probe_1 STAP_TP_DATA);
> }
The registration can easily be moved to a separate file, but enter_tracepoint
is a bit more complicated for mixing the tracepoint's typed arguments and
systemtap's context setup. We can probably just split it so the arguments are
cast to int64_t ahead of time, something like:
In stap_HASH.c:
> static void stp_enter_tracepoint_probe_1(
> int64_t __tracepoint_arg_regs,
> int64_t __tracepoint_arg_id
> )
> {
[... common entry boilerplate]
> c->marker_name = "sys_enter";
> c->probe_locals.probe_2904.__tracepoint_arg_regs = __tracepoint_arg_regs;
> c->probe_locals.probe_2904.__tracepoint_arg_id = __tracepoint_arg_id;
> (*probe->ph) (c);
[... common exit boilerplate]
> }
In stap_HASH_tracepoint_probe_1.c:
> static void enter_tracepoint_probe_1(
> STAP_TP_PROTO
> struct pt_regs* __tracepoint_arg_regs,
> long int __tracepoint_arg_id
> )
> {
> stp_enter_tracepoint_probe_1((int64_t)(intptr_t)__tracepoint_arg_regs,
> (int64_t)__tracepoint_arg_id);
> }
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.