[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[qemu-xen staging] tracetool: carefully define SDT_USE_VARIADIC



commit 000822441e34916991f7c03217dc24f38be49e50
Author:     Stefan Hajnoczi <stefanha@xxxxxxxxxx>
AuthorDate: Wed Jul 29 16:39:26 2020 +0100
Commit:     Stefan Hajnoczi <stefanha@xxxxxxxxxx>
CommitDate: Thu Jul 30 16:02:38 2020 +0100

    tracetool: carefully define SDT_USE_VARIADIC
    
    The dtrace backend defines SDT_USE_VARIADIC as a workaround for a
    conflict with a LTTng UST header file, which requires SDT_USE_VARIADIC
    to be defined.
    
    LTTng UST <lttng/tracepoint.h> breaks if included after generated dtrace
    headers because SDT_USE_VARIADIC will already be defined:
    
      #ifdef LTTNG_UST_HAVE_SDT_INTEGRATION
      #define SDT_USE_VARIADIC <-- error, it's already defined
      #include <sys/sdt.h>
    
    Be more careful when defining SDT_USE_VARIADIC. This fixes the build
    when both the dtrace and ust tracers are enabled at the same time.
    
    Fixes: 27e08bab94f7c6ebe0b75938c98c394c969e3fd8 ("tracetool: work around 
ust <sys/sdt.h> include conflict")
    Signed-off-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
    Message-id: 20200729153926.127083-1-stefanha@xxxxxxxxxx
    Signed-off-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
---
 scripts/tracetool/backend/dtrace.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/tracetool/backend/dtrace.py 
b/scripts/tracetool/backend/dtrace.py
index b7fe4c1b50..fc0c8fc52f 100644
--- a/scripts/tracetool/backend/dtrace.py
+++ b/scripts/tracetool/backend/dtrace.py
@@ -44,11 +44,15 @@ def generate_h_begin(events, group):
     # require SDT_USE_VARIADIC to be defined. If dtrace includes <sys/sdt.h>
     # first without defining SDT_USE_VARIADIC then ust breaks because the
     # STAP_PROBEV() macro is not defined.
+    out('#ifndef SDT_USE_VARIADIC')
     out('#define SDT_USE_VARIADIC 1')
+    out('#endif')
 
     out('#include "%s"' % header,
         '')
 
+    out('#undef SDT_USE_VARIADIC')
+
     # SystemTap defines <provider>_<name>_ENABLED() but other DTrace
     # implementations might not.
     for e in events:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.