.minor = LTTNG_UST_PROVIDER_MINOR,
};
+static int _TP_COMBINE_TOKENS(__probe_register_refcount___, TRACEPOINT_PROVIDER);
+
/*
* Stage 9 of tracepoint event generation.
*
*
* Generate the constructor as an externally visible symbol for use when
* linking the probe statically.
+ *
+ * Register refcount is protected by libc dynamic loader mutex.
*/
/* Reset all macros within TRACEPOINT_EVENT */
{
int ret;
+ if (_TP_COMBINE_TOKENS(__probe_register_refcount___,
+ TRACEPOINT_PROVIDER)++) {
+ return;
+ }
/*
* __tracepoint_provider_check_ ## TRACEPOINT_PROVIDER() is a
* static inline function that ensures every probe PROVIDER
static void
_TP_COMBINE_TOKENS(__lttng_events_exit__, TRACEPOINT_PROVIDER)(void)
{
+ if (--_TP_COMBINE_TOKENS(__probe_register_refcount___,
+ TRACEPOINT_PROVIDER)) {
+ return;
+ }
lttng_probe_unregister(&_TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER));
}
lttng-hash-helper.h \
lttng-ust-baddr.c \
lttng-ust-baddr.h \
- ust_baddr_statedump.c \
ust_baddr_statedump.h \
tracepoint-internal.h \
clock.h \
#include "lttng-ust-baddr.h"
#define TRACEPOINT_DEFINE
+#define TRACEPOINT_CREATE_PROBES
+#define TP_SESSION_CHECK
#include "ust_baddr_statedump.h"
struct extract_data {
{
__tracepoints__init();
__tracepoints__ptrs_init();
+ __lttng_events_init__ust_baddr_statedump();
}
void lttng_ust_baddr_statedump_destroy(void)
{
+ __lttng_events_exit__ust_baddr_statedump();
__tracepoints__ptrs_destroy();
__tracepoints__destroy();
}
+++ /dev/null
-/*
- * Copyright (C) 2013 Paul Woegerer <paul_woegerer@mentor.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define _LGPL_SOURCE
-#define TRACEPOINT_CREATE_PROBES
-#define TP_SESSION_CHECK
-#include "ust_baddr_statedump.h"