Fix: liblttng-ust-ctl: missing ring buffer and counter clients init/exit symbols
[lttng-ust.git] / liblttng-ust / tracef.c
... / ...
CommitLineData
1/*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (C) 2013-2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 */
6
7#define _LGPL_SOURCE
8#include <stdio.h>
9#include <ust-helper.h>
10
11#define TRACEPOINT_CREATE_PROBES
12#define TRACEPOINT_DEFINE
13#include "lttng-ust-tracef-provider.h"
14
15static inline __attribute__((always_inline, format(printf, 1, 0)))
16void __lttng_ust_vtracef(const char *fmt, va_list ap)
17{
18 char *msg;
19 const int len = vasprintf(&msg, fmt, ap);
20
21 /* len does not include the final \0 */
22 if (len < 0)
23 goto end;
24 __tracepoint_cb_lttng_ust_tracef___event(msg, len,
25 LTTNG_UST_CALLER_IP());
26 free(msg);
27end:
28 return;
29}
30
31__attribute__((format(printf, 1, 0)))
32void _lttng_ust_vtracef(const char *fmt, va_list ap);
33void _lttng_ust_vtracef(const char *fmt, va_list ap)
34{
35 __lttng_ust_vtracef(fmt, ap);
36}
37
38__attribute__((format(printf, 1, 2)))
39void _lttng_ust_tracef(const char *fmt, ...);
40void _lttng_ust_tracef(const char *fmt, ...)
41{
42 va_list ap;
43
44 va_start(ap, fmt);
45 __lttng_ust_vtracef(fmt, ap);
46 va_end(ap);
47}
This page took 0.022395 seconds and 4 git commands to generate.