The listing of triggers which use an event rule match condition
consisting in a user space probe set on an SDT probe fails since
28f23191d.
The coding style imposes an order of includes. However, the order in
which the probe declarations generated by systemtap vs sdt.h matters.
From SYSTEMTAP(2):
Sometimes, semaphore variables are not necessary nor helpful. Skipping
them can simplify the build process, by omitting the extra "test.o"
file. To skip dependence upon semaphore variables, include "<sys/sdt.h>"
within the application before "test.h":
[...]
In this mode, the ENABLED() test is fixed at 1.
The reformatted version of userspace-probe-sdt-binary.c includes sdt.h
after the probe causing the probes to use a guarding semaphore.
Unfortunately, we can't instrument such probes and the registration of
the trigger silently fails. The silent failure is addressed by a
follow-up commit.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I5146f55ed5d9d109f1f7bc32e0f7c2c8bf839f8e
*
*/
+/*
+ * The order of inclusion is important here: including sdt.h _before_ the probe
+ * declarations ensures that semaphore-protected SDT probes (which we don't support) are not
+ * generated. See SYSTEMTAP(2) for more details.
+ */
+/* clang-format off */
+#include <sys/sdt.h>
#include "foobar_provider.h"
+/* clang-format on */
-#include <sys/sdt.h>
void bar_function()
{
FOOBAR_TP_IN_DLOPEN();
*
*/
+/*
+ * The order of inclusion is important here: including sdt.h _before_ the probe
+ * declarations ensures that semaphore-protected SDT probes (which we don't support) are not
+ * generated. See SYSTEMTAP(2) for more details.
+ */
+/* clang-format off */
+#include <sys/sdt.h>
#include "foobar_provider.h"
+/* clang-format on */
-#include <sys/sdt.h>
void foo_function()
{
FOOBAR_TP_IN_SHARED_OBJECT();
*
*/
+/*
+ * The order of inclusion is important here: including sdt.h _before_ the probe
+ * declarations ensures that semaphore-protected SDT probes (which we don't support) are not
+ * generated. See SYSTEMTAP(2) for more details.
+ */
+/* clang-format off */
+#include <sys/sdt.h>
#include "foobar_provider.h"
+/* clang-format on */
-#include <sys/sdt.h>
void overridable_function()
{
FOOBAR_TP_IN_LDPRELOAD();
*
*/
+/*
+ * The order of inclusion is important here: including sdt.h _after_ the probe
+ * declarations ensures that semaphore-protected SDT probes are
+ * generated. See SYSTEMTAP(2) for more details.
+ */
+/* clang-format off */
#include "foobar_provider.h"
-
#include <sys/sdt.h>
+/* clang-format on */
+
void sema_function()
{
FOOBAR_TP_WITH_SEMAPHORE();
#define _GNU_SOURCE
#endif
+/*
+ * The order of inclusion is important here: including sdt.h _before_ the probe
+ * declarations ensures that semaphore-protected SDT probes (which we don't support) are not
+ * generated. See SYSTEMTAP(2) for more details.
+ */
+/* clang-format off */
+#include <sys/sdt.h>
#include "foobar_provider.h"
+/* clang-format on */
+
#include "libfoo.h"
#include "sema.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
-#include <sys/sdt.h>
#include <sys/stat.h>
#include <sys/types.h>