Skip to content
Snippets Groups Projects
Commit e8b9309c authored by Olivier Dion's avatar Olivier Dion Committed by Adrien Béraud
Browse files

tracepoint: Add LTTng tracepoint generation

Change-Id: I6358f3ab5f464f1a553814c58b22245ef64f0b52
parent 983ae44f
No related branches found
No related tags found
No related merge requests found
......@@ -161,3 +161,8 @@ if ENABLE_VIDEO
nobase_include_HEADERS += \
./jami/videomanager_interface.h
endif
if ENABLE_TRACEPOINTS
libring_la_SOURCES += jami/tracepoint.h jami/tracepoint-def.h jami/tracepoint.c
libring_la_LIBADD += $(LTTNG_LIBS)
endif
#include "config.h"
#ifdef ENABLE_TRACEPOINTS
#undef LTTNG_UST_TRACEPOINT_PROVIDER
#define LTTNG_UST_TRACEPOINT_PROVIDER jami
#undef LTTNG_UST_TRACEPOINT_INCLUDE
#define LTTNG_UST_TRACEPOINT_INCLUDE "src/jami/tracepoint-def.h"
#if !defined(TRACEPOINT_DEF_H) || defined(LTTNG_UST_TRACEPOINT_HEADER_MULTI_READ)
#define TRACEPOINT_DEF_H
#include <lttng/tracepoint.h>
/*
* Use LTTNG_UST_TRACEPOINT_EVENT(), LTTNG_UST_TRACEPOINT_EVENT_CLASS(),
* LTTNG_UST_TRACEPOINT_EVENT_INSTANCE(), and LTTNG_UST_TRACEPOINT_LOGLEVEL()
* here.
*/
#endif /* TRACEPOINT_H */
#include <lttng/tracepoint-event.h>
#endif
#define LTTNG_UST_TRACEPOINT_CREATE_PROBES
#define LTTNG_UST_TRACEPOINT_DEFINE
#include "./tracepoint.h"
/*
* Copyright (C) 2022 Savoir-faire Linux Inc.
*
* Author: Olivier Dion <olivier.dion@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#include "tracepoint-def.h"
#pragma GCC diagnostic pop
#ifdef ENABLE_TRACEPOINTS
# ifndef lttng_ust_tracepoint
# define lttng_ust_tracepoint(...) tracepoint(__VA_ARGS__)
# endif
# ifndef lttng_ust_do_tracepoint
# define lttng_ust_do_tracepoint(...) do_tracepoint(__VA_ARGS__)
# endif
# ifndef lttng_ust_tracepoint_enabled
# define lttng_ust_tracepoint_enabled(...) tracepoint_enabled(__VA_ARGS__)
# endif
# define jami_tracepoint(tp_name, ...) \
lttng_ust_tracepoint(jami, tp_name __VA_OPT__(,) __VA_ARGS__)
# define jami_tracepoint_if_enabled(tp_name, ...) \
do { \
if (lttng_ust_tracepoint_enabled(jami, tp_name)) { \
lttng_ust_do_tracepoint(jami, \
tp_name \
__VA_OPT__(,) \
__VA_ARGS__); \
} \
} \
while (0)
#else
# define jami_tracepoint(...) static_assert(true)
# define jami_tracepoint_if_enabled(...) static_assert(true)
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment