Loading...
1/*
2 * Copyright (C) 2010 Red Hat Inc, Steven Rostedt <srostedt@redhat.com>
3 *
4 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation;
8 * version 2.1 of the License (not later!)
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, see <http://www.gnu.org/licenses>
17 *
18 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 */
20#include <stdio.h>
21#include <stdlib.h>
22#include <string.h>
23#include <stdarg.h>
24#include <errno.h>
25
26#define __weak __attribute__((weak))
27
28void __vwarning(const char *fmt, va_list ap)
29{
30 if (errno)
31 perror("trace-cmd");
32 errno = 0;
33
34 fprintf(stderr, " ");
35 vfprintf(stderr, fmt, ap);
36
37 fprintf(stderr, "\n");
38}
39
40void __warning(const char *fmt, ...)
41{
42 va_list ap;
43
44 va_start(ap, fmt);
45 __vwarning(fmt, ap);
46 va_end(ap);
47}
48
49void __weak warning(const char *fmt, ...)
50{
51 va_list ap;
52
53 va_start(ap, fmt);
54 __vwarning(fmt, ap);
55 va_end(ap);
56}
57
58void __vpr_stat(const char *fmt, va_list ap)
59{
60 vprintf(fmt, ap);
61 printf("\n");
62}
63
64void __pr_stat(const char *fmt, ...)
65{
66 va_list ap;
67
68 va_start(ap, fmt);
69 __vpr_stat(fmt, ap);
70 va_end(ap);
71}
72
73void __weak vpr_stat(const char *fmt, va_list ap)
74{
75 __vpr_stat(fmt, ap);
76}
77
78void __weak pr_stat(const char *fmt, ...)
79{
80 va_list ap;
81
82 va_start(ap, fmt);
83 __vpr_stat(fmt, ap);
84 va_end(ap);
85}
1// SPDX-License-Identifier: LGPL-2.1
2/*
3 * Copyright (C) 2010 Red Hat Inc, Steven Rostedt <srostedt@redhat.com>
4 *
5 */
6#include <stdio.h>
7#include <stdlib.h>
8#include <string.h>
9#include <stdarg.h>
10#include <errno.h>
11
12#define __weak __attribute__((weak))
13
14void __vwarning(const char *fmt, va_list ap)
15{
16 if (errno)
17 perror("libtraceevent");
18 errno = 0;
19
20 fprintf(stderr, " ");
21 vfprintf(stderr, fmt, ap);
22
23 fprintf(stderr, "\n");
24}
25
26void __warning(const char *fmt, ...)
27{
28 va_list ap;
29
30 va_start(ap, fmt);
31 __vwarning(fmt, ap);
32 va_end(ap);
33}
34
35void __weak warning(const char *fmt, ...)
36{
37 va_list ap;
38
39 va_start(ap, fmt);
40 __vwarning(fmt, ap);
41 va_end(ap);
42}
43
44void __vpr_stat(const char *fmt, va_list ap)
45{
46 vprintf(fmt, ap);
47 printf("\n");
48}
49
50void __pr_stat(const char *fmt, ...)
51{
52 va_list ap;
53
54 va_start(ap, fmt);
55 __vpr_stat(fmt, ap);
56 va_end(ap);
57}
58
59void __weak vpr_stat(const char *fmt, va_list ap)
60{
61 __vpr_stat(fmt, ap);
62}
63
64void __weak pr_stat(const char *fmt, ...)
65{
66 va_list ap;
67
68 va_start(ap, fmt);
69 __vpr_stat(fmt, ap);
70 va_end(ap);
71}