|
|
c6d234 |
commit 520d437b9455560d099fe6bd9664be1f9f76868b
|
|
|
c6d234 |
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
|
|
|
c6d234 |
Date: Tue Dec 3 12:26:12 2013 +0530
|
|
|
c6d234 |
|
|
|
c6d234 |
[BZ #16195] Fix build warnings from systemtap probes in non-systemtap configurations
|
|
|
c6d234 |
|
|
|
c6d234 |
Joseph pointed out in the bug report (and in an earlier thread) that
|
|
|
c6d234 |
systemtap probes cause build time warnings like the following:
|
|
|
c6d234 |
|
|
|
c6d234 |
../sysdeps/ieee754/dbl-64/e_atan2.c:602:4: warning: the address of
|
|
|
c6d234 |
'p' will always evaluate as 'true' [-Waddress]
|
|
|
c6d234 |
|
|
|
c6d234 |
due to the fact that we're now passing non-weak variables to
|
|
|
c6d234 |
LIBC_PROBE in the libm probes. This happens only on configurations
|
|
|
c6d234 |
that do not enable systemtap. The macro definition of LIBC_PROBE in
|
|
|
c6d234 |
this case only acts as a sanity checker to ensure that the number
|
|
|
c6d234 |
parameters passed to LIBC_PROBE is equal to the argument count
|
|
|
c6d234 |
parameter passed before it. This can be done in a much simpler manner
|
|
|
c6d234 |
by just adding a macro definition for each number of arguments. I am
|
|
|
c6d234 |
assuming here that we don't really want to bother with supporting
|
|
|
c6d234 |
LIBC_PROBE with an indeterminate number of arguments and if there is a
|
|
|
c6d234 |
need for a probe to have more data than what is currently supported (4
|
|
|
c6d234 |
arguments), one could simply add an additional macro here.
|
|
|
c6d234 |
|
|
|
c6d234 |
diff --git a/include/stap-probe.h b/include/stap-probe.h
|
|
|
c6d234 |
index 0f65c29b2b5c5dde..0ddb5d5fc9f740dd 100644
|
|
|
c6d234 |
--- a/include/stap-probe.h
|
|
|
c6d234 |
+++ b/include/stap-probe.h
|
|
|
c6d234 |
@@ -49,13 +49,14 @@
|
|
|
c6d234 |
|
|
|
c6d234 |
# ifndef __ASSEMBLER__
|
|
|
c6d234 |
/* Evaluate all the arguments and verify that N matches their number. */
|
|
|
c6d234 |
-# define LIBC_PROBE(name, n, ...) \
|
|
|
c6d234 |
- do { \
|
|
|
c6d234 |
- _Bool __libc_probe_args[] = { 0, ## __VA_ARGS__ }; \
|
|
|
c6d234 |
- _Bool __libc_probe_verify_n[(sizeof __libc_probe_args / sizeof (_Bool)) \
|
|
|
c6d234 |
- == n + 1 ? 1 : -1]; \
|
|
|
c6d234 |
- (void) __libc_probe_verify_n; \
|
|
|
c6d234 |
- } while (0)
|
|
|
c6d234 |
+#define LIBC_PROBE(name, n, ...) STAP_PROBE##n (__VA_ARGS__)
|
|
|
c6d234 |
+
|
|
|
c6d234 |
+#define STAP_PROBE0()
|
|
|
c6d234 |
+#define STAP_PROBE1(a1)
|
|
|
c6d234 |
+#define STAP_PROBE2(a1, a2)
|
|
|
c6d234 |
+#define STAP_PROBE3(a1, a2, a3)
|
|
|
c6d234 |
+#define STAP_PROBE4(a1, a2, a3, a4)
|
|
|
c6d234 |
+
|
|
|
c6d234 |
# else
|
|
|
c6d234 |
# define LIBC_PROBE(name, n, ...) /* Nothing. */
|
|
|
c6d234 |
# endif
|