]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use MODULE_NAME in stap-probe instead of IN_LIB
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Thu, 21 Aug 2014 06:25:35 +0000 (11:55 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Wed, 5 Nov 2014 10:39:39 +0000 (16:09 +0530)
Verified that the generated code is unchanged on x86_64.

* scripts/gen-libc-modules.awk (END): Generate defines for
MODULE_NAME.
* include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead
of IN_LIB.
(STAP_PROBE_ASM): Likewise.

include/stap-probe.h
scripts/gen-libc-modules.awk

index 688646c9e9d1097d9780949f8e68ba2761803056..150fc1ec26867470271521cc8480d5147f390f1a 100644 (file)
@@ -30,7 +30,7 @@
 
    Systemtap's header defines the macros STAP_PROBE (provider, name) and
    STAP_PROBEn (provider, name, arg1, ..., argn).  For "provider" we paste
-   in the IN_LIB name (libc, libpthread, etc.) automagically.
+   in MODULE_NAME (libc, libpthread, etc.) automagically.
 
    The format of the arg parameters is discussed here:
 
@@ -53,7 +53,7 @@
 # endif
 
 # define LIBC_PROBE(name, n, ...)      \
-  LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
+  LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__)
 
 # define LIBC_PROBE_1(lib, name, n, ...) \
   STAP_PROBE##n (lib, name, ## __VA_ARGS__)
@@ -61,7 +61,7 @@
 # define STAP_PROBE0           STAP_PROBE
 
 # define LIBC_PROBE_ASM(name, template) \
-  STAP_PROBE_ASM (IN_LIB, name, template)
+  STAP_PROBE_ASM (MODULE_NAME, name, template)
 
 # define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
 
index d3382b686aa0ad661ffbccc5a13b0b7aff6cea03..1ae4af37f0635d6e287f4f8bbe40ea82ab27b0a9 100644 (file)
@@ -32,9 +32,16 @@ match (FILENAME, ".*soversions.i") {
 
 # Finally, print out the header file.
 END {
-  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n\n")
+  printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT.  */\n")
   i = 1
+  print ("\n/* Allowed values for IN_MODULE.  */")
   for (l in libs) {
     printf ("#define MODULE_%s %d\n", l, libs[l])
   }
+  print ("\n/* Module names, used in stap-probe.h */")
+  for (l in libs) {
+    printf ("#if IN_MODULE == MODULE_%s\n", l)
+    printf ("# define MODULE_NAME %s\n", l)
+    printf ("#endif\n")
+  }
 }