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