X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Ftestpoint%2Ftestpoint.h;h=33cb9aa340cc71e64939be17844aaea3e42fa26c;hb=HEAD;hp=b613b1749dab4d4258bffc0857ad745d4883fe74;hpb=7966af5763c4aaca39df9bbfa9277ff15715c720;p=lttng-tools.git diff --git a/src/common/testpoint/testpoint.h b/src/common/testpoint/testpoint.h deleted file mode 100644 index b613b1749..000000000 --- a/src/common/testpoint/testpoint.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2012 Christian Babeux - * - * SPDX-License-Identifier: GPL-2.0-only - * - */ - -#ifdef NTESTPOINT - -#define testpoint(name) -#define TESTPOINT_DECL(name) - -#else /* NTESTPOINT */ - -#include /* for caa_likely/unlikely */ - -#ifdef __cplusplus -extern "C" { -#endif - -extern int lttng_testpoint_activated; - -void *lttng_testpoint_lookup(const char *name); - -/* - * Testpoint is only active if the global lttng_testpoint_activated flag is - * set. - * Return a non-zero error code to indicate failure. - */ -#define testpoint(name) \ - ((caa_unlikely(lttng_testpoint_activated)) \ - ? __testpoint_##name##_wrapper() : 0) - -/* - * One wrapper per testpoint is generated. This is to keep track of the symbol - * lookup status and the corresponding function pointer, if any. - */ -#define _TESTPOINT_DECL(_name) \ - static inline int __testpoint_##_name##_wrapper(void) \ - { \ - int ret = 0; \ - static int (*tp)(void); \ - static int found; \ - const char *tp_name = "__testpoint_" #_name; \ - \ - if (tp) { \ - ret = tp(); \ - } else { \ - if (!found) { \ - tp = (int (*)(void)) lttng_testpoint_lookup(tp_name); \ - if (tp) { \ - found = 1; \ - ret = tp(); \ - } else { \ - found = -1; \ - } \ - } \ - } \ - return ret; \ - } - -/* Testpoint declaration */ -#define TESTPOINT_DECL(name) \ - _TESTPOINT_DECL(name) - -#ifdef __cplusplus -} -#endif - -#endif /* NTESTPOINT */