public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/20042] New: on rawhide, tracepoint handlers have a changed function signature
@ 2016-05-03 16:29 dsmith at redhat dot com
  2016-05-03 16:59 ` [Bug runtime/20042] " dsmith at redhat dot com
  2016-05-03 18:08 ` jistone at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2016-05-03 16:29 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20042

            Bug ID: 20042
           Summary: on rawhide, tracepoint handlers have a changed
                    function signature
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: dsmith at redhat dot com
  Target Milestone: ---

On rawhide (4.6.0-0.rc5.git3.1.fc25.x86_64), it looks like the tracepoint
interface has changed, causing compilation errors with scripts that use
tracepoints:

====
# stap -v ../src/testsuite/systemtap.base/tracepoints.stp 
Pass 1: parsed user script and 113 library scripts using
241388virt/38096res/7572shr/30784data kb, in 200usr/40sys/232real ms.
Pass 2: analyzed script: 1925 probes, 1 function, 0 embeds, 1 global using
260332virt/57992res/8624shr/49728data kb, in 82200usr/19540sys/53882real ms.
Pass 3: translated to C into
"/tmp/staphWDwgS/stap_3b2a8c89bb4805ee669dd1b436014d8c_1186740_src.c" using
261868virt/59564res/8688shr/51264data kb, in 550usr/70sys/616real ms.
In file included from
/tmp/staphWDwgS/stap_3b2a8c89bb4805ee669dd1b436014d8c_1186740_aux_30.c:8:0:
/tmp/staphWDwgS/stap_3b2a8c89bb4805ee669dd1b436014d8c_1186740_aux_30.c: In
function ‘register_tracepoint_probe_1212’:
/tmp/staphWDwgS/stap_3b2a8c89bb4805ee669dd1b436014d8c_1186740_aux_30.c:27:42:
error: passing argument 1 of ‘check_trace_callback_type_cpuhp_enter’ from
incompatible pointer type [-Werror=incompatible-pointer-types]
   return STP_TRACE_REGISTER(cpuhp_enter, enter_tracepoint_probe_1212);
                                          ^
/usr/local/share/systemtap/runtime/linux/stp_tracepoint.h:45:38: note: in
definition of macro ‘STP_TRACE_REGISTER’
     check_trace_callback_type_##name(fn);   \
                                      ^~
In file included from ./arch/x86/include/asm/kvm_host.h:17:0,
                 from include/linux/kvm_host.h:36,
                 from
/tmp/staphWDwgS/stap_3b2a8c89bb4805ee669dd1b436014d8c_1186740_aux_30.c:4:
include/linux/tracepoint.h:218:2: note: expected ‘void (*)(void *, unsigned
int,  int,  int,  int (*)(unsigned int))’ but argument is of type ‘void
(*)(void *, unsigned int,  int,  int,  void *)’
  check_trace_callback_type_##name(void (*cb)(data_proto)) \
  ^
include/linux/tracepoint.h:348:2: note: in expansion of macro ‘__DECLARE_TRACE’
  __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),  \
  ^~~~~~~~~~~~~~~
include/linux/tracepoint.h:484:2: note: in expansion of macro ‘DECLARE_TRACE’
  DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
  ^~~~~~~~~~~~~
include/trace/events/cpuhp.h:9:1: note: in expansion of macro ‘TRACE_EVENT’
 TRACE_EVENT(cpuhp_enter,
 ^~~~~~~~~~~
In file included from
/tmp/staphWDwgS/stap_3b2a8c89bb4805ee669dd1b436014d8c_1186740_aux_30.c:8:0:
/tmp/staphWDwgS/stap_3b2a8c89bb4805ee669dd1b436014d8c_1186740_aux_30.c: In
function ‘unregister_tracepoint_probe_1212’:
/tmp/staphWDwgS/stap_3b2a8c89bb4805ee669dd1b436014d8c_1186740_aux_30.c:30:44:
error: passing argument 1 of ‘check_trace_callback_type_cpuhp_enter’ from
incompatible pointer type [-Werror=incompatible-pointer-types]
   (void) STP_TRACE_UNREGISTER(cpuhp_enter, enter_tracepoint_probe_1212);
                                            ^
/usr/local/share/systemtap/runtime/linux/stp_tracepoint.h:49:38: note: in
definition of macro ‘STP_TRACE_UNREGISTER’
     check_trace_callback_type_##name(fn);   \
                                      ^~
In file included from ./arch/x86/include/asm/kvm_host.h:17:0,
                 from include/linux/kvm_host.h:36,
                 from
/tmp/staphWDwgS/stap_3b2a8c89bb4805ee669dd1b436014d8c_1186740_aux_30.c:4:
include/linux/tracepoint.h:218:2: note: expected ‘void (*)(void *, unsigned
int,  int,  int,  int (*)(unsigned int))’ but argument is of type ‘void
(*)(void *, unsigned int,  int,  int,  void *)’
  check_trace_callback_type_##name(void (*cb)(data_proto)) \
  ^
include/linux/tracepoint.h:348:2: note: in expansion of macro ‘__DECLARE_TRACE’
  __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),  \
  ^~~~~~~~~~~~~~~
