X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Ftestpoint%2Ftestpoint.c;fp=src%2Fcommon%2Ftestpoint%2Ftestpoint.c;h=0000000000000000000000000000000000000000;hp=c70245894e347dc27f9a9b20128d655db4f663f4;hb=f6352cc1ebe6eb9a6bb7794f4a4d04dcb5370ad5;hpb=55caead7396fa6d4337db7fa8c64a1036393be9f diff --git a/src/common/testpoint/testpoint.c b/src/common/testpoint/testpoint.c deleted file mode 100644 index c70245894..000000000 --- a/src/common/testpoint/testpoint.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2012 Christian Babeux - * - * SPDX-License-Identifier: GPL-2.0-only - * - */ - -#ifndef NTESTPOINT - -#define _LGPL_SOURCE -#include /* for dlsym */ -#include /* for getenv */ -#include /* for strncmp */ - -#include "testpoint.h" - -/* Environment variable used to enable the testpoints facilities. */ -static const char *lttng_testpoint_env_var = "LTTNG_TESTPOINT_ENABLE"; - -/* Testpoint toggle flag */ -int lttng_testpoint_activated; - -/* - * Toggle the support for testpoints on the application startup. - */ -static void __attribute__((constructor)) lttng_testpoint_check(void) -{ - char *testpoint_env_val = NULL; - - testpoint_env_val = getenv(lttng_testpoint_env_var); - if (testpoint_env_val != NULL - && (strncmp(testpoint_env_val, "1", 1) == 0)) { - lttng_testpoint_activated = 1; - } -} - -/* - * Lookup a symbol by name. - * - * Return the address where the symbol is loaded or NULL if the symbol was not - * found. - */ -void *lttng_testpoint_lookup(const char *name) -{ - if (!name) { - return NULL; - } - - return dlsym(RTLD_DEFAULT, name); -} - -#endif /* NTESTPOINT */