]> sourceware.org Git - systemtap.git/commitdiff
PR12137: Separate the .stapsdt.base logic from probe asm
authorJosh Stone <jistone@redhat.com>
Wed, 20 Oct 2010 22:03:49 +0000 (15:03 -0700)
committerJosh Stone <jistone@redhat.com>
Wed, 20 Oct 2010 22:03:49 +0000 (15:03 -0700)
This splits the SDT probes into two __asm__ statements, one for the
probe itself, and the other for logic to prepare the .stapsdt.base
section.  This avoids having a string literal that is too long for
-pedantic compilation (max length 509).

* includes/sys/sdt.h: Define _SDT_ASM_BASE for .stapsdt.base logic,
  separate from _SDT_ASM_BODY, and add to _SDT_PROBE and STAP_PROBE_ASM.

includes/sys/sdt.h

index fbb0e52e30a689d5133d9469d2bbd9543f63de5e..ce175da16fc2e3900b19992fb0ba460883b6ff2c 100644 (file)
@@ -9,7 +9,8 @@
 
 #ifdef __ASSEMBLER__
 # define _SDT_PROBE(provider, name, n, arglist)        \
-  _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING_1, (_SDT_DEPAREN_##n arglist))
+  _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING_1, (_SDT_DEPAREN_##n arglist)) \
+  _SDT_ASM_BASE
 # define _SDT_ASM_1(x)                 x;
 # define _SDT_ASM_2(a, b)              a,b;
 # define _SDT_ASM_3(a, b, c)           a,b,c;
 #else
 # include <stdint.h>
 # define _SDT_PROBE(provider, name, n, arglist) \
-  __asm__ __volatile__ (_SDT_ASM_BODY(provider, name, _SDT_ASM_ARGS, (n)) \
-                       :: _SDT_ASM_OPERANDS_##n arglist)
+  do {                                                                     \
+    __asm__ __volatile__ (_SDT_ASM_BODY(provider, name, _SDT_ASM_ARGS, (n)) \
+                         :: _SDT_ASM_OPERANDS_##n arglist);                \
+    __asm__ __volatile__ (_SDT_ASM_BASE);                                  \
+  } while (0)
 # define _SDT_S(x)                     #x
 # define _SDT_ASM_1(x)                 _SDT_S(x)"\n"
 # define _SDT_ASM_2(a, b)              _SDT_S(a)","_SDT_S(b)"\n"
   _SDT_ASM_STRING(name)                                                              \
   pack_args args                                                             \
   _SDT_ASM_1(994:      .balign 4)                                            \
-  _SDT_ASM_1(          .popsection)                                          \
+  _SDT_ASM_1(          .popsection)
+
+#define _SDT_ASM_BASE                                                        \
   _SDT_ASM_1(.ifndef _.stapsdt.base)                                         \
   _SDT_ASM_5(          .pushsection .stapsdt.base,"aG","progbits",           \
                                                        .stapsdt.base,comdat) \
 
 #if __STDC_VERSION__ >= 199901L
 # define STAP_PROBE_ASM(provider, name, ...)           \
-  _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING, (__VA_ARGS__))
+  _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING, (__VA_ARGS__)) \
+  _SDT_ASM_BASE
 # define STAP_PROBE_ASM_OPERANDS(n, ...) _SDT_ASM_OPERANDS_##n(__VA_ARGS__)
 #else
 # define STAP_PROBE_ASM(provider, name, args)  \
-  _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING, (args))
+  _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING, (args)) \
+  _SDT_ASM_BASE
 #endif
 #define STAP_PROBE_ASM_TEMPLATE(n)     _SDT_ASM_TEMPLATE_##n
 
This page took 0.026903 seconds and 5 git commands to generate.