include/linux/tracepoint.h:484:2: note: in expansion of macro ‘DECLARE_TRACE’
  DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
  ^~~~~~~~~~~~~
include/trace/events/cpuhp.h:9:1: note: in expansion of macro ‘TRACE_EVENT’
 TRACE_EVENT(cpuhp_enter,
 ^~~~~~~~~~~
cc1: all warnings being treated as errors
scripts/Makefile.build:291: recipe for target
'/tmp/staphWDwgS/stap_3b2a8c89bb4805ee669dd1b436014d8c_1186740_aux_30.o' failed
make[1]: ***
[/tmp/staphWDwgS/stap_3b2a8c89bb4805ee669dd1b436014d8c_1186740_aux_30.o] Error
1
make[1]: *** Waiting for unfinished jobs....
Makefile:1432: recipe for target '_module_/tmp/staphWDwgS' failed
make: *** [_module_/tmp/staphWDwgS] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_3b2a8c89bb4805ee669dd1b436014d8c_1186740.ko" in
47480usr/10000sys/38954real ms.
Pass 4: compilation failed.  [man error::pass4]
====

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug runtime/20042] on rawhide, tracepoint handlers have a changed function signature
  2016-05-03 16:29 [Bug runtime/20042] New: on rawhide, tracepoint handlers have a changed function signature dsmith at redhat dot com
@ 2016-05-03 16:59 ` dsmith at redhat dot com
  2016-05-03 18:08 ` jistone at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2016-05-03 16:59 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20042

--- Comment #1 from David Smith <dsmith at redhat dot com> ---
It appears that this isn't a problem with all tracepoints, just certain ones.
The common problem might be that the tracepoints has a function pointer
argument.

In the case of the 'cpuhp_enter' tracepoint, here's what
include/trace/events/cpuhp.h has:

====
...
TRACE_EVENT(cpuhp_enter,

        TP_PROTO(unsigned int cpu,
                 int target,
                 int idx,
                 int (*fun)(unsigned int)),

        TP_ARGS(cpu, target, idx, fun),

        TP_STRUCT__entry(
                __field( unsigned int,  cpu             )
                __field( int,           target          )
                __field( int,           idx             )
                __field( void *,        fun             )
        ),
...
====

The odd thing is here that in TP_PROTO, the function pointer is declared
differently from the same function pointer in TP_STRUCT__entry. Systemtap is
declaring the handler as:

====
static STP_TRACE_ENTER(enter_tracepoint_probe_104
, unsigned int __tracepoint_arg_cpu
, int __tracepoint_arg_target
, int __tracepoint_arg_idx
, void* __tracepoint_arg_fun
)
====

which matches the TP_STRUCT__entry definition, but we might need to switch to
be more like the TP_PROTO definition.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug runtime/20042] on rawhide, tracepoint handlers have a changed function signature
  2016-05-03 16:29 [Bug runtime/20042] New: on rawhide, tracepoint handlers have a changed function signature dsmith at redhat dot com
  2016-05-03 16:59 ` [Bug runtime/20042] " dsmith at redhat dot com
@ 2016-05-03 18:08 ` jistone at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jistone at redhat dot com @ 2016-05-03 18:08 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20042

Josh Stone <jistone at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jistone at redhat dot com
           Assignee|systemtap at sourceware dot org    |jistone at redhat dot com

--- Comment #2 from Josh Stone <jistone at redhat dot com> ---
I found that dwarf_wrappers.cxx dwarf_type_name doesn't handle
DW_TAG_subroutine_type, and it treats unknowns as "void", so the function
pointer type becomes "void*".  That can be improved, but we'll also need to be
a bit more clever about the declaration since function pointer names are in the
middle of the type.  We can probably just write a typedef for each argument to
use in STP_TRACE_ENTER.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-03 18:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-03 16:29 [Bug runtime/20042] New: on rawhide, tracepoint handlers have a changed function signature dsmith at redhat dot com
2016-05-03 16:59 ` [Bug runtime/20042] " dsmith at redhat dot com
2016-05-03 18:08 ` jistone at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).