+#define LTTNG_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+
+/*
+ * Use of __builtin_return_address(0) sometimes seems to cause stack
+ * corruption on 32-bit PowerPC. Disable this feature on that
+ * architecture for now by always using the NULL value for the ip
+ * context.
+ */
+#if defined(__PPC__) && !defined(__PPC64__)
+#define LTTNG_UST_CALLER_IP() NULL
+#else /* #if defined(__PPC__) && !defined(__PPC64__) */
+#define LTTNG_UST_CALLER_IP() __builtin_return_address(0)
+#endif /* #else #if defined(__PPC__) && !defined(__PPC64__) */
+