Improve tracef/tracelog to use the stack for small strings
[lttng-ust.git] / src / lib / lttng-ust / tracef.c
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 "common/macros.h"
10 #include "common/tracer.h"
11
12 /* The tracepoint definition is public, but the provider definition is hidden. */
13 #define LTTNG_UST_TRACEPOINT_PROVIDER_HIDDEN_DEFINITION
14
15 #define LTTNG_UST_TRACEPOINT_CREATE_PROBES
16 #define LTTNG_UST_TRACEPOINT_DEFINE
17 #include "lttng-ust-tracef-provider.h"
18
19 #include "tracelog-internal.h"
20
21 void lttng_ust__vtracef(const char *fmt, va_list ap)
22 __attribute__((format(printf, 1, 0)));
23 void lttng_ust__vtracef(const char *fmt, va_list ap)
24 {
25 LTTNG_UST_TRACELOG_VALIST(fmt, ap,
26 lttng_ust_tracepoint_cb_lttng_ust_tracef___event,
27 msg, len, LTTNG_UST_CALLER_IP());
28 }
29
30 void lttng_ust__tracef(const char *fmt, ...)
31 __attribute__((format(printf, 1, 2)));
32 void lttng_ust__tracef(const char *fmt, ...)
33 {
34 LTTNG_UST_TRACELOG_VARARG(fmt,
35 lttng_ust_tracepoint_cb_lttng_ust_tracef___event,
36 msg, len, LTTNG_UST_CALLER_IP());
37 }
This page took 0.02918 seconds and 4 git commands to generate